#include <Iguana/Inventor/interface/IgSoCircleArc.h>
Public Member Functions | |
IgSoCircleArc (void) | |
Static Public Member Functions | |
static void | initClass (void) |
Public Attributes | |
SoSFVec2f | center |
SoSFFloat | radius |
SoSFFloat | sweepAngle |
Protected Member Functions | |
virtual void | refresh (void) |
Private Member Functions | |
SO_KIT_CATALOG_ENTRY_HEADER (line) | |
SO_KIT_HEADER (IgSoCircleArc) |
Definition at line 26 of file IgSoCircleArc.h.
IgSoCircleArc::IgSoCircleArc | ( | void | ) |
Definition at line 24 of file IgSoCircleArc.cc.
References center, f, FALSE, parsecf::pyparsing::line(), radius, IgSoShapeKit::setUpConnections(), sweepAngle, and TRUE.
00025 { 00026 SO_KIT_CONSTRUCTOR (IgSoCircleArc); 00027 SO_KIT_ADD_FIELD (center, (0.f,0.f)); 00028 SO_KIT_ADD_FIELD (radius, (1.f)); 00029 SO_KIT_ADD_FIELD (sweepAngle, (360.f)); 00030 SO_KIT_ADD_CATALOG_ENTRY (line, SoLineSet, FALSE, separator,\x0, TRUE); 00031 SO_KIT_INIT_INSTANCE (); 00032 setUpConnections (true, true); 00033 }
Reimplemented from IgSoShapeKit.
Definition at line 21 of file IgSoCircleArc.cc.
Referenced by initNodes(), and initShapes().
00022 { SO_KIT_INIT_CLASS (IgSoCircleArc, IgSoShapeKit, "IgSoShapeKit"); }
Reimplemented from IgSoShapeKit.
Definition at line 36 of file IgSoCircleArc.cc.
References center, funct::cos(), i, int, parsecf::pyparsing::line(), r, radius, funct::sin(), and sweepAngle.
00037 { 00038 static const int CIRCLE_SEGMENTS = 60; 00039 SoVertexProperty *vtx = new SoVertexProperty; 00040 SoLineSet *line = new SoLineSet; 00041 int segments = int(CIRCLE_SEGMENTS * sweepAngle.getValue () / 360 + .5); 00042 00043 if (segments < 3) 00044 segments = 3; 00045 00046 double segAngle = sweepAngle.getValue () * M_PI / 180 / segments; 00047 double r = radius.getValue (); 00048 float cx, cy; 00049 00050 center.getValue ().getValue (cx, cy); 00051 for (int i = 0; i < segments; i++) 00052 vtx->vertex.set1Value (i, SbVec3f (r * cos (i * segAngle) + cx, 00053 r * sin (i * segAngle) + cy, 00054 0)); 00055 00056 vtx->normal = SbVec3f (0, 0, 1); 00057 vtx->normalBinding = SoVertexProperty::OVERALL; 00058 vtx->materialBinding = SoVertexProperty::OVERALL; 00059 line->numVertices = segments; 00060 line->vertexProperty = vtx; 00061 00062 setPart ("line", line); 00063 }
IgSoCircleArc::SO_KIT_CATALOG_ENTRY_HEADER | ( | line | ) | [private] |
IgSoCircleArc::SO_KIT_HEADER | ( | IgSoCircleArc | ) | [private] |
SoSFVec2f IgSoCircleArc::center |
SoSFFloat IgSoCircleArc::radius |
SoSFFloat IgSoCircleArc::sweepAngle |