From 78aac544e1e77f5405260797cee4b94d7a0dfe32 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 2 Aug 2016 17:34:42 -0300 Subject: Bus controllers under implementation Events handler removed --- Project/Element.h | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'Project/Element.h') 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 -- cgit