From b5324f48c855b0c82ccf6da7d5a008fe5cf1c17e Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Mon, 8 Aug 2016 17:01:53 -0300 Subject: Start Power Line implementation gogogogo --- Project/Line.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Project/Line.h (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h new file mode 100644 index 0000000..d98a1c5 --- /dev/null +++ b/Project/Line.h @@ -0,0 +1,21 @@ +#ifndef LINE_H +#define LINE_H + +#include "Element.h" + +class Line : public Element +{ + public: + Line(); + ~Line(); + virtual bool Contains(wxPoint2DDouble position) const; + virtual void Draw(wxPoint2DDouble translation, double scale) const; + virtual wxCursor GetBestPickboxCursor() const; + virtual void Insert(Element* parent, wxPoint2DDouble position); + virtual bool Intersects(wxRect2DDouble rect) const; + virtual void MovePickbox(wxPoint2DDouble position); + virtual bool PickboxContains(wxPoint2DDouble position); + virtual void Rotate(); +}; + +#endif // LINE_H -- cgit From 0a85e05fa7aa0e2b950c2c3bcec5d45f25b1c0e2 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 9 Aug 2016 17:45:09 -0300 Subject: Line under implementation --- Project/Line.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index d98a1c5..fd68585 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -1,6 +1,8 @@ #ifndef LINE_H #define LINE_H +#include + #include "Element.h" class Line : public Element @@ -8,14 +10,18 @@ class Line : public Element public: Line(); ~Line(); - virtual bool Contains(wxPoint2DDouble position) const; + virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; virtual wxCursor GetBestPickboxCursor() const; - virtual void Insert(Element* parent, wxPoint2DDouble position); + virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; virtual void MovePickbox(wxPoint2DDouble position); virtual bool PickboxContains(wxPoint2DDouble position); virtual void Rotate(); + virtual void AddPoint(wxPoint2DDouble point); + protected: + std::vector m_parentList; + std::vector m_pointList; }; #endif // LINE_H -- cgit From e58cec073cbd982246898c733ae21b9f2b92b2b7 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Wed, 17 Aug 2016 17:19:58 -0300 Subject: Line under implementation --- Project/Line.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index fd68585..6717783 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -12,6 +12,8 @@ class Line : public Element ~Line(); virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; + virtual void Move(wxPoint2DDouble position) {} + virtual void MoveNode(Element* parent, wxPoint2DDouble position); virtual wxCursor GetBestPickboxCursor() const; virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; @@ -19,9 +21,10 @@ class Line : public Element virtual bool PickboxContains(wxPoint2DDouble position); virtual void Rotate(); virtual void AddPoint(wxPoint2DDouble point); + protected: - std::vector m_parentList; std::vector m_pointList; + bool m_inserted = false; }; #endif // LINE_H -- cgit From 05525745c0b0d189484da3c45f95356d7558e2cf Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 18 Aug 2016 19:10:04 -0300 Subject: Line improvements, context menu implemented Line still under construction, contex menu base implemented --- Project/Line.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 6717783..08a2b36 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -13,18 +13,24 @@ class Line : public Element virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; virtual void Move(wxPoint2DDouble position) {} + virtual void StartMove(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); virtual wxCursor GetBestPickboxCursor() const; virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; virtual void MovePickbox(wxPoint2DDouble position); virtual bool PickboxContains(wxPoint2DDouble position); - virtual void Rotate(); + virtual void Rotate() {} + virtual void RotateNode(Element* parent); virtual void AddPoint(wxPoint2DDouble point); + virtual bool GetContextMenu(wxMenu& menu); - protected: +protected: + void UpdateSwitchesPosition(); + double PointToLineDistance(wxPoint2DDouble point) const; std::vector m_pointList; bool m_inserted = false; + std::vector m_movePts; }; #endif // LINE_H -- cgit