1 | #ifndef _SCREEN_BOX_H_ |
---|
2 | #define _SCREEN_BOX_H_ |
---|
3 | |
---|
4 | #include "screen/ScreenShape.h" |
---|
5 | |
---|
6 | namespace projection |
---|
7 | { |
---|
8 | |
---|
9 | /** |
---|
10 | * Box screen class. |
---|
11 | */ |
---|
12 | class ScreenBox : public ScreenShape |
---|
13 | { |
---|
14 | public: |
---|
15 | |
---|
16 | /** |
---|
17 | * Constructor. |
---|
18 | * |
---|
19 | * @param pScreen Screen data. |
---|
20 | */ |
---|
21 | ScreenBox(Screen* pScreen); |
---|
22 | |
---|
23 | /** |
---|
24 | * Destructor. |
---|
25 | */ |
---|
26 | virtual ~ScreenBox(); |
---|
27 | |
---|
28 | /** |
---|
29 | * Retrieve name of the sceen shape. |
---|
30 | * |
---|
31 | * @return Name of the screen shape. |
---|
32 | */ |
---|
33 | QString getName() const { return "Box"; } |
---|
34 | |
---|
35 | /** |
---|
36 | * Set width of the box screen. |
---|
37 | * |
---|
38 | * @param width Width of the box screen. |
---|
39 | */ |
---|
40 | void setWidth(double width); |
---|
41 | |
---|
42 | /** |
---|
43 | * Retrieve width of the box screen. |
---|
44 | * |
---|
45 | * @return Width of the box screen. |
---|
46 | */ |
---|
47 | double getWidth() const { return m_width; } |
---|
48 | |
---|
49 | /** |
---|
50 | * Set height of the box screen. |
---|
51 | * |
---|
52 | * @param height Height of the box screen. |
---|
53 | */ |
---|
54 | void setHeight(double height); |
---|
55 | |
---|
56 | /** |
---|
57 | * Retrieve height of the box screen. |
---|
58 | * |
---|
59 | * @return Height of the box screen. |
---|
60 | */ |
---|
61 | double getHeight() const { return m_height; } |
---|
62 | |
---|
63 | /** |
---|
64 | * Set depth of the box screen. |
---|
65 | * |
---|
66 | * @param depth Depth of the box screen. |
---|
67 | */ |
---|
68 | void setDepth(double depth); |
---|
69 | |
---|
70 | /** |
---|
71 | * Retrieve depth of the box screen. |
---|
72 | * |
---|
73 | * @return Depth of the box screen. |
---|
74 | */ |
---|
75 | double getDepth() const { return m_depth; } |
---|
76 | |
---|
77 | /** |
---|
78 | * Set horizontal resolution of the box screen. |
---|
79 | * |
---|
80 | * @param resolution Horizontal resolution of the box screen. |
---|
81 | */ |
---|
82 | void setHorResolution(unsigned int resolution); |
---|
83 | |
---|
84 | /** |
---|
85 | * Retrieve horizontal resolution of the box screen. |
---|
86 | * |
---|
87 | * @return Horizontal resolution of the box screen. |
---|
88 | */ |
---|
89 | unsigned int getHorResolution() const { return m_horResolution; } |
---|
90 | |
---|
91 | /** |
---|
92 | * Set vertical resolution of the box screen. |
---|
93 | * |
---|
94 | * @param resolution Vertical resolution of the box screen. |
---|
95 | */ |
---|
96 | void setVertResolution(unsigned int resolution); |
---|
97 | |
---|
98 | /** |
---|
99 | * Retrieve vertical resolution of the box screen. |
---|
100 | * |
---|
101 | * @return Vertical resolution of the box screen. |
---|
102 | */ |
---|
103 | unsigned int getVertResolution() const { return m_vertResolution; } |
---|
104 | |
---|
105 | /** |
---|
106 | * Set depth resolution of the box screen. |
---|
107 | * |
---|
108 | * @param resolution Depth resolution of the box screen. |
---|
109 | */ |
---|
110 | void setDepthResolution(unsigned int resolution); |
---|
111 | |
---|
112 | /** |
---|
113 | * Retrieve depth resolution of the box screen. |
---|
114 | * |
---|
115 | * @return Depth resolution of the box screen. |
---|
116 | */ |
---|
117 | unsigned int getDepthResolution() const { return m_depthResolution; } |
---|
118 | |
---|
119 | /** |
---|
120 | * Retrieve bounding box of the screen shape. |
---|
121 | * |
---|
122 | * @param min One corner of the screen shape. |
---|
123 | * @param max Another corner of the screen shape. |
---|
124 | */ |
---|
125 | void getBoundingBox(gmtl::Vec3f& min, gmtl::Vec3f& max); |
---|
126 | |
---|
127 | /** |
---|
128 | * Restore the screen shape from XML data. |
---|
129 | * |
---|
130 | * @param element Parent XML element of the screen shape data. |
---|
131 | */ |
---|
132 | virtual bool initFromDOMElement(const QDomElement& element); |
---|
133 | |
---|
134 | /** |
---|
135 | * Store the current screen shape as XML data. |
---|
136 | * |
---|
137 | * @param name XML node name of the data. |
---|
138 | * @param doc XML document to store the data. |
---|
139 | * @return Current screen shape data as XML data. |
---|
140 | */ |
---|
141 | virtual QDomElement domElement(const QString& name, QDomDocument& doc) const; |
---|
142 | |
---|
143 | protected: |
---|
144 | |
---|
145 | /** |
---|
146 | * Draw the shape model in inherited class. |
---|
147 | * |
---|
148 | * @param bFrame True to draw a wire frame mesh. False to draw as a polygon model. |
---|
149 | */ |
---|
150 | void drawShape(bool bFrame); |
---|
151 | |
---|
152 | protected: |
---|
153 | |
---|
154 | double m_width; //!< Width. |
---|
155 | double m_height; //!< Height. |
---|
156 | double m_depth; //!< Depth. |
---|
157 | unsigned int m_horResolution; //!< Horizontal resolution. |
---|
158 | unsigned int m_vertResolution; //!< Vertical resolution. |
---|
159 | unsigned int m_depthResolution; //!< Depth resolution. |
---|
160 | }; |
---|
161 | |
---|
162 | }; // projection |
---|
163 | |
---|
164 | #endif // _SCREEN_BOX_H_ |
---|