Provided by: libcoin80-doc_3.1.4~abc9f50-4ubuntu2_all
NAME
SoNurbsProfile - The SoNurbsProfile class is a node for specifying smooth profile curves. Use nodes of this type if you want to set up profiles that are smooth curves.
SYNOPSIS
#include <Inventor/nodes/SoNurbsProfile.h> Inherits SoProfile. Public Member Functions virtual SoType getTypeId (void) const Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. SoNurbsProfile (void) virtual void getTrimCurve (SoState *state, int32_t &numpoints, float *&points, int &floatspervec, int32_t &numknots, float *&knotvector) virtual void getVertices (SoState *state, int32_t &numvertices, SbVec2f *&vertices) Static Public Member Functions static SoType getClassTypeId (void) static void initClass (void) Public Attributes SoMFFloat knotVector Protected Member Functions virtual const SoFieldData * getFieldData (void) const virtual ~SoNurbsProfile () Static Protected Member Functions static const SoFieldData ** getFieldDataPtr (void) Additional Inherited Members
Detailed Description
The SoNurbsProfile class is a node for specifying smooth profile curves. Use nodes of this type if you want to set up profiles that are smooth curves. Use ProfileCoordinate2 for nonrational profile where weight is 1.0 (default), and ProfileCoordinate3 for rational profile curves to specify the weight. Weight is analogous to having magnets pulling on the curve. A typical usage case for SoNurbsProfile is to specify NURBS trimming curves. For example: #Inventor V2.1 ascii ShapeHints { vertexOrdering COUNTERCLOCKWISE } Coordinate3 { point [ -3 -3 -3, -3 -1 -3, -3 1 -3, -3 3 -3, -1 -3 -3, -1 -1 3, -1 1 3, -1 3 -3, 1 -3 -3, 1 -1 3, 1 1 3, 1 3 -3, 3 -3 -3, 3 -1 -3, 3 1 -3, 3 3 -3 ] } ProfileCoordinate2 { point [ 0.0 0.0 , 0.75 0.0, 0.75 0.75 , 0.25 0.75 , 0.0 0.0 ] } NurbsProfile { index [ 0 , 1 , 2 , 3, 4 ] linkage START_NEW knotVector [ 0, 0, 0, 0, 0.5, 1, 1, 1, 1 ] } NurbsSurface { numUControlPoints 4 numVControlPoints 4 uKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ] vKnotVector [ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0 ] } Note that the coordinates of the NurbsProfile live in the parametric space of the trimmed SoNurbsSurface, and that the same complexity setting (which is calculated based on the dimensions of the bounding box of the nurbs surface) is used to determine the sampling tolerance both for the SoNurbsSurface and the SoNurbsProfile. This means that if you want to change the tessellation of the trimming curve itself (i.e. increase or decrease the resolution of the boundaries of the 'cut-out'), you should not change the SoComplexity setting but rather adapt the parametric scale in relation to the trimmed surface. As an example, to increase the resolution of the curve in the above example, replace... ProfileCoordinate2 { point [ 0.0 0.0, 0.75 0.0, 0.75 0.75, 0.25 0.75, 0.0 0.0 ] } .. with... ProfileCoordinate2 { point [ 0.0 0.0, 7.5 0.0, 7.5 7.5, 2.5 7.5, 0.0 0.0 ] } and change the uKnotVector and vKnotVector of the NurbsSurface to be uKnotVector [ 0.0, 0.0, 0.0, 0.0, 10, 10, 10, 10 ] vKnotVector [ 0.0, 0.0, 0.0, 0.0, 10, 10, 10, 10 ] However, keep in mind that increasing the accuracy of the trimming curve results in a much more complex tesselation of the trimmed surface. As a general rule of thumb, the extent of the trimming curve coordinates should never be greater than its 'real' extents in relation to the trimmed surface, and often can be much lower. If you find the above confusing, you probably do not want to use NURBS without reading up on the general concepts first. An explanation of NURBS is beyond the scope of the Coin documentation; for detailed information, refer to the specialized literature on the topic (for example 'An Introduction to NURBS: With Historical Perspective' by David F. Rogers). A basic overview of curve and surface rendering using NURBS can also be found in chapter 8 of 'The Inventor Mentor'. FILE FORMAT/DEFAULTS: NurbsProfile { index 0 linkage START_FIRST knotVector 0 }
Constructor & Destructor Documentation
SoNurbsProfile::SoNurbsProfile (void) Constructor. SoNurbsProfile::~SoNurbsProfile () [protected], [virtual] Destructor.
Member Function Documentation
SoType SoNurbsProfile::getTypeId (void) const [virtual] Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. Usage example: void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups. Reimplemented from SoProfile. const SoFieldData * SoNurbsProfile::getFieldData (void) const [protected], [virtual] Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL. Reimplemented from SoProfile. void SoNurbsProfile::getTrimCurve (SoState *state, int32_t &numpoints, float *&points, int &floatspervec, int32_t &numknots, float *&knotvector) [virtual] Return points and knotvector of the state. Implements SoProfile. void SoNurbsProfile::getVertices (SoState *state, int32_t &numvertices, SbVec2f *&vertices) [virtual] Return vertex set of state. Implements SoProfile.
Member Data Documentation
SoMFFloat SoNurbsProfile::knotVector Knot values for the nurbs curve.
Author
Generated automatically by Doxygen for Coin from the source code.