#include <Iguana/Inventor/interface/IgSoTowerRadii.h>
Public Member Functions | |
IgSoTowerRadii (void) | |
Static Public Member Functions | |
static void | initClass (void) |
Public Attributes | |
SoSFVec2f | center |
SoSFBool | displayCenter |
SoSFFloat | radius |
Protected Member Functions | |
virtual void | refresh (void) |
Private Member Functions | |
SO_KIT_CATALOG_ENTRY_HEADER (marker) | |
SO_KIT_CATALOG_ENTRY_HEADER (line) | |
SO_KIT_HEADER (IgSoTowerRadii) |
Definition at line 18 of file IgSoTowerRadii.h.
IgSoTowerRadii::IgSoTowerRadii | ( | void | ) |
Definition at line 25 of file IgSoTowerRadii.cc.
References center, displayCenter, f, FALSE, parsecf::pyparsing::line(), radius, IgSoShapeKit::setUpConnections(), and TRUE.
00026 { 00027 SO_KIT_CONSTRUCTOR (IgSoTowerRadii); 00028 SO_KIT_ADD_FIELD (center, (0.0f,0.0f)); 00029 SO_KIT_ADD_FIELD (radius, (1.0f)); 00030 SO_KIT_ADD_FIELD (displayCenter, (false)); 00031 SO_KIT_ADD_CATALOG_ENTRY (line, SoLineSet, FALSE, separator,\x0, TRUE); 00032 SO_KIT_ADD_CATALOG_ENTRY (marker, SoMarkerSet, FALSE, separator,\x0, TRUE); 00033 SO_KIT_INIT_INSTANCE (); 00034 setUpConnections (true, true); 00035 }
Reimplemented from IgSoShapeKit.
Definition at line 22 of file IgSoTowerRadii.cc.
Referenced by initNodes(), and initShapes().
00023 { SO_KIT_INIT_CLASS (IgSoTowerRadii, IgSoShapeKit, "IgSoShapeKit"); }
Reimplemented from IgSoShapeKit.
Definition at line 38 of file IgSoTowerRadii.cc.
References center, funct::cos(), displayCenter, i, parsecf::pyparsing::line(), NULL, r, radius, and funct::sin().
00039 { 00040 SoVertexProperty *vtx = new SoVertexProperty; 00041 SoLineSet *line = new SoLineSet; 00042 int segments = 60; 00043 00044 double segAngle = 2 * M_PI / segments; 00045 double r = radius.getValue (); 00046 float cx, cz; 00047 int i = 0; 00048 00049 center.getValue ().getValue (cx, cz); 00050 for (i = 0; i < segments; i++) 00051 vtx->vertex.set1Value (i, SbVec3f (r * cos (i * segAngle) + cx, 00052 0, 00053 r * sin (i * segAngle) + cz)); 00054 00055 vtx->vertex.set1Value (i, SbVec3f (r * cos (0) + cx, 00056 0, 00057 r * sin (0) + cz)); 00058 vtx->normal = SbVec3f (0, 0, 1); 00059 vtx->normalBinding = SoVertexProperty::OVERALL; 00060 vtx->materialBinding = SoVertexProperty::OVERALL; 00061 line->numVertices = segments + 1; 00062 line->vertexProperty = vtx; 00063 00064 if (displayCenter.getValue ()) 00065 { 00066 SoMFInt32 markerIndex; 00067 markerIndex.setValue (SoMarkerSet::CROSS_5_5); 00068 00069 SoMarkerSet *marker = new SoMarkerSet; 00070 SoVertexProperty *mvtx = new SoVertexProperty; 00071 mvtx->vertex.set1Value (0, SbVec3f (cx, 0, cz)); 00072 marker->vertexProperty = mvtx; 00073 marker->markerIndex = markerIndex; 00074 marker->numPoints = 1; 00075 marker->startIndex = 0; 00076 00077 setPart ("marker", marker); 00078 } 00079 else 00080 { 00081 setPart ("marker", NULL); 00082 } 00083 00084 setPart ("line", line); 00085 }
IgSoTowerRadii::SO_KIT_CATALOG_ENTRY_HEADER | ( | marker | ) | [private] |
IgSoTowerRadii::SO_KIT_CATALOG_ENTRY_HEADER | ( | line | ) | [private] |
IgSoTowerRadii::SO_KIT_HEADER | ( | IgSoTowerRadii | ) | [private] |
SoSFVec2f IgSoTowerRadii::center |
SoSFBool IgSoTowerRadii::displayCenter |
SoSFFloat IgSoTowerRadii::radius |