src/GLRenderer.h

changeset 694
3868f52da6b9
parent 690
9e9c52ca955e
child 699
aca63a3cce36
equal deleted inserted replaced
693:8432b37034a9 694:3868f52da6b9
119 // CameraIcon::img is a heap-allocated QPixmap because otherwise it gets 119 // CameraIcon::img is a heap-allocated QPixmap because otherwise it gets
120 // initialized before program gets to main() and constructs a QApplication 120 // initialized before program gets to main() and constructs a QApplication
121 // and Qt doesn't like that. 121 // and Qt doesn't like that.
122 struct CameraIcon 122 struct CameraIcon
123 { 123 {
124 QPixmap* img; 124 QPixmap* img;
125 QRect srcRect, 125 QRect srcRect,
126 destRect, 126 destRect,
127 selRect; 127 selRect;
128 EFixedCamera cam; 128 EFixedCamera cam;
129 }; 129 };
130 130
131 Q_OBJECT 131 Q_OBJECT
132 PROPERTY (public, bool, isDrawOnly, setDrawOnly, STOCK_WRITE) 132 PROPERTY (public, bool, isDrawOnly, setDrawOnly, STOCK_WRITE)
133 PROPERTY (public, MessageManager*, messageLog, setMessageLog, STOCK_WRITE) 133 PROPERTY (public, MessageManager*, messageLog, setMessageLog, STOCK_WRITE)
134 PROPERTY (private, bool, isPicking, setPicking, STOCK_WRITE) 134 PROPERTY (private, bool, isPicking, setPicking, STOCK_WRITE)
135 PROPERTY (public, LDDocument*, document, setDocument, CUSTOM_WRITE) 135 PROPERTY (public, LDDocument*, document, setDocument, CUSTOM_WRITE)
136 PROPERTY (public, EditMode, editMode, setEditMode, CUSTOM_WRITE) 136 PROPERTY (public, EditMode, editMode, setEditMode, CUSTOM_WRITE)
137 PROPERTY (private, GLCompiler*, compiler, setCompiler, STOCK_WRITE)
137 138
138 public: 139 public:
139 GLRenderer (QWidget* parent = null); 140 GLRenderer (QWidget* parent = null);
140 ~GLRenderer(); 141 ~GLRenderer();
141 142
144 return m_camera; 145 return m_camera;
145 } 146 }
146 147
147 void clearOverlay(); 148 void clearOverlay();
148 void compileObject (LDObject* obj); 149 void compileObject (LDObject* obj);
149 void compileAllObjects();
150 void drawGLScene(); 150 void drawGLScene();
151 void endDraw (bool accept); 151 void endDraw (bool accept);
152 void forgetObject (LDObject* obj); 152 void forgetObject (LDObject* obj);
153 Axis getCameraAxis (bool y, EFixedCamera camid = (EFixedCamera) - 1); 153 Axis getCameraAxis (bool y, EFixedCamera camid = (EFixedCamera) - 1);
154 const char* getCameraName() const; 154 const char* getCameraName() const;
215 QList<Vertex> m_drawedVerts; 215 QList<Vertex> m_drawedVerts;
216 bool m_rectdraw; 216 bool m_rectdraw;
217 Vertex m_rectverts[4]; 217 Vertex m_rectverts[4];
218 QColor m_bgcolor; 218 QColor m_bgcolor;
219 QList<Vertex> m_knownVerts; 219 QList<Vertex> m_knownVerts;
220 GLCompiler* m_compiler;
221 220
222 void addDrawnVertex (Vertex m_hoverpos); 221 void addDrawnVertex (Vertex m_hoverpos);
223 LDOverlay* findOverlayObject (EFixedCamera cam); 222 LDOverlay* findOverlayObject (EFixedCamera cam);
224 void updateRectVerts(); 223 void updateRectVerts();
225 void getRelativeAxes (Axis& relX, Axis& relY) const; 224 void getRelativeAxes (Axis& relX, Axis& relY) const;

mercurial