From 7aed88dbcf9d37a1f40c8cad115f055c4d69e7a9 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 29 Dec 2016 19:03:16 -0200 Subject: Parent/child optimization implemented And others bugfixes. --- Project/Element.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 67e0762..c5aa030 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -130,6 +130,11 @@ public: // General methods virtual Element* GetCopy() { return NULL; } + virtual void SetID(int id) { m_elementID = id; } + virtual int GetID() const { return m_elementID; } + virtual void AddChild(Element* child); + virtual void RemoveChild(Element* child); + virtual void ReplaceChild(Element* oldChild, Element* newChild); virtual void Draw(wxPoint2DDouble translation, double scale) const {}; virtual void Rotate(bool clockwise = true) {} virtual bool GetContextMenu(wxMenu& menu) { return false; } @@ -183,6 +188,7 @@ public: virtual wxPoint2DDouble RotateAtPosition(wxPoint2DDouble pointToRotate, double angle, bool degrees = true) const; virtual std::vector GetParentList() const { return m_parentList; } + virtual std::vector GetChildList() const { return m_childList; } virtual wxPoint2DDouble GetMoveStartPosition() const { return m_moveStartPt; } virtual wxPoint2DDouble GetMovePosition() const { return m_movePos; } virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; @@ -205,7 +211,9 @@ public: static wxString StringFromDouble(double value, int minDecimal = 1); protected: + int m_elementID = 0; std::vector m_parentList; + std::vector m_childList; wxRect2DDouble m_rect; wxPoint2DDouble m_position; -- cgit From 2c0b51586b3b2243ae0fdcd653139818e4b4e23e Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Mon, 2 Jan 2017 19:31:11 -0200 Subject: Fast data visualization implemented --- Project/Element.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index c5aa030..996d066 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -135,7 +135,8 @@ public: virtual void AddChild(Element* child); virtual void RemoveChild(Element* child); virtual void ReplaceChild(Element* oldChild, Element* newChild); - virtual void Draw(wxPoint2DDouble translation, double scale) const {}; + virtual wxString GetTipText() const { return wxEmptyString; } + virtual void Draw(wxPoint2DDouble translation, double scale) const {} virtual void Rotate(bool clockwise = true) {} virtual bool GetContextMenu(wxMenu& menu) { return false; } virtual void AddPoint(wxPoint2DDouble point) {} -- cgit From b6f96ca48bc156898df79deba63d270b393fb150 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 5 Jan 2017 19:31:28 -0200 Subject: Text bugs fixed --- Project/Element.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 996d066..01fef43 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -22,15 +22,7 @@ enum PickboxID { }; enum ContextMenuID { - ID_EDIT_BUS = 0, - ID_EDIT_LINE, - ID_EDIT_TRANSFORMER, - ID_EDIT_SYNCGENERATOR, - ID_EDIT_INDMOTOR, - ID_EDIT_SYNCMOTOR, - ID_EDIT_LOAD, - ID_EDIT_INDUCTOR, - ID_EDIT_CAPACITOR, + ID_EDIT_ELEMENT = 0, ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, -- cgit