src/canvas.h

changeset 1108
90d6f4b7782e
parent 1106
7541b0209057
child 1110
ec3ee7da7806
equal deleted inserted replaced
1107:97279c658e2b 1108:90d6f4b7782e
24 { 24 {
25 public: 25 public:
26 Canvas(LDDocument* document, QWidget* parent = nullptr); 26 Canvas(LDDocument* document, QWidget* parent = nullptr);
27 ~Canvas(); 27 ~Canvas();
28 28
29 Vertex convert2dTo3d(const QPoint& pos2d, bool snap) const;
30 QPoint convert3dTo2d(const Vertex& pos3d) const;
29 EditModeType currentEditModeType() const; 31 EditModeType currentEditModeType() const;
32 int depthNegateFactor() const;
30 LDDocument* document() const; 33 LDDocument* document() const;
31 void drawPoint(QPainter& painter, QPointF pos, QColor color = QColor (64, 192, 0)) const; 34 void drawPoint(QPainter& painter, QPointF pos, QColor color = QColor (64, 192, 0)) const;
32 void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d) const; 35 void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d) const;
33 void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d, QPointF pos) const; 36 void drawBlipCoordinates(QPainter& painter, const Vertex& pos3d, QPointF pos) const;
37 double getDepthValue() const;
38 void getRelativeAxes(Axis& relX, Axis& relY) const;
39 Axis getRelativeZ() const;
34 QPen linePen() const; 40 QPen linePen() const;
35 const Vertex& position3D() const; 41 const Vertex& position3D() const;
42 void setDepthValue(double depth);
36 void setEditMode(EditModeType type); 43 void setEditMode(EditModeType type);
37 44
38 protected: 45 protected:
39 void dropEvent(QDropEvent* event) override; 46 void dropEvent(QDropEvent* event) override;
40 bool freeCameraAllowed() const override; 47 bool freeCameraAllowed() const override;
47 54
48 private: 55 private:
49 LDDocument& m_document; 56 LDDocument& m_document;
50 AbstractEditMode* m_currentEditMode = nullptr; 57 AbstractEditMode* m_currentEditMode = nullptr;
51 Vertex m_position3D; 58 Vertex m_position3D;
59 double m_depthValues[6] = {0};
52 }; 60 };

mercurial