Code

Store a global list of existing perspectives; for each perspective hold a list of...
[inkscape.git] / src / perspective-line.h
1 /*
2  * Perspective line for 3D perspectives
3  *
4  * Authors:
5  *   Maximilian Albert <Anhalter42@gmx.de>
6  *
7  * Copyright (C) 2007 authors
8  *
9  * Released under GNU GPL, read the file 'COPYING' for more information
10  */
12 #ifndef SEEN_PERSPECTIVE_LINE_H
13 #define SEEN_PERSPECTIVE_LINE_H
15 #include "vanishing-point.h"
16 #include "line-geometry.h"
17 #include "box3d-context.h" 
18 #include <glib.h>
20 namespace Box3D {
22 class PerspectiveLine : public Box3D::Line {
23 public:
24     /** 
25      * Create a perspective line starting at 'pt' and pointing in the direction of the
26      * vanishing point corresponding to 'axis'. If the VP has style VP_FINITE then the
27      * PL runs through it; otherwise it has the direction specified by the v_dir vector
28      * of the VP.
29      */
30     PerspectiveLine (NR::Point const &pt, Box3D::Axis const axis, Perspective3D *perspective);
31     NR::Maybe<NR::Point> intersect (Line const &line); // FIXME: Can we make this return only a NR::Point to remove the extra method meet()?
32     NR::Point meet (Line const &line);
33         
34 private:
35     Box3D::Axis vp_dir; // direction of the associated VP
36     Perspective3D *persp;
37 };
40 } // namespace Box3D
43 /** A function to print out the VanishingPoint (prints the coordinates) **/
44 /***
45 inline std::ostream &operator<< (std::ostream &out_file, const VanishingPoint &vp) {
46     out_file << vp;
47     return out_file;
48 }
49 ***/
52 #endif /* !SEEN_PERSPECTIVE_LINE_H */
54 /*
55   Local Variables:
56   mode:c++
57   c-file-style:"stroustrup"
58   c-file-offsets:((innamespace . 0)(inline-open . 0))
59   indent-tabs-mode:nil
60   fill-column:99
61   End:
62 */
63 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :