diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2016-09-01 18:23:56 -0300 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2016-09-01 18:23:56 -0300 |
commit | b06d4c3d76cca3ed8a54dae1d978030d687233b2 (patch) | |
tree | 481cc4c8571b2f136242cd9a71b74499fbf36943 | |
parent | b817a3f0e398c7e938ed1a37ebdbfc5a03eb7471 (diff) | |
download | PSP.git-b06d4c3d76cca3ed8a54dae1d978030d687233b2.tar.gz PSP.git-b06d4c3d76cca3ed8a54dae1d978030d687233b2.tar.xz PSP.git-b06d4c3d76cca3ed8a54dae1d978030d687233b2.zip |
generator under implementation
-rw-r--r-- | Project/Transformer.cpp | 6 | ||||
-rw-r--r-- | Project/Workspace.cpp | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/Project/Transformer.cpp b/Project/Transformer.cpp index 3cd0b6e..de92bea 100644 --- a/Project/Transformer.cpp +++ b/Project/Transformer.cpp @@ -88,9 +88,9 @@ void Transformer::Draw(wxPoint2DDouble translation, double scale) const // Draw nodes selection. if(m_pointList.size() > 0) { - DrawCircle(m_pointList[0], 5.0 + m_borderSize, 10, GL_POLYGON); + DrawCircle(m_pointList[0], 5.0 + m_borderSize / scale, 10, GL_POLYGON); if(m_inserted) { - DrawCircle(m_pointList[m_pointList.size() - 1], 5.0 + m_borderSize, 10, GL_POLYGON); + DrawCircle(m_pointList[m_pointList.size() - 1], 5.0 + m_borderSize / scale, 10, GL_POLYGON); } } } @@ -228,7 +228,6 @@ void Transformer::RemoveParent(Element* parent) for(int i = 0; i < 2; i++) { if(parent == m_parentList[i]) { m_parentList[i] = NULL; - m_parentList[i] = NULL; UpdateSwitchesPosition(); } } @@ -359,6 +358,7 @@ void Transformer::RotateNode(Element* parent) bool Transformer::GetContextMenu(wxMenu& menu) { menu.Append(ID_EDIT_TRANSFORMER, _("Edit tranformer")); + menu.Append(ID_ROTATE, _("Rotate")); menu.Append(ID_DELETE, _("Delete")); return true; } diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp index 5408327..d515683 100644 --- a/Project/Workspace.cpp +++ b/Project/Workspace.cpp @@ -4,6 +4,7 @@ #include "Bus.h" #include "Line.h" #include "Transformer.h" +#include "Generator.h" // Camera Camera::Camera() @@ -590,6 +591,17 @@ void Workspace::OnKeyDown(wxKeyEvent& event) } } break; + case 'G': // Insert a generator. + { + if(m_mode != MODE_INSERT) { + Generator* newGenerator = new Generator(); + m_elementList.push_back(newGenerator); + m_mode = MODE_INSERT; + m_statusBar->SetStatusText(_("Insert Generator: Click on a buses, ESC to cancel.")); + Redraw(); + } + } + break; default: break; } @@ -649,6 +661,11 @@ void Workspace::OnPopupClick(wxCommandEvent& event) wxMessageBox("Edit line!"); } break; + case ID_EDIT_TRANSFORMER: + { + wxMessageBox("Edit transformer!"); + } + break; case ID_LINE_ADD_NODE: { Line* line = (Line*)element; |