diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2016-12-29 02:32:50 -0200 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2016-12-29 02:32:50 -0200 |
commit | d792fcf7b2a5862ac86ee69aa86021b5637ca8ee (patch) | |
tree | c00bb1d27666ee7d42839efbd420369b2a0d24e3 /Project/Element.cpp | |
parent | fb9de1b7935376897f1c93676ab1faeb1ea25f25 (diff) | |
download | PSP.git-d792fcf7b2a5862ac86ee69aa86021b5637ca8ee.tar.gz PSP.git-d792fcf7b2a5862ac86ee69aa86021b5637ca8ee.tar.xz PSP.git-d792fcf7b2a5862ac86ee69aa86021b5637ca8ee.zip |
Copy paste implemented
Some bugs on the text
Diffstat (limited to 'Project/Element.cpp')
-rw-r--r-- | Project/Element.cpp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/Project/Element.cpp b/Project/Element.cpp index 68563ca..be93cc5 100644 --- a/Project/Element.cpp +++ b/Project/Element.cpp @@ -2,16 +2,18 @@ Element::Element() { - m_busColour = new OpenGLColour(0.0, 0.3, 1.0, 1.0); - m_onlineElementColour = new OpenGLColour(0.2, 0.2, 0.2, 1.0); - m_offlineElementColour = new OpenGLColour(0.5, 0.5, 0.5, 1.0); - m_closedSwitchColour = new OpenGLColour(0.0, 0.4, 0.0, 1.0); - m_openedSwitchColour = new OpenGLColour(1.0, 0.1, 0.1, 1.0); - m_selectionColour = new OpenGLColour(0.0, 0.5, 1.0, 0.5); - m_powerFlowArrowColour = new OpenGLColour(1.0, 0.51, 0.0, 1.0); + m_busColour.SetRGBA(0.0, 0.3, 1.0, 1.0); + m_onlineElementColour.SetRGBA(0.2, 0.2, 0.2, 1.0); + m_offlineElementColour.SetRGBA(0.5, 0.5, 0.5, 1.0); + m_closedSwitchColour.SetRGBA(0.0, 0.4, 0.0, 1.0); + m_openedSwitchColour.SetRGBA(1.0, 0.1, 0.1, 1.0); + m_selectionColour.SetRGBA(0.0, 0.5, 1.0, 0.5); + m_powerFlowArrowColour.SetRGBA(1.0, 0.51, 0.0, 1.0); } -Element::~Element() {} +Element::~Element() +{ +} void Element::SetPosition(const wxPoint2DDouble position) { @@ -257,9 +259,9 @@ void Element::DrawSwitches() const Element* parent = *it; if(parent) { if(m_online) { - glColor4dv(m_closedSwitchColour->GetRGBA()); + glColor4dv(m_closedSwitchColour.GetRGBA()); } else { - glColor4dv(m_openedSwitchColour->GetRGBA()); + glColor4dv(m_openedSwitchColour.GetRGBA()); } glPushMatrix(); @@ -442,7 +444,7 @@ void Element::CalculatePowerFlowPts(std::vector<wxPoint2DDouble> edges) void Element::DrawPowerFlowPts() const { if(m_online) { - glColor4dv(m_powerFlowArrowColour->GetRGBA()); + glColor4dv(m_powerFlowArrowColour.GetRGBA()); for(int i = 0; i < (int)m_powerFlowArrow.size(); i++) { DrawTriangle(m_powerFlowArrow[i]); } @@ -463,3 +465,13 @@ void OpenGLColour::SetRGBA(GLdouble red, GLdouble green, GLdouble blue, GLdouble rgba[2] = blue; rgba[3] = alpha; } + +OpenGLColour::OpenGLColour() +{ + SetRGBA(1.0, 1.0, 1.0, 1.0); +} + +OpenGLColour::OpenGLColour(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) +{ + SetRGBA(red, green, blue, alpha); +} |