#include <ivf/IvfExtrusion.h>
Inheritance diagram for CIvfExtrusion:
Public Member Functions | |
CIvfExtrusion () | |
virtual | ~CIvfExtrusion () |
IvfClassInfo ("CIvfExtrusion", CIvfShape) | |
void | setSectionSize (int size) |
int | getSectionSize () |
void | setSectionCoord (int pos, double x, double y) |
void | getSectionCoord (int pos, double &x, double &y) |
void | setSectionNormal (int pos, double x, double y) |
void | getSectionNormal (int pos, double &x, double &y) |
void | setSpineSize (int size) |
int | getSpineSize () |
void | setSpineCoord (int pos, double x, double y, double z) |
void | getSpineCoord (int pos, double &x, double &y, double &z) |
void | setSpineColor (int pos, float red, float green, float blue) |
void | getSpineColor (int pos, float &red, float &green, float &blue) |
void | setUseColor (bool flag) |
bool | getUseColor () |
void | setSelectScale (double scale) |
void | setUpVector (double x, double y, double z) |
void | setTextureMode (int mode) |
void | setJoinStyle (int style) |
void | setStartEnd (int startIdx, int endIdx) |
void | setUseTwist (bool flag) |
bool | getUseTwist () |
void | setSpineTwist (int pos, double twist) |
void | getSpineTwist (int pos, double &twist) |
void | updateBoundingSphere () |
Protected Member Functions | |
virtual void | createSelect () |
virtual void | createGeometry () |
CIvfExtrusion implements an extrusion shape using the gle library functions. A spine and a section are specified. Colors can also be set at each spine vertex. The following code shows how the extrusion class is used:
// Create extrusion CIvfExtrusion* extrusion = new CIvfExtrusion(); // Create section r = 0.5; nSides = 12; extrusion->setSectionSize(nSides + 1); for (i = 0; i<=nSides; i++) { angle = 2.0*M_PI*( ((double)i) / ((double)nSides) ); x = r * cos(angle); y = r * sin(angle); extrusion->setSectionCoord(i, x, y); extrusion->setSectionNormal(i, x/r, y/r); } // Set spine extrusion->setSpineSize(6); extrusion->setSpineCoord(0, 0.5, 0.0, 1.5); extrusion->setSpineCoord(1, 1.0, 0.0, 1.0); extrusion->setSpineCoord(2, 1.0, 0.0, -1.0); extrusion->setSpineCoord(3, -1.0, 0.0, -1.0); extrusion->setSpineCoord(4, -1.0, 0.0, 1.0); extrusion->setSpineCoord(5, -0.5, 0.0, 1.5); // Set up-vector extrusion->setUpVector(0.0, 1.0, 0.0); // Set join style extrusion->setJoinStyle(TUBE_NORM_EDGE|TUBE_JN_ANGLE|TUBE_JN_CAP);
Definition at line 89 of file IvfExtrusion.h.
|
CIvfExtrusion constructor. |
|
CIvfExtrusion destructor. |
|
Forces an object recalculation. Reimplemented from CIvfShape. |
|
Creates the select object. When the object is selected. This method is called to create the object respresenting the select state. Reimplemented from CIvfShape. |
|
Return section coordinate |
|
Return section normal |
|
Returns the section size |
|
Return spine color |
|
Return spine coordinate |
|
Returns spine size |
|
Returns the spine twist at a given spine position To use this method twisting should be enabled using the setUseTwist method. |
|
Return UseColor flag |
|
Return twisting state |
|
Sets the join style used Texture modes corresponds to the defines in the GL/tube.h header file: /code TUBE_JN_RAW TUBE_JN_ANGLE TUBE_JN_CUT TUBE_JN_ROUND TUBE_JN_MASK TUBE_JN_CAP /endcode |
|
Set section coordinate The section coordinates are specified in a 2D coordinate space. The spine is located at (0,0)
|
|
Set section normal The section normals are specified in a 2D coordinate space.
|
|
Sets section size The size specifies the number of points and normals that constructs the section.
|
|
Set selection scaling Sets the scalefactor on the select shape. (default 1.05)
|
|
Set spine color A color can be specified at each spine vertex. This color used if the UseColor flag is set.
|
|
Set spine coordinate The spine coordinates are specified in the global coordinate system.
|
|
Set spine size The spine size property specifies how many vertices the spine should consist of. The first and last spine vertices are used to determine the orientation of the section in the first and last sections.
|
|
Sets the spine twist at a given spine position To use this method twisting should be enabled using the setUseTwist method. |
|
Set start and end index for spine This method can be used when drawing only a part of the extrusion |
|
Sets the texture mode used Texture modes corresponds to the defines in the GL/tube.h header file: /code GLE_TEXTURE_ENABLE GLE_TEXTURE_STYLE_MASK GLE_TEXTURE_VERTEX_FLAT GLE_TEXTURE_NORMAL_FLAT GLE_TEXTURE_VERTEX_CYL GLE_TEXTURE_NORMAL_CYL GLE_TEXTURE_VERTEX_SPH GLE_TEXTURE_NORMAL_SPH GLE_TEXTURE_VERTEX_MODEL_FLAT GLE_TEXTURE_NORMAL_MODEL_FLAT GLE_TEXTURE_VERTEX_MODEL_CYL GLE_TEXTURE_NORMAL_MODEL_CYL GLE_TEXTURE_VERTEX_MODEL_SPH GLE_TEXTURE_NORMAL_MODEL_SPH /endcode |
|
Set the up-vector Determines the orientation of the section.
|
|
Set Use color flag If this flag is set to TRUE the spine is drawn using the colors specified by the setSpineColor() method.
|
|
Enable or disable twisting |
|
Updates bounding sphere Upates the radius of the assigned bounding sphere, if any. Reimplemented from CIvfObject. |