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; |