diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-08-30 20:42:27 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-08-30 20:42:27 -0300 |
commit | 516cdb72d3ff99a1ee786d3ea24c9b579272fe76 (patch) | |
tree | 6017213d5e270f94c1063d11e793c196e3c969f8 /Project/Bus.cpp | |
parent | 1fcb990bd02da945ac0204caaed6a9aa1f6a7d5f (diff) | |
download | PSP.git-516cdb72d3ff99a1ee786d3ea24c9b579272fe76.tar.gz PSP.git-516cdb72d3ff99a1ee786d3ea24c9b579272fe76.tar.xz PSP.git-516cdb72d3ff99a1ee786d3ea24c9b579272fe76.zip |
COI (center of inertia) implemented
See Milano's book p. 342
Diffstat (limited to 'Project/Bus.cpp')
-rw-r--r-- | Project/Bus.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Project/Bus.cpp b/Project/Bus.cpp index 3ccb55d..c366d76 100644 --- a/Project/Bus.cpp +++ b/Project/Bus.cpp @@ -35,7 +35,7 @@ void Bus::Draw(wxPoint2DDouble translation, double scale) const glRotated(m_angle, 0.0, 0.0, 1.0); glTranslated(-screenPt.m_x, -screenPt.m_y, 0.0); - glColor4d(0.0, 0.5, 1.0, 0.5); + glColor4dv(m_selectionColour.GetRGBA()); wxPoint2DDouble pts[4] = {WorldToScreen(translation, scale, -(m_width / 2.0), -(m_height / 2.0)) - wxPoint2DDouble(m_borderSize, m_borderSize), @@ -56,7 +56,11 @@ void Bus::Draw(wxPoint2DDouble translation, double scale) const glRotated(m_angle, 0.0, 0.0, 1.0); glTranslated(-m_position.m_x, -m_position.m_y, 0.0); - glColor4dv(m_busColour.GetRGBA()); + if(m_dynEvent) + glColor4dv(m_dynamicEventColour.GetRGBA()); + else + glColor4dv(m_busColour.GetRGBA()); + DrawRectangle(m_position, m_width, m_height); // Pop the old matrix back. glPopMatrix(); |