# NurbsSurface Class Reference

Related Scripting Object: NurbsSurface

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

`#include <xsi_nurbssurface.h>`

Inheritance diagram for NurbsSurface:

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
NurbsSurface & | operator= (const NurbsSurface &in_obj)
NurbsSurface & | operator= (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

## 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);

## Constructor & Destructor Documentation

NurbsSurface | ( |  | ) |

Default constructor.

~NurbsSurface | ( |  | ) |

Default destructor.

NurbsSurface | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  | in_ref | constant reference object.

NurbsSurface | ( | const NurbsSurface & | in_obj | ) |

Copy constructor.

Parameters:

  | in_obj | constant 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_ClassID | class 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_obj | constant 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_ref | constant 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_siNurbsDirection | Direction 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_siNurbsFormat | Specifies how the data is formatted.

Return values:

  | out_surface | The 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 UV Ordering for a sample conversion function.

Parameters:

  | in_surface | Specify the new data description for this NurbsSurface.
  | in_siNurbsFormat | Specifies 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_dUValue | The U Value at which we want to evaluate the surface.
  | in_dVValue | The V Value at which we want to evaluate the surface.

Return values:

  | out_vPosition | Position at the given UV.
  | out_vUTangent | Tangent in U at the given UV.
  | out_vVTangent | Tangent in V at the given UV.
  | out_vNormal | Normal 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_dUNormalizedValue | The normalized U Value(0.0 to 1.0) at which we want to evaluate the surface.
  | in_dVNormalizedValue | The normalized V Value(0.0 to 1.0) at which we want to evaluate the surface.

Return values:

  | out_vPosition | Position at the given UV.
  | out_vUTangent | Tangent in U at the given UV.
  | out_vVTangent | Tangent in V at the given UV.
  | out_vNormal | Normal 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_dUValue | The U Value from which we want the normalized U Value.
  | in_dVValue | The V Value from which we want the normalized V Value.

Return values:

  | out_dNormalizedUValue | The normalized U Value(0.0 to 1.0).
  | out_dNormalizedVValue | The 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_dNormalizedUValue | The normalized UValue(0.0 to 1.0) from which we want the actual U Value.
  | in_dNormalizedVValue | The normalized VValue(0.0 to 1.0) from which we want the actual V Value.

Return values:

  | out_dUValue | The actual U value.
  | out_dVValue | The 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_lTrimIndex | The index of the trim curve for which we want the description.
  | in_siNurbsFormat | Specifies how the data is formatted.

Return values:

  | out_trimcurve | The 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:

- xsi_nurbssurface.h