SoNurbsProfile.3coin2

Langue: en

Version: 383505 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

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


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 void initClass (void)

Public Attributes


SoMFFloat knotVector

Protected Member Functions


virtual ~SoNurbsProfile ()

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.

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 ]
   }
 
   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.

References knotVector.

SoNurbsProfile::~SoNurbsProfile () [protected, virtual]Destructor.

Member Function Documentation

void SoNurbsProfile::initClass (void) [static]Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.

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.

References SbList< Type >::append(), SbList< Type >::getArrayPtr(), SoMField::getNum(), SoMFFloat::getValues(), SoProfile::index, knotVector, SoDebugError::postWarning(), and SbList< Type >::truncate().

Referenced by SoText3::computeBBox(), and getVertices().

void SoNurbsProfile::getVertices (SoState * state, int32_t & numvertices, SbVec2f *& vertices) [virtual]Return vertex set of state.

Implements SoProfile.

References SbList< Type >::append(), SoFieldContainer::get(), SbList< Type >::getArrayPtr(), SbList< Type >::getLength(), SbViewVolume::getMatrices(), getTrimCurve(), SbMatrix::identity(), SbViewVolume::ortho(), and SbList< Type >::truncate().

Member Data Documentation

SoMFFloat SoNurbsProfile::knotVectorKnot values for the nurbs curve.

Referenced by getTrimCurve(), and SoNurbsProfile().

Author

Generated automatically by Doxygen for Coin from the source code.