src/glRenderer.h

changeset 1217
314e12e23c3a
parent 1008
74cb432812d3
child 1222
34def2630300
--- a/src/glRenderer.h	Thu Jan 04 19:40:52 2018 +0200
+++ b/src/glRenderer.h	Thu Jan 04 19:44:26 2018 +0200
@@ -78,11 +78,11 @@
 	bool			needZoomToFit;
 
 	LDGLData() :
-		rotationX (0.0),
-		rotationY (0.0),
-		rotationZ (0.0),
-		init (false),
-		needZoomToFit (true)
+		rotationX(0.0),
+		rotationY(0.0),
+		rotationZ(0.0),
+		init(false),
+		needZoomToFit(true)
 	{
 		for (int i = 0; i < 7; ++i)
 		{
@@ -114,7 +114,7 @@
 	EFirstCamera = ETopCamera
 };
 
-MAKE_ITERABLE_ENUM (ECamera)
+MAKE_ITERABLE_ENUM(ECamera)
 
 //
 // CameraIcon::image is a heap-allocated QPixmap because otherwise it gets
@@ -136,31 +136,31 @@
 	Q_OBJECT
 
 public:
-	GLRenderer (QWidget* parent = nullptr);
+	GLRenderer(QWidget* parent = nullptr);
 	~GLRenderer();
 
 	ECamera camera() const;
-	QString cameraName (ECamera camera) const;
+	QString cameraName(ECamera camera) const;
 	QByteArray capturePixels();
 	void clearOverlay();
-	void compileObject (LDObject* obj);
+	void compileObject(LDObject* obj);
 	GLCompiler* compiler() const;
-	Vertex convert2dTo3d (const QPoint& pos2d, bool snap) const;
-	QPoint convert3dTo2d (const Vertex& pos3d);
+	Vertex convert2dTo3d(const QPoint& pos2d, bool snap) const;
+	QPoint convert3dTo2d(const Vertex& pos3d);
 	QString currentCameraName() const;
 	EditModeType currentEditModeType() const;
 	int depthNegateFactor() const;
 	LDDocument* document() const;
-	void drawBlip (QPainter& painter, QPointF pos, QColor color = QColor (64, 192, 0)) const;
-	void drawBlipCoordinates (QPainter& painter, const Vertex& pos3d);
-	void drawBlipCoordinates (QPainter& painter, const Vertex& pos3d, QPointF pos);
+	void drawBlip(QPainter& painter, QPointF pos, QColor color = QColor(64, 192, 0)) const;
+	void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d);
+	void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d, QPointF pos);
 	void drawGLScene();
-	void forgetObject (LDObject* obj);
-	Axis getCameraAxis (bool y, ECamera camid = (ECamera) -1);
+	void forgetObject(LDObject* obj);
+	Axis getCameraAxis(bool y, ECamera camid = (ECamera) -1);
 	double getDepthValue() const;
-	const LDFixedCamera& getFixedCamera (ECamera cam) const;
-	LDGLOverlay& getOverlay (int newcam);
-	void getRelativeAxes (Axis& relX, Axis& relY) const;
+	const LDFixedCamera& getFixedCamera(ECamera cam) const;
+	LDGLOverlay& getOverlay(int newcam);
+	void getRelativeAxes(Axis& relX, Axis& relY) const;
 	Axis getRelativeZ() const;
 	void hardRefresh();
 	void highlightCursorObject();
@@ -176,40 +176,40 @@
 	QPointF const& mousePositionF() const;
 	void needZoomToFit();
 	LDObject* objectAtCursor() const;
-	void pick (int mouseX, int mouseY, bool additive);
-	void pick (QRect const& range, bool additive);
-	LDObject* pickOneObject (int mouseX, int mouseY);
+	void pick(int mouseX, int mouseY, bool additive);
+	void pick(QRect const& range, bool additive);
+	LDObject* pickOneObject(int mouseX, int mouseY);
 	Vertex const& position3D() const;
 	void refresh();
 	void resetAllAngles();
 	void resetAngles();
 	void setBackground();
-	void setCamera (const ECamera cam);
-	void setDepthValue (double depth);
-	void setDocument (LDDocument* document);
-	void setDrawOnly (bool value);
-	void setEditMode (EditModeType type);
-	void setPicking (bool a);
-	bool setupOverlay (ECamera cam, QString file, int x, int y, int w, int h);
+	void setCamera(const ECamera cam);
+	void setDepthValue(double depth);
+	void setDocument(LDDocument* document);
+	void setDrawOnly(bool value);
+	void setEditMode(EditModeType type);
+	void setPicking(bool a);
+	bool setupOverlay(ECamera cam, QString file, int x, int y, int w, int h);
 	QPen textPen() const;
 	void updateOverlayObjects();
-	void zoomNotch (bool inward);
+	void zoomNotch(bool inward);
 
 protected:
-	void contextMenuEvent (QContextMenuEvent* ev);
-	void dragEnterEvent (QDragEnterEvent* ev);
-	void dropEvent (QDropEvent* ev);
+	void contextMenuEvent(QContextMenuEvent* ev);
+	void dragEnterEvent(QDragEnterEvent* ev);
+	void dropEvent(QDropEvent* ev);
 	void initializeGL();
-	void keyPressEvent (QKeyEvent* ev);
-	void keyReleaseEvent (QKeyEvent* ev);
-	void leaveEvent (QEvent* ev);
-	void mouseDoubleClickEvent (QMouseEvent* ev);
-	void mousePressEvent (QMouseEvent* ev);
-	void mouseMoveEvent (QMouseEvent* ev);
-	void mouseReleaseEvent (QMouseEvent* ev);
-	void paintEvent (QPaintEvent* ev);
-	void resizeGL (int w, int h);
-	void wheelEvent (QWheelEvent* ev);
+	void keyPressEvent(QKeyEvent* ev);
+	void keyReleaseEvent(QKeyEvent* ev);
+	void leaveEvent(QEvent* ev);
+	void mouseDoubleClickEvent(QMouseEvent* ev);
+	void mousePressEvent(QMouseEvent* ev);
+	void mouseMoveEvent(QMouseEvent* ev);
+	void mouseReleaseEvent(QMouseEvent* ev);
+	void paintEvent(QPaintEvent* ev);
+	void resizeGL(int w, int h);
+	void wheelEvent(QWheelEvent* ev);
 
 private:
 	MessageManager* m_messageLog;
@@ -248,22 +248,22 @@
 	GLuint m_axesColorVbo;
 
 	void calcCameraIcons();
-	void clampAngle (double& angle) const;
+	void clampAngle(double& angle) const;
 	LDGLData& currentDocumentData() const;
-	void drawVbos (SurfaceVboType surface, ComplementVboType colors, GLenum type);
+	void drawVbos(SurfaceVboType surface, ComplementVboType colors, GLenum type);
 	void doMakeCurrent();
-	LDOverlay* findOverlayObject (ECamera cam);
-	double& panning (Axis ax);
-	double panning (Axis ax) const;
-	double& rotation (Axis ax);
+	LDOverlay* findOverlayObject(ECamera cam);
+	double& panning(Axis ax);
+	double panning(Axis ax) const;
+	double& rotation(Axis ax);
 	double& zoom();
 	void zoomToFit();
 	void zoomAllToFit();
 
 	template<typename... Args>
-	QString format (QString fmtstr, Args... args)
+	QString format(QString fmtstr, Args... args)
 	{
-		return ::format (fmtstr, args...);
+		return ::format(fmtstr, args...);
 	}
 
 private slots:

mercurial