src/gldraw.h

changeset 497
c51941e590b6
parent 493
16766ac1bbd9
child 498
791c831c8020
equal deleted inserted replaced
496:d6cbf21af8fb 497:c51941e590b6
37 Draw, 37 Draw,
38 CircleMode, 38 CircleMode,
39 }; 39 };
40 40
41 // Meta for overlays 41 // Meta for overlays
42 struct overlayMeta 42 struct LDGLOverlay
43 { vertex v0, v1; 43 { vertex v0, v1;
44 ushort ox, oy; 44 ushort ox, oy;
45 double lw, lh; 45 double lw, lh;
46 str fname; 46 str fname;
47 QImage* img; 47 QImage* img;
48 };
49
50 struct LDFixedCameraInfo
51 { const char glrotate[3];
52 const Axis axisX, axisY;
53 const bool negX, negY;
48 }; 54 };
49 55
50 // ============================================================================= 56 // =============================================================================
51 // GLRenderer 57 // GLRenderer
52 // 58 //
82 void compileAllObjects(); 88 void compileAllObjects();
83 double depthValue() const; 89 double depthValue() const;
84 void drawGLScene(); 90 void drawGLScene();
85 void endDraw (bool accept); 91 void endDraw (bool accept);
86 QColor getMainColor(); 92 QColor getMainColor();
87 overlayMeta& getOverlay (int newcam); 93 LDGLOverlay& getOverlay (int newcam);
88 void hardRefresh(); 94 void hardRefresh();
89 void initGLData(); 95 void initGLData();
90 void overlaysFromObjects(); 96 void overlaysFromObjects();
91 void refresh(); 97 void refresh();
92 void resetAngles(); 98 void resetAngles();
121 // and Qt doesn't like that. 127 // and Qt doesn't like that.
122 struct CameraIcon 128 struct CameraIcon
123 { QPixmap* img; 129 { QPixmap* img;
124 QRect srcRect, destRect, selRect; 130 QRect srcRect, destRect, selRect;
125 Camera cam; 131 Camera cam;
126 } m_cameraIcons[7]; 132 };
127 133
128 QTimer* m_toolTipTimer; 134 CameraIcon m_cameraIcons[7];
129 Qt::MouseButtons m_lastButtons; 135 QTimer* m_toolTipTimer;
136 Qt::MouseButtons m_lastButtons;
130 Qt::KeyboardModifiers m_keymods; 137 Qt::KeyboardModifiers m_keymods;
131 ulong m_totalmove; 138 ulong m_totalmove;
132 vertex m_hoverpos; 139 vertex m_hoverpos;
133 double m_virtWidth, m_virtHeight, m_rotX, m_rotY, m_rotZ, m_panX, m_panY; 140 double m_virtWidth,
134 bool m_darkbg, m_rangepick, m_addpick, m_drawToolTip, m_screencap; 141 m_virtHeight,
135 QPoint m_pos, m_globalpos, m_rangeStart; 142 m_rotX,
136 QPen m_thickBorderPen, m_thinBorderPen; 143 m_rotY,
137 Camera m_camera, m_toolTipCamera; 144 m_rotZ,
138 uint m_axeslist; 145 m_panX,
139 ushort m_width, m_height; 146 m_panY;
140 List<vertex> m_drawedVerts; 147 bool m_darkbg,
141 bool m_rectdraw; 148 m_rangepick,
142 vertex m_rectverts[4]; 149 m_addpick,
143 QColor m_bgcolor; 150 m_drawToolTip,
144 double m_depthValues[6]; 151 m_screencap;
145 overlayMeta m_overlays[6]; 152 QPoint m_pos,
146 List<vertex> m_knownVerts; 153 m_globalpos,
147 bool m_panning; 154 m_rangeStart;
155 QPen m_thickBorderPen,
156 m_thinBorderPen;
157 Camera m_camera,
158 m_toolTipCamera;
159 GLuint m_axeslist;
160 int m_width,
161 m_height;
162 List<vertex> m_drawedVerts;
163 bool m_rectdraw;
164 vertex m_rectverts[4];
165 QColor m_bgcolor;
166 double m_depthValues[6];
167 LDGLOverlay m_overlays[6];
168 List<vertex> m_knownVerts;
169 bool m_panning;
148 170
149 void addDrawnVertex (vertex m_hoverpos); 171 void addDrawnVertex (vertex m_hoverpos);
150 void calcCameraIcons(); // Compute geometry for camera icons 172 void calcCameraIcons(); // Compute geometry for camera icons
151 void clampAngle (double& angle) const; // Clamps an angle to [0, 360] 173 void clampAngle (double& angle) const; // Clamps an angle to [0, 360]
152 void compileList (LDObject* obj, const ListType list); // Compile one of the lists of an object 174 void compileList (LDObject* obj, const ListType list); // Compile one of the lists of an object

mercurial