diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2016-12-28 20:06:41 -0200 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2016-12-28 20:06:41 -0200 |
commit | fb9de1b7935376897f1c93676ab1faeb1ea25f25 (patch) | |
tree | 51e1c6b989d1072cb07f9152d6efe07353e6768f /Project/Element.h | |
parent | ffed5ee9ae6c11acb5a7afa9fdc33b1047f5d5e9 (diff) | |
download | PSP.git-fb9de1b7935376897f1c93676ab1faeb1ea25f25.tar.gz PSP.git-fb9de1b7935376897f1c93676ab1faeb1ea25f25.tar.xz PSP.git-fb9de1b7935376897f1c93676ab1faeb1ea25f25.zip |
Bus line and transformer copy/paste implemented
Next step is try to generalize. Some graphical implementations in this
commit.
Diffstat (limited to 'Project/Element.h')
-rw-r--r-- | Project/Element.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Project/Element.h b/Project/Element.h index 512fc8f..0dd7dea 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -82,6 +82,19 @@ struct SwitchingData { std::vector<double> swTime; }; +class OpenGLColour +{ +public: + OpenGLColour() {} + OpenGLColour(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) { SetRGBA(red, green, blue, alpha); } + virtual ~OpenGLColour() {} + void SetRGBA(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); + GLdouble* GetRGBA() const { return rgba; } + +protected: + GLdouble* rgba = new GLdouble(4); +}; + class Element { public: @@ -111,7 +124,7 @@ public: bool IsPickboxShown() const { return m_showPickbox; } bool IsOnline() const { return m_online; } virtual std::vector<wxPoint2DDouble> GetPointList() const { return m_pointList; } - + // Pure-virtuals methods virtual bool AddParent(Element* parent, wxPoint2DDouble position) = 0; virtual bool Contains(wxPoint2DDouble position) const = 0; @@ -129,6 +142,7 @@ public: virtual void UpdateNodes() {} virtual bool SetNodeParent(Element* parent) { return false; } virtual void RemoveParent(Element* parent) {} + virtual void ReplaceParent(Element* oldParent, Element* newParent); virtual void RotateNode(Element* parent, bool clockwise = true) {} virtual wxPoint2DDouble GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, wxPoint2DDouble secondPoint) const; @@ -206,6 +220,14 @@ protected: double m_rotationAngle = 45.0; double m_switchSize = 10.0; + OpenGLColour* m_busColour; + OpenGLColour* m_onlineElementColour; + OpenGLColour* m_offlineElementColour; + OpenGLColour* m_closedSwitchColour; + OpenGLColour* m_openedSwitchColour; + OpenGLColour* m_selectionColour; + OpenGLColour* m_powerFlowArrowColour; + std::vector<wxRect2DDouble> m_switchRect; std::vector<std::vector<wxPoint2DDouble> > m_powerFlowArrow; |