source: projectionDesigner/trunk/projdesigner/include/screen/ScreenPlane.h @ 132

Last change on this file since 132 was 4, checked in by Torben Dannhauer, 15 years ago
File size: 3.4 KB
RevLine 
[4]1#ifndef _SCREEN_PLANE_H_
2#define _SCREEN_PLANE_H_
3
4#include "screen/ScreenShape.h"
5
6namespace projection
7{
8
9/**
10  * Plane screen class.
11  */
12class ScreenPlane : public ScreenShape
13{
14public:
15
16    /**
17     * Constructor.
18     *
19     * @param pScreen Screen data.
20     */
21    ScreenPlane(Screen* pScreen);
22
23    /**
24     * Destructor.
25     */
26    virtual ~ScreenPlane();
27
28    /**
29     * Retrieve name of the sceen shape.
30     *
31     * @return Name of the screen shape.
32     */
33    QString getName() const { return "Plane"; }
34
35    /**
36     * Set width of the plane screen.
37     *
38     * @param width Width of the plane screen.
39     */
40    void setWidth(double width);
41
42    /**
43     * Retrieve width of the plane screen.
44     *
45     * @return Width of the plane screen.
46     */
47    double getWidth() const { return m_width; }
48
49    /**
50     * Set height of the plane screen.
51     *
52     * @param height Height of the plane screen.
53     */
54    void setHeight(double height);
55
56    /**
57     * Retrieve height of the plane screen.
58     *
59     * @return Height of the plane screen.
60     */
61    double getHeight() const { return m_height; }
62
63    /**
64     * Set horizontal resolution of the plane screen.
65     *
66     * @param resolution Horizontal resolution of the plane screen.
67     */
68    void setHorResolution(unsigned int resolution);
69
70    /**
71     * Retrieve horizontal resolution of the plane screen.
72     *
73     * @return Horizontal resolution of the plane screen.
74     */
75    unsigned int getHorResolution() const { return m_horResolution; }
76
77    /**
78     * Set vertical resolution of the plane screen.
79     *
80     * @param resolution Vertical resolution of the plane screen.
81     */
82    void setVertResolution(unsigned int resolution);
83
84    /**
85     * Retrieve vertical resolution of the plane screen.
86     *
87     * @return Vertical resolution of the plane screen.
88     */
89    unsigned int getVertResolution() const { return m_vertResolution; }
90
91    /**
92     * Retrieve bounding box of the screen shape.
93     *
94     * @param min One corner of the screen shape.
95     * @param max Another corner of the screen shape.
96     */
97        void getBoundingBox(gmtl::Vec3f& min, gmtl::Vec3f& max);
98
99    /**
100     * Check whether the shape needs clipping for projection image.
101     *
102     * @return True if  the projection requires clipping.
103     */
104    virtual bool isClippingRequired() const { return false; }
105
106    /**
107     * Restore the screen shape from XML data.
108     *
109     * @param element Parent XML element of the screen shape data.
110     */
111        virtual bool initFromDOMElement(const QDomElement& element);
112
113    /**
114     * Store the current screen shape as XML data.
115     *
116     * @param name XML node name of the data.
117     * @param doc XML document to store the data.
118     * @return Current screen shape data as XML data.
119     */
120    virtual QDomElement domElement(const QString& name, QDomDocument& doc) const;
121
122protected:
123
124    /**
125     * Draw the shape model in inherited class.
126     *
127     * @param bFrame True to draw a wire frame mesh. False to draw as a polygon model.
128     */
129    void drawShape(bool bFrame);
130
131protected:
132
133    double m_width;                 //!< Width.
134    double m_height;                //!< Height.
135    unsigned int m_horResolution;   //!< Horizontal resolution.
136    unsigned int m_vertResolution;  //!< Vertical resolution.
137};
138
139}; // projection
140
141#endif // _SCREEN_PLANE_H_
Note: See TracBrowser for help on using the repository browser.