| 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 |
| 48 // ============================================================================= |
51 // ============================================================================= |
| 49 // GLRenderer |
52 // GLRenderer |
| 50 // |
53 // |
| 51 // The main renderer object, draws the brick on the screen, manages the camera |
54 // The main renderer object, draws the brick on the screen, manages the camera |
| 52 // and selection picking. The instance of GLRenderer is accessible as |
55 // and selection picking. The instance of GLRenderer is accessible as |
| 79 void endDraw (bool accept); |
82 void endDraw (bool accept); |
| 80 QColor getMainColor (); |
83 QColor getMainColor (); |
| 81 overlayMeta& getOverlay (int newcam); |
84 overlayMeta& getOverlay (int newcam); |
| 82 void hardRefresh (); |
85 void hardRefresh (); |
| 83 void initGLData (); |
86 void initGLData (); |
| |
87 void overlaysFromObjects (); |
| 84 void refresh (); |
88 void refresh (); |
| 85 void resetAngles (); |
89 void resetAngles (); |
| 86 uchar* screencap (ushort& w, ushort& h); |
90 uchar* screencap (ushort& w, ushort& h); |
| 87 void setBackground (); |
91 void setBackground (); |
| 88 void setCamera (const Camera cam); |
92 void setCamera (const Camera cam); |
| 89 void setDepthValue (double depth); |
93 void setDepthValue (double depth); |
| 90 void setupOverlay (); |
94 void setupOverlay (); |
| |
95 void updateOverlayObjects(); |
| 91 void zoomNotch (bool inward); |
96 void zoomNotch (bool inward); |
| 92 void zoomToFit (); |
97 void zoomToFit (); |
| 93 |
98 |
| 94 static void deleteLists (LDObject* obj); |
99 static void deleteLists (LDObject* obj); |
| 95 |
100 |
| 144 void compileList (LDObject* obj, const ListType list); // Compile one of the lists of an object |
149 void compileList (LDObject* obj, const ListType list); // Compile one of the lists of an object |
| 145 void compileSubObject (LDObject* obj, const GLenum gltype); // Sub-routine for object compiling |
150 void compileSubObject (LDObject* obj, const GLenum gltype); // Sub-routine for object compiling |
| 146 void compileVertex (const vertex& vrt); // Compile a single vertex to a list |
151 void compileVertex (const vertex& vrt); // Compile a single vertex to a list |
| 147 vertex coordconv2_3 (const QPoint& pos2d, bool snap) const; // Convert a 2D point to a 3D point |
152 vertex coordconv2_3 (const QPoint& pos2d, bool snap) const; // Convert a 2D point to a 3D point |
| 148 QPoint coordconv3_2 (const vertex& pos3d) const; // Convert a 3D point to a 2D point |
153 QPoint coordconv3_2 (const vertex& pos3d) const; // Convert a 3D point to a 2D point |
| 149 void buildKnownVertBlips (); |
154 LDOverlay* findOverlayObject ( GL::Camera cam ); |
| 150 void updateRectVerts (); |
155 void updateRectVerts (); |
| 151 void pick (uint mouseX, uint mouseY); // Perform object selection |
156 void pick (uint mouseX, uint mouseY); // Perform object selection |
| 152 void setObjectColor (LDObject* obj, const ListType list); // Set the color to an object list |
157 void setObjectColor (LDObject* obj, const ListType list); // Set the color to an object list |
| 153 |
158 |
| 154 private slots: |
159 private slots: |
| 155 void slot_toolTipTimer (); |
160 void slot_toolTipTimer (); |
| 156 }; |
161 }; |
| 157 |
|
| 158 // Alias for short namespaces |
|
| 159 typedef GLRenderer GL; |
|
| 160 |
162 |
| 161 static const GLRenderer::ListType g_glListTypes[] = { |
163 static const GLRenderer::ListType g_glListTypes[] = { |
| 162 GL::NormalList, |
164 GL::NormalList, |
| 163 GL::PickList, |
165 GL::PickList, |
| 164 GL::BFCFrontList, |
166 GL::BFCFrontList, |