summaryrefslogtreecommitdiffstats
path: root/Project/Element.h
diff options
context:
space:
mode:
authorThales1330 <thaleslima.ufu@gmail.com>2016-12-29 19:03:16 -0200
committerThales1330 <thaleslima.ufu@gmail.com>2016-12-29 19:03:16 -0200
commit7aed88dbcf9d37a1f40c8cad115f055c4d69e7a9 (patch)
treef8c67b159a77c61b1a67ffa8ae8f39959cdfbb0f /Project/Element.h
parentc5343c718cf80620c2fc7452a4315f7ddb9e5826 (diff)
downloadPSP.git-7aed88dbcf9d37a1f40c8cad115f055c4d69e7a9.tar.gz
PSP.git-7aed88dbcf9d37a1f40c8cad115f055c4d69e7a9.tar.xz
PSP.git-7aed88dbcf9d37a1f40c8cad115f055c4d69e7a9.zip
Parent/child optimization implemented
And others bugfixes.
Diffstat (limited to 'Project/Element.h')
-rw-r--r--Project/Element.h8
1 files changed, 8 insertions, 0 deletions
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<Element*> GetParentList() const { return m_parentList; }
+ virtual std::vector<Element*> 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<Element*> m_parentList;
+ std::vector<Element*> m_childList;
wxRect2DDouble m_rect;
wxPoint2DDouble m_position;