diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2016-09-03 17:09:24 -0300 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2016-09-03 17:09:24 -0300 |
commit | 726686c9b378f3a727ded52226b13a760cba1e6c (patch) | |
tree | 941150985ee1823041024ce50bc812303d30868e /Project/Element.cpp | |
parent | 077270f0294d236c6047d850703c5d011cb4b711 (diff) | |
download | PSP.git-726686c9b378f3a727ded52226b13a760cba1e6c.tar.gz PSP.git-726686c9b378f3a727ded52226b13a760cba1e6c.tar.xz PSP.git-726686c9b378f3a727ded52226b13a760cba1e6c.zip |
Inductor under implementation
Ind motor, sync condenser and load implemented
Diffstat (limited to 'Project/Element.cpp')
-rw-r--r-- | Project/Element.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Project/Element.cpp b/Project/Element.cpp index d00837a..ff7d246 100644 --- a/Project/Element.cpp +++ b/Project/Element.cpp @@ -20,6 +20,27 @@ void Element::DrawCircle(wxPoint2DDouble position, double radius, int numSegment glEnd(); } +void Element::DrawArc(wxPoint2DDouble position, double radius, double initAngle, double finalAngle, int numSegments, GLenum mode) const +{ + double initAngRad = wxDegToRad(initAngle); + double finalAngRad = wxDegToRad(finalAngle); + glBegin(mode); + for(int i = 0; i <= numSegments; i++) { + double theta = initAngRad + (finalAngRad - initAngRad) * double(i) / double(numSegments); + glVertex2f(radius * std::cos(theta) + position.m_x, radius * std::sin(theta) + position.m_y); + } + glEnd(); +} + +void Element::DrawTriangle(std::vector<wxPoint2DDouble> points, GLenum mode) const +{ + glBegin(mode); + for(int i=0; i<3; i++) { + glVertex2d(points[i].m_x, points[i].m_y); + } + glEnd(); +} + void Element::DrawRectangle(wxPoint2DDouble position, double width, double height, GLenum mode) const { glBegin(mode); // TODO: GL_QUADS é obsoleto (OpenGL 3.0+), encontrar outra solução. |