From 10bb7105946bc0a892a9daf42ec5181ad9994fcf Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 27 Jan 2017 19:57:18 -0200 Subject: several control elements methods implemented Node position buggy --- Project/ControlElement.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'Project/ControlElement.h') diff --git a/Project/ControlElement.h b/Project/ControlElement.h index 69f9d83..9414d38 100644 --- a/Project/ControlElement.h +++ b/Project/ControlElement.h @@ -3,12 +3,58 @@ #include "Element.h" +class Node +{ +public: + enum NodeType { NODE_IN = 0, NODE_OUT }; + + Node(wxPoint2DDouble position = wxPoint2DDouble(0, 0), NodeType nodeType = NODE_IN, double borderSize = 0.0); + ~Node(); + + wxRect2DDouble GetRect() const { return m_rect; } + void SetRect(wxRect2DDouble rect) { m_rect = rect; } + + wxPoint2DDouble GetPosition() const { return m_rect.GetPosition(); } + void SetPosition(wxPoint2DDouble position); + + NodeType GetNodeType() const { return m_nodeType; } + void SetNodeType(NodeType nodeType) { m_nodeType = nodeType; } + + double GetRadius() const { return m_radius; } + std::vector GetInTrianglePts() const { return m_triPts; } + + void StartMove(wxPoint2DDouble position); + void Move(wxPoint2DDouble position); + bool Contains(wxPoint2DDouble position) const { return m_rect.Contains(position); } + +protected: + wxRect2DDouble m_rect; + NodeType m_nodeType; + + wxPoint2DDouble m_moveStartPt; + wxPoint2DDouble m_movePos; + + double m_radius = 3.0; + std::vector m_triPts; + std::vector m_triPtsMovePos; +}; + class ControlElement : public Element { public: ControlElement(); ~ControlElement(); + virtual void StartMove(wxPoint2DDouble position); + virtual void Move(wxPoint2DDouble position); + + void SetNodeList(std::vector nodeList) { m_nodeList = nodeList; } + std::vector GetNodeList() const { return m_nodeList; } + + virtual void DrawNodes() const; + +protected: + std::vector m_nodeList; }; #endif // CONTROLELEMENT_H -- cgit From 5e7c19ae397164dd718b2593663cee5d1be687cd Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Sat, 28 Jan 2017 14:50:12 -0200 Subject: Node bug fixes, tf form implemented --- Project/ControlElement.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Project/ControlElement.h') diff --git a/Project/ControlElement.h b/Project/ControlElement.h index 9414d38..063b2a5 100644 --- a/Project/ControlElement.h +++ b/Project/ControlElement.h @@ -14,7 +14,7 @@ public: wxRect2DDouble GetRect() const { return m_rect; } void SetRect(wxRect2DDouble rect) { m_rect = rect; } - wxPoint2DDouble GetPosition() const { return m_rect.GetPosition(); } + wxPoint2DDouble GetPosition() const; void SetPosition(wxPoint2DDouble position); NodeType GetNodeType() const { return m_nodeType; } @@ -36,7 +36,6 @@ protected: double m_radius = 3.0; std::vector m_triPts; - std::vector m_triPtsMovePos; }; class ControlElement : public Element -- cgit From 4ddc7be64451db873e49169e951532ce8893e359 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 3 Mar 2017 18:50:40 -0300 Subject: More connection line methods implemented --- Project/ControlElement.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Project/ControlElement.h') diff --git a/Project/ControlElement.h b/Project/ControlElement.h index 063b2a5..dedcc80 100644 --- a/Project/ControlElement.h +++ b/Project/ControlElement.h @@ -22,6 +22,13 @@ public: double GetRadius() const { return m_radius; } std::vector GetInTrianglePts() const { return m_triPts; } + + double GetAngle() const { return m_angle; } + void SetAngle(double angle) { m_angle = angle; } + + void Rotate(bool clockwise = true); + + void RotateTriPt(double angle); void StartMove(wxPoint2DDouble position); void Move(wxPoint2DDouble position); @@ -36,6 +43,7 @@ protected: double m_radius = 3.0; std::vector m_triPts; + double m_angle = 0.0; }; class ControlElement : public Element @@ -47,13 +55,13 @@ public: virtual void StartMove(wxPoint2DDouble position); virtual void Move(wxPoint2DDouble position); - void SetNodeList(std::vector nodeList) { m_nodeList = nodeList; } - std::vector GetNodeList() const { return m_nodeList; } + void SetNodeList(std::vector nodeList) { m_nodeList = nodeList; } + std::vector GetNodeList() const { return m_nodeList; } virtual void DrawNodes() const; protected: - std::vector m_nodeList; + std::vector m_nodeList; }; #endif // CONTROLELEMENT_H -- cgit From d11da00a993f1eeae6a1be50839ac72740e4e27b Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Sat, 4 Mar 2017 17:14:52 -0300 Subject: Delete element implemented --- Project/ControlElement.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Project/ControlElement.h') diff --git a/Project/ControlElement.h b/Project/ControlElement.h index dedcc80..2a516aa 100644 --- a/Project/ControlElement.h +++ b/Project/ControlElement.h @@ -32,11 +32,16 @@ public: void StartMove(wxPoint2DDouble position); void Move(wxPoint2DDouble position); - bool Contains(wxPoint2DDouble position) const { return m_rect.Contains(position); } + bool Contains(wxPoint2DDouble position) const; + + bool IsConnected() const { return m_connected; } + void SetConnected(bool connected = true) { m_connected = connected; } protected: wxRect2DDouble m_rect; NodeType m_nodeType; + + bool m_connected = false; wxPoint2DDouble m_moveStartPt; wxPoint2DDouble m_movePos; -- cgit From f19803bc64885bcfaef15cfd7a8139c28d3dd506 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 8 Apr 2017 16:31:25 -0300 Subject: Control editor export under implementation File handling --- Project/ControlElement.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/ControlElement.h') diff --git a/Project/ControlElement.h b/Project/ControlElement.h index 2a516aa..880dd98 100644 --- a/Project/ControlElement.h +++ b/Project/ControlElement.h @@ -54,7 +54,7 @@ protected: class ControlElement : public Element { public: - ControlElement(); + ControlElement(int id); ~ControlElement(); virtual void StartMove(wxPoint2DDouble position); -- cgit From 0ec05e0cb396a9ef153d29f605d4a0bbeb0dc7c1 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 17 Apr 2017 20:25:10 -0300 Subject: Connection line import under implementation Parent line not implemented yet --- Project/ControlElement.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Project/ControlElement.h') diff --git a/Project/ControlElement.h b/Project/ControlElement.h index 880dd98..1cf4e0b 100644 --- a/Project/ControlElement.h +++ b/Project/ControlElement.h @@ -36,8 +36,13 @@ public: bool IsConnected() const { return m_connected; } void SetConnected(bool connected = true) { m_connected = connected; } + + int GetID() const { return m_id; } + void SetID(int id) { m_id = id; } protected: + int m_id = -1; + wxRect2DDouble m_rect; NodeType m_nodeType; -- cgit