diff options
Diffstat (limited to 'Project/Element.h')
-rw-r--r-- | Project/Element.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/Project/Element.h b/Project/Element.h index 56b2621..7023704 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -7,18 +7,6 @@ class Element { - protected: - wxRect2DDouble m_rect; - wxPoint2DDouble m_position; - double m_width = 0.0; - double m_height = 0.0; - double m_angle = 0.0; - double m_borderSize = 2.0; - - bool m_selected = false; - bool m_dragging = false; - bool m_showPickbox = false; - public: Element(); virtual ~Element(); @@ -41,20 +29,36 @@ class Element double GetWidth() const { return m_width; } double GetAngle() const { return m_angle; } bool IsPickboxShown() const { return m_showPickbox; } - // Métodos virtuais + // Pure-virtuals methods virtual void Draw(wxPoint2DDouble translation, double scale) const = 0; + virtual void Rotate() = 0; virtual bool Contains(wxPoint2DDouble position) const = 0; virtual int PickboxContains(wxPoint2DDouble position) const = 0; virtual void MovePickbox(wxPoint2DDouble position, int pickboxID) = 0; virtual wxCursor GetBestPickboxCursor() const = 0; - // Métodos gerais + // General methods wxPoint2DDouble WorldToScreen(wxPoint2DDouble translation, double scale, double offsetX = 0.0, double offsetY = 0.0) const; void DrawCircle(wxPoint2DDouble position, double radius, int numSegments, GLenum mode = GL_LINE_LOOP) const; void DrawRectangle(wxPoint2DDouble position, double width, double height, GLenum mode = GL_QUADS) const; + void DrawRectangle(wxPoint2DDouble* points, GLenum mode = GL_QUADS) const; + void DrawPickbox(wxPoint2DDouble position) const; + wxPoint2DDouble RotateAtPosition(wxPoint2DDouble pointToRotate, double angle, bool degrees = true) const; + + protected: + wxRect2DDouble m_rect; + wxPoint2DDouble m_position; + double m_width = 0.0; + double m_height = 0.0; + double m_angle = 0.0; + double m_borderSize = 2.0; + + bool m_selected = false; + bool m_dragging = false; + bool m_showPickbox = false; }; #endif // ELEMENT_H |