| 43 double lw, lh; |
43 double lw, lh; |
| 44 str fname; |
44 str fname; |
| 45 QImage* img; |
45 QImage* img; |
| 46 }; |
46 }; |
| 47 |
47 |
| 48 // Alias for short namespaces |
|
| 49 typedef GLRenderer GL; |
|
| 50 |
|
| 51 // ============================================================================= |
48 // ============================================================================= |
| 52 // GLRenderer |
49 // GLRenderer |
| 53 // |
50 // |
| 54 // The main renderer object, draws the brick on the screen, manages the camera |
51 // The main renderer object, draws the brick on the screen, manages the camera |
| 55 // and selection picking. The instance of GLRenderer is accessible as |
52 // and selection picking. The instance of GLRenderer is accessible as |
| 89 void resetAngles (); |
86 void resetAngles (); |
| 90 uchar* screencap (ushort& w, ushort& h); |
87 uchar* screencap (ushort& w, ushort& h); |
| 91 void setBackground (); |
88 void setBackground (); |
| 92 void setCamera (const Camera cam); |
89 void setCamera (const Camera cam); |
| 93 void setDepthValue (double depth); |
90 void setDepthValue (double depth); |
| 94 void setupOverlay (); |
91 bool setupOverlay ( GLRenderer::Camera cam, str file, int x, int y, int w, int h ); |
| 95 void updateOverlayObjects(); |
92 void updateOverlayObjects(); |
| 96 void zoomNotch (bool inward); |
93 void zoomNotch (bool inward); |
| 97 void zoomToFit (); |
94 void zoomToFit (); |
| 98 |
95 |
| 99 static void deleteLists (LDObject* obj); |
96 static void deleteLists (LDObject* obj); |
| 149 void compileList (LDObject* obj, const ListType list); // Compile one of the lists of an object |
146 void compileList (LDObject* obj, const ListType list); // Compile one of the lists of an object |
| 150 void compileSubObject (LDObject* obj, const GLenum gltype); // Sub-routine for object compiling |
147 void compileSubObject (LDObject* obj, const GLenum gltype); // Sub-routine for object compiling |
| 151 void compileVertex (const vertex& vrt); // Compile a single vertex to a list |
148 void compileVertex (const vertex& vrt); // Compile a single vertex to a list |
| 152 vertex coordconv2_3 (const QPoint& pos2d, bool snap) const; // Convert a 2D point to a 3D point |
149 vertex coordconv2_3 (const QPoint& pos2d, bool snap) const; // Convert a 2D point to a 3D point |
| 153 QPoint coordconv3_2 (const vertex& pos3d) const; // Convert a 3D point to a 2D point |
150 QPoint coordconv3_2 (const vertex& pos3d) const; // Convert a 3D point to a 2D point |
| 154 LDOverlay* findOverlayObject ( GL::Camera cam ); |
151 LDOverlay* findOverlayObject ( Camera cam ); |
| 155 void updateRectVerts (); |
152 void updateRectVerts (); |
| 156 void pick (uint mouseX, uint mouseY); // Perform object selection |
153 void pick (uint mouseX, uint mouseY); // Perform object selection |
| 157 void setObjectColor (LDObject* obj, const ListType list); // Set the color to an object list |
154 void setObjectColor (LDObject* obj, const ListType list); // Set the color to an object list |
| 158 |
155 |
| 159 private slots: |
156 private slots: |
| 160 void slot_toolTipTimer (); |
157 void slot_toolTipTimer (); |
| 161 }; |
158 }; |
| |
159 |
| |
160 // Alias for short namespaces |
| |
161 typedef GLRenderer GL; |
| 162 |
162 |
| 163 static const GLRenderer::ListType g_glListTypes[] = { |
163 static const GLRenderer::ListType g_glListTypes[] = { |
| 164 GL::NormalList, |
164 GL::NormalList, |
| 165 GL::PickList, |
165 GL::PickList, |
| 166 GL::BFCFrontList, |
166 GL::BFCFrontList, |