Public Member Functions
NurbsSurface Class Reference

Detailed Description

The NurbsSurface object gives access to the X3DObject's nurbs surface Geometry.

See also:
PolygonMesh::GetPolygons, CPolygonFaceArray
Example:
        using namespace XSI;

        Application app;
        Model root = app.GetActiveSceneRoot();

        X3DObject mySphere;
        root.AddGeometry( L"Sphere", L"NurbsSurface", L"", mySphere );

        NurbsSurfaceMesh mySurfaceMesh(mySphere.GetActivePrimitive().GetGeometry());

        CNurbsSurfaceDataArray surfaces(2);

        NurbsSurface(mySurfaceMesh.GetSurfaces().GetItem(0)).Get(siSINurbs,surfaces[0]);

        X3DObject myCone;
        root.AddGeometry( L"Cone",L"NurbsSurface",L"", myCone );

        mySurfaceMesh = myCone.GetActivePrimitive().GetGeometry();

        NurbsSurface(mySurfaceMesh.GetSurfaces().GetItem(0)).Get(siSINurbs,surfaces[1]);

        X3DObject myMultiSurfaceMesh;
        root.AddNurbsSurfaceMesh(surfaces,siSINurbs,L"",myMultiSurfaceMesh);

#include <xsi_nurbssurface.h>

Inheritance diagram for NurbsSurface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 NurbsSurface ()
 ~NurbsSurface ()
 NurbsSurface (const CRef &in_ref)
 NurbsSurface (const NurbsSurface &in_obj)
bool IsA (siClassID in_ClassID) const
siClassID GetClassID () const
NurbsSurfaceoperator= (const NurbsSurface &in_obj)
NurbsSurfaceoperator= (const CRef &in_ref)
CKnotArray GetKnots (siNurbsDirection in_siNurbsDirection) const
CControlPointRefArray GetControlPoints () const
CNurbsSampleRefArray GetNurbsSamples () const
CStatus Get (siNurbsFormat in_siNurbsFormat, CNurbsSurfaceData &out_surface) const
CStatus Set (const CNurbsSurfaceData &in_surface, siNurbsFormat in_siNurbsFormat=siSINurbs)
CStatus EvaluatePosition (double in_dUValue, double in_dVValue, MATH::CVector3 &out_vPosition, MATH::CVector3 &out_vUTangent, MATH::CVector3 &out_vVTangent, MATH::CVector3 &out_vNormal) const
CStatus EvaluateNormalizedPosition (double in_dUNormalizedValue, double in_dVNormalizedValue, MATH::CVector3 &out_vPosition, MATH::CVector3 &out_vUTangent, MATH::CVector3 &out_vVTangent, MATH::CVector3 &out_vNormal) const
CStatus GetNormalizedUVFromUV (double in_dUValue, double in_dVValue, double &out_dNormalizedUValue, double &out_dNormalizedVValue) const
CStatus GetUVFromNormalizedUV (double in_dNormalizedUValue, double in_dNormalizedVValue, double &out_dUValue, double &out_dVValue) const
LONG GetTrimCount () const
CStatus GetTrim (LONG in_lTrimIndex, siNurbsFormat in_siNurbsFormat, CTrimCurveData &out_trimcurve) const

Constructor & Destructor Documentation

Default constructor.

Default destructor.

NurbsSurface ( const CRef in_ref)

Constructor.

Parameters:
in_refconstant reference object.
NurbsSurface ( const NurbsSurface in_obj)

Copy constructor.

Parameters:
in_objconstant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID) const [virtual]

Returns true if a given class type is compatible with this API class.

Parameters:
in_ClassIDclass type.
Returns:
true if the class is compatible, false otherwise.

Reimplemented from Facet.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

Returns:
The class type.

Reimplemented from Facet.

NurbsSurface& operator= ( const NurbsSurface in_obj)

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:
in_objconstant class object.
Returns:
The new PolygonFace object.
NurbsSurface& operator= ( const CRef in_ref)

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:
in_refconstant class object.
Returns:
The new PolygonFace object.

Reimplemented from Facet.

CKnotArray GetKnots ( siNurbsDirection  in_siNurbsDirection) const

Returns an array of all Knot values on this NurbsSurface object in a given direction.

Parameters:
in_siNurbsDirectionDirection in which we want the knot values.
Returns:
Array of all knots.
CControlPointRefArray GetControlPoints ( ) const

Returns an array of all ControlPoint objects on this NurbsSurface object.

Returns:
A ControlPoint array.
CNurbsSampleRefArray GetNurbsSamples ( ) const

Returns an array of all NurbsSample objects on this NurbsSurface object.

Returns:
A NurbsSample reference array.
CStatus Get ( siNurbsFormat  in_siNurbsFormat,
CNurbsSurfaceData out_surface 
) const

Returns a complete data description of a nurbs surface.

Parameters:
in_siNurbsFormatSpecifies how the data is formatted.
Return values:
out_surfaceThe entire surface data description.
Returns:
CStatus::OK success
CStatus::Fail other failure
CStatus Set ( const CNurbsSurfaceData in_surface,
siNurbsFormat  in_siNurbsFormat = siSINurbs 
)

Creates a new geometry for this NurbsSurface from a complete data description of a nurbs surface. This is only available from compiled operators.

Note:
If you use it on a object with some clusters and you change the topology the burden of updating the clusters is on the user.
Warning:
UV ordering is different for the C++ API than it is for scripting. In scripting, a control point array is ordered U-V like so:

(0,0)...(0,cntV-1), (1,0)....(1,cntV-1),(cntU-1,0)...(cntU-1,cntV-1)

However, the order for the C++ API is V-U:

(0,0)...(cntU-1,0), (0,1)....(cntU-1,1)...(0,cntV-1)...(cntU-1,cntV-1)

Since NurbsSurface::Set expects the U-V order, you must reorder the array before passing it via the in_siNurbsFormat argument. See cpp_understand_UV_Ordering UV Ordering for a sample conversion function.
Parameters:
in_surfaceSpecify the new data description for this NurbsSurface.
in_siNurbsFormatSpecifies how the data is formatted.
Returns:
CStatus::OK success
CStatus::AccessDenied function used outside of a plug-in operator context.
CStatus EvaluatePosition ( double  in_dUValue,
double  in_dVValue,
MATH::CVector3 out_vPosition,
MATH::CVector3 out_vUTangent,
MATH::CVector3 out_vVTangent,
MATH::CVector3 out_vNormal 
) const

Returns the Position , U tangent, V Tangent, and Normal at a given UV value.

Parameters:
in_dUValueThe U Value at which we want to evaluate the surface.
in_dVValueThe V Value at which we want to evaluate the surface.
Return values:
out_vPositionPosition at the given UV.
out_vUTangentTangent in U at the given UV.
out_vVTangentTangent in V at the given UV.
out_vNormalNormal at the given UV.
Returns:
CStatus::OK success
CStatus::Fail other failure
CStatus EvaluateNormalizedPosition ( double  in_dUNormalizedValue,
double  in_dVNormalizedValue,
MATH::CVector3 out_vPosition,
MATH::CVector3 out_vUTangent,
MATH::CVector3 out_vVTangent,
MATH::CVector3 out_vNormal 
) const

Returns the Position, U tangent, V Tangent,Normal at a given normalized UV value.

Parameters:
in_dUNormalizedValueThe normalized U Value(0.0 to 1.0) at which we want to evaluate the surface.
in_dVNormalizedValueThe normalized V Value(0.0 to 1.0) at which we want to evaluate the surface.
Return values:
out_vPositionPosition at the given UV.
out_vUTangentTangent in U at the given UV.
out_vVTangentTangent in V at the given UV.
out_vNormalNormal at the given UV.
Returns:
CStatus::OK success
CStatus::Fail other failure
CStatus GetNormalizedUVFromUV ( double  in_dUValue,
double  in_dVValue,
double &  out_dNormalizedUValue,
double &  out_dNormalizedVValue 
) const

Returns the Normalized equivalent of UV values.

Parameters:
in_dUValueThe U Value from which we want the normalized U Value.
in_dVValueThe V Value from which we want the normalized V Value.
Return values:
out_dNormalizedUValueThe normalized U Value(0.0 to 1.0).
out_dNormalizedVValueThe normalized V Value(0.0 to 1.0).
Returns:
CStatus::OK success
CStatus::Fail other failure
CStatus GetUVFromNormalizedUV ( double  in_dNormalizedUValue,
double  in_dNormalizedVValue,
double &  out_dUValue,
double &  out_dVValue 
) const

Returns the UV value equivalent to the specified normalized UV values.

Parameters:
in_dNormalizedUValueThe normalized UValue(0.0 to 1.0) from which we want the actual U Value.
in_dNormalizedVValueThe normalized VValue(0.0 to 1.0) from which we want the actual V Value.
Return values:
out_dUValueThe actual U value.
out_dVValueThe actual V value.
Returns:
CStatus::OK success
CStatus::Fail other failure
LONG GetTrimCount ( ) const

Returns the number of trim curves on this nurbs surface.

Returns:
The number of trim curves.
CStatus GetTrim ( LONG  in_lTrimIndex,
siNurbsFormat  in_siNurbsFormat,
CTrimCurveData out_trimcurve 
) const

Returns a complete data description of a nurbs surface trim. A trim is a NurbsCurveList that is projected on a nurbs surface.

Parameters:
in_lTrimIndexThe index of the trim curve for which we want the description.
in_siNurbsFormatSpecifies how the data is formatted.
Return values:
out_trimcurveThe entire data description of the trim curve.
Returns:
CStatus::OK success
CStatus::Fail other failure

The documentation for this class was generated from the following file: