summaryrefslogtreecommitdiffstats
path: root/Project/Line.cpp
diff options
context:
space:
mode:
authorThales1330 <thaleslima.ufu@gmail.com>2016-12-28 20:06:41 -0200
committerThales1330 <thaleslima.ufu@gmail.com>2016-12-28 20:06:41 -0200
commitfb9de1b7935376897f1c93676ab1faeb1ea25f25 (patch)
tree51e1c6b989d1072cb07f9152d6efe07353e6768f /Project/Line.cpp
parentffed5ee9ae6c11acb5a7afa9fdc33b1047f5d5e9 (diff)
downloadPSP.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/Line.cpp')
-rw-r--r--Project/Line.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Project/Line.cpp b/Project/Line.cpp
index 836ca3c..7f569fd 100644
--- a/Project/Line.cpp
+++ b/Project/Line.cpp
@@ -31,6 +31,10 @@ bool Line::Contains(wxPoint2DDouble position) const
void Line::Draw(wxPoint2DDouble translation, double scale) const
{
+ OpenGLColour* elementColour;
+ if(m_online) elementColour = m_onlineElementColour;
+ else elementColour = m_offlineElementColour;
+
std::vector<wxPoint2DDouble> pointList = m_pointList;
if(!m_inserted && pointList.size() > 0) {
wxPoint2DDouble secondPoint = m_position;
@@ -44,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);
- glColor4d(0.0, 0.5, 1.0, 0.5);
+ glColor4dv(m_selectionColour->GetRGBA());
DrawLine(pointList);
// Draw nodes selection.
@@ -58,7 +62,7 @@ void Line::Draw(wxPoint2DDouble translation, double scale) const
// Draw line (Layer 2)
glLineWidth(1.5);
- glColor4d(0.2, 0.2, 0.2, 1.0);
+ glColor4dv(elementColour->GetRGBA());
DrawLine(pointList);
if(m_inserted) {
@@ -68,7 +72,7 @@ void Line::Draw(wxPoint2DDouble translation, double scale) const
// Draw nodes.
if(pointList.size() > 0) {
- glColor4d(0.2, 0.2, 0.2, 1.0);
+ glColor4dv(elementColour->GetRGBA());
DrawCircle(pointList[0], 5.0, 10, GL_POLYGON);
if(m_inserted) {
DrawCircle(pointList[pointList.size() - 1], 5.0, 10, GL_POLYGON);