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/Line.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/Line.cpp')
-rw-r--r-- | Project/Line.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Project/Line.cpp b/Project/Line.cpp index 7f569fd..3180cf8 100644 --- a/Project/Line.cpp +++ b/Project/Line.cpp @@ -31,7 +31,7 @@ bool Line::Contains(wxPoint2DDouble position) const void Line::Draw(wxPoint2DDouble translation, double scale) const { - OpenGLColour* elementColour; + OpenGLColour elementColour; if(m_online) elementColour = m_onlineElementColour; else elementColour = m_offlineElementColour; @@ -48,7 +48,7 @@ void Line::Draw(wxPoint2DDouble translation, double scale) const // Line selected (Layer 1). if(m_selected) { glLineWidth(1.5 + m_borderSize * 2.0); - glColor4dv(m_selectionColour->GetRGBA()); + glColor4dv(m_selectionColour.GetRGBA()); DrawLine(pointList); // Draw nodes selection. @@ -62,7 +62,7 @@ void Line::Draw(wxPoint2DDouble translation, double scale) const // Draw line (Layer 2) glLineWidth(1.5); - glColor4dv(elementColour->GetRGBA()); + glColor4dv(elementColour.GetRGBA()); DrawLine(pointList); if(m_inserted) { @@ -72,7 +72,7 @@ void Line::Draw(wxPoint2DDouble translation, double scale) const // Draw nodes. if(pointList.size() > 0) { - glColor4dv(elementColour->GetRGBA()); + glColor4dv(elementColour.GetRGBA()); DrawCircle(pointList[0], 5.0, 10, GL_POLYGON); if(m_inserted) { DrawCircle(pointList[pointList.size() - 1], 5.0, 10, GL_POLYGON); @@ -491,3 +491,10 @@ void Line::SetPointList(std::vector<wxPoint2DDouble> pointList) UpdateSwitchesPosition(); UpdatePowerFlowArrowsPosition(); } + +Element* Line::GetCopy() +{ + Line* copy = new Line(); + *copy = *this; + return copy; +} |