From cf233ff5bbc68bd598ef4b81c7b4063548f2eff9 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 21 Jun 2007 13:01:57 +0000 Subject: First (very limited) version of the 3D box tool; allows for drawing of new boxes in a fixed perspective without any live interaction. (bzr r3084) --- src/perspective-line.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/perspective-line.h (limited to 'src/perspective-line.h') diff --git a/src/perspective-line.h b/src/perspective-line.h new file mode 100644 index 000000000..a1c61c522 --- /dev/null +++ b/src/perspective-line.h @@ -0,0 +1,63 @@ +/* + * Perspective line for 3D perspectives + * + * Authors: + * Maximilian Albert + * + * Copyright (C) 2007 authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef SEEN_PERSPECTIVE_LINE_H +#define SEEN_PERSPECTIVE_LINE_H + +#include "vanishing-point.h" +#include "box3d-context.h" +#include + +namespace Box3D { + +class PerspectiveLine : public Box3D::Line { +public: + /** + * Create a perspective line starting at 'pt' and pointing in the direction of the + * vanishing point corresponding to 'axis'. If the VP has style VP_FINITE then the + * PL runs through it; otherwise it has the direction specified by the v_dir vector + * of the VP. + */ + PerspectiveLine (NR::Point const &pt, PerspDir const axis, + Perspective3D *perspective = SP3DBoxContext::current_perspective); + NR::Maybe intersect (Line const &line); // FIXME: Can we make this return only a NR::Point to remove the extra method meet()? + NR::Point meet (Line const &line); + +private: + PerspDir vp_dir; // direction of the associated VP + Perspective3D *persp; +}; + + +} // namespace Box3D + + +/** A function to print out the VanishingPoint (prints the coordinates) **/ +/*** +inline std::ostream &operator<< (std::ostream &out_file, const VanishingPoint &vp) { + out_file << vp; + return out_file; +} +***/ + + +#endif /* !SEEN_PERSPECTIVE_LINE_H */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : -- cgit v1.2.3