diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2007-06-21 13:01:57 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2007-06-21 13:01:57 +0000 |
| commit | cf233ff5bbc68bd598ef4b81c7b4063548f2eff9 (patch) | |
| tree | 56d48726d21ad368509a945bf7df91966115cc9c /src/perspective-line.h | |
| parent | Fix function plotter for the most common case where there are no transforms a... (diff) | |
| download | inkscape-cf233ff5bbc68bd598ef4b81c7b4063548f2eff9.tar.gz inkscape-cf233ff5bbc68bd598ef4b81c7b4063548f2eff9.zip | |
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)
Diffstat (limited to 'src/perspective-line.h')
| -rw-r--r-- | src/perspective-line.h | 63 |
1 files changed, 63 insertions, 0 deletions
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 <Anhalter42@gmx.de> + * + * 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 <glib.h> + +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<NR::Point> 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 : |
