Public Member Functions | Protected Attributes | Friends

NURBSSurface Class Reference

This reference page is linked to from the following overview topics: Modeling, NURBS Surface Classes, Parameter Ranges for Curves and Surfaces, Materials Assignment and Texture Coordinates, Creating Primitive NURBS Objects.


Search for all occurrences

Detailed Description

See also:
Class NURBSObject, Class NURBSTextureSurface, Template Class Tab, Class NURBSTextureChannelSet.

Description:
This class is available in release 2.0 and later only.

This class describes the properties of a NURBS surface. This includes its material ID, texture/tiling options, renderable state, open/closed state, and normal inverted state. The Evaluate() method is used to compute points and tangents on the surface.

All methods of this class are implemented by the system.
Data Members:
protected:

BOOL mGenUVs;

TRUE if the 'Generate Mapping Coordinates' checkbox is on; otherwise FALSE.

BOOL mFlipNormals;

TRUE if the surface normals are inverted; otherwise FALSE.

BOOL mRenderable;

TRUE if the surface may be rendered; otherwise FALSE.

int mMatID;

The material ID for the surface.

BOOL mClosedInU, mClosedInV;

The surface closed flags.

NURBSTextureChannelSet mTextureChannelSet;

This data member is available in release 3.0 and later only.

This is the set of texture mapping channels used by this surface.

BOOL mFlipNormals;

TRUE if normals are flipped for the surface; otherwise FALSE.

BOOL mRenderable;

TRUE if the surface is renderable; otherwise FALSE.

int mMatID;

The zero based material ID for the surface.

BOOL mClosedInU

TRUE if the surface is closed in U; otherwise FALSE.

BOOL mClosedInV;

TRUE if the surface is closed in V; otherwise FALSE.

TessApprox *mpVTess;

This data member is available in release 3.0 and later only.

Points to the TessApprox object for the viewport (optional).

TessApprox *mpRTess;

This data member is available in release 3.0 and later only.

Points to the TessApprox object for the production renderer (optional).

TessApprox *mpRTessDisp;

This data member is available in release 3.0 and later only.

Points to the TessApprox object for displacement mapping (optional).

TessApprox *mpVTessCurve;

This data member is available in release 3.0 and later only.

Points to the TessApprox object for tesselating curves in the viewports(optional).

TessApprox *mpRTessCurve;

This data member is available in release 3.0 and later only.

Points to the TessApprox object for tesselating curves in the production renderer (optional).

#include <surf_api.h>

Inheritance diagram for NURBSSurface:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void *  GetSurfCache ()
void  SetSurfCache (void *pCache)
DllExport  NURBSSurface (void)
virtual DllExport  ~NURBSSurface (void)
DllExport NURBSSurface operator= (const NURBSSurface &surf)
DllExport BOOL  Renderable ()
DllExport void  Renderable (BOOL state)
DllExport BOOL  FlipNormals ()
DllExport void  FlipNormals (BOOL state)
DllExport BOOL  GenerateUVs (int channel=0)
DllExport void  SetGenerateUVs (BOOL state, int channel=0)
DllExport int  MatID ()
DllExport void  MatID (int id)
DllExport Point2  GetTextureUVs (TimeValue t, int i, int channel=0)
DllExport void  SetTextureUVs (TimeValue t, int i, Point2 pt, int channel=0)
DllExport void  GetTileOffset (TimeValue t, float &ut, float &vt, float &uo, float &vo, float &a, int channel=0)
DllExport void  SetTileOffset (TimeValue t, float ut, float vt, float uo, float vo, float a, int channel=0)
DllExport NURBSTextureSurface GetTextureSurface (int channel)
DllExport void  SetTextureSurface (int channel, NURBSTextureSurface &texSurf)
DllExport int  NumChannels ()
DllExport int  GetChannelFromIndex (int index)
DllExport BOOL  IsClosedInU (void)
DllExport BOOL  IsClosedInV (void)
DllExport BOOL  Evaluate (TimeValue t, double u, double v, Point3 &pt, Point3 &dPdU, Point3 &dPdV)
DllExport BOOL  Evaluate (TimeValue t, double u, double v, Point3 &pt, Point3 &dPdU, Point3 &dPdV, Point3 &d2PdU2, Point3 &d2PdV2, Point3 &d2PdUdV)
DllExport void  GetParameterRange (TimeValue t, double &uMin, double &uMax, double &vMin, double &vMax)
DllExport BOOL  GetNURBSData (TimeValue t, int &degreeInU, int &degreeInV, int &numInU, int &numInV, NURBSCVTab &cvs, int &numKnotsInU, int &numKnotsInV, NURBSKnotTab &uKnots, NURBSKnotTab &vKnots)
DllExport BOOL  GetCLPTextureSurfaceData (TimeValue t, int channel, int &degreeInU, int &degreeInV, int &numInU, int &numInV, NURBSCVTab &cvs, int &numKnotsInU, int &numKnotsInV, NURBSKnotTab &uKnots, NURBSKnotTab &vKnots)
DllExport int  NumTrimLoops (TimeValue t)
DllExport int  NumCurvesInLoop (TimeValue t, int loop)
DllExport BOOL  Get2dTrimCurveData (TimeValue t, int loop, int curve, int &degree, int &numCVs, NURBSCVTab &cvs, int &numKnots, NURBSKnotTab &knots)
DllExport BOOL  Get3dTrimCurveData (TimeValue t, int loop, int curve, int &degree, int &numCVs, NURBSCVTab &cvs, int &numKnots, NURBSKnotTab &knots)
DllExport TessApprox GetProdTess (NURBSTessType type=kNTessSurface)
DllExport TessApprox GetViewTess (NURBSTessType type=kNTessSurface)
DllExport void  SetProdTess (TessApprox &tess, NURBSTessType type=kNTessSurface)
DllExport void  SetViewTess (TessApprox &tess, NURBSTessType type=kNTessSurface)
DllExport void  ClearViewTess (NURBSTessType type=kNTessSurface)
DllExport void  ClearProdTess (NURBSTessType type=kNTessSurface)

Protected Attributes

NURBSTextureChannelSet  mTextureChannelSet
BOOL  mFlipNormals
BOOL  mRenderable
int  mMatID
BOOL  mClosedInU
BOOL  mClosedInV
TessApprox mpVTess
TessApprox mpRTess
TessApprox mpRTessDisp
TessApprox mpVTessCurve
TessApprox mpRTessCurve
void *  mpSurfCache

Friends

class  NURBSCVSurface
class  NURBSPointSurface
class  NURBSBlendSurface
class  NURBSNBlendSurface
class  NURBSOffsetSurface
class  NURBSXFormSurface
class  NURBSMirrorSurface
class  NURBSCapSurface
class  NURBSIsoCurve
class  NURBSProjectVectorCurve
class  NURBSProjectNormalCurve
class  NURBSSurfSurfIntersectionCurve
class  NURBSCurveOnSurface
class  NURBSPointCurveOnSurface
class  NURBSMultiCurveTrimSurface
class  NURBSTextureChannel
class  NURBSTextureChannelSet

Constructor & Destructor Documentation

DllExport NURBSSurface ( void  )
Remarks:
Constructor. The surface is initialized as follows:

mKind = kNURBSSurface;

mFlipNormals = FALSE;

mRenderable = TRUE;

mMatID = 1;

mpVTess = NULL;

mpRTess = NULL;

mpRTessDisp = NULL;

mpVTessCurve = NULL;

mpRTessCurve = NULL;
virtual DllExport ~NURBSSurface ( void  ) [virtual]
Remarks:
Destructor. Any TessApprox objects are freed.

Member Function Documentation

void* GetSurfCache ( ) [inline]
void SetSurfCache ( void *  pCache ) [inline]
DllExport NURBSSurface& operator= ( const NURBSSurface surf )
Remarks:
Assignment operator.
Parameters:
const NURBSSurface& curve

The surface to assign.
DllExport BOOL Renderable ( )
Remarks:
Returns TRUE if the surface is renderable; otherwise FALSE.
DllExport void Renderable ( BOOL  state )
Remarks:
Sets the renderable flag to the specified state.
Parameters:
BOOL state

TRUE for renderable; FALSE for non-renderable.
DllExport BOOL FlipNormals ( )
Remarks:
Returns the state of the flip normals flag.
DllExport void FlipNormals ( BOOL  state )
Remarks:
Set the state of the flip normals flag.
Parameters:
BOOL state

TRUE if the normals should be flipped; FALSE for not flipped.
DllExport BOOL GenerateUVs ( int  channel = 0 )
Remarks:
Returns TRUE if the generate UV mapping coordinates flag is set for the specified channel; otherwise FALSE.
Parameters:
int channel = 0

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.
DllExport void SetGenerateUVs ( BOOL  state,
int  channel = 0 
)
Remarks:
Sets the state of the generate UV mapping coordinates flag.
Parameters:
BOOL state

TRUE for on; FALSE for off.

int channel = 0

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.
DllExport int MatID ( )
Remarks:
Returns the material ID.
DllExport void MatID ( int  id )
Remarks:
Sets the mateials ID to the specified value.
Parameters:
int id

Specifies the material ID to set.
DllExport Point2 GetTextureUVs ( TimeValue  t,
int  i,
int  channel = 0 
)
Remarks:
Returns the specified texture coordinate.
Parameters:
TimeValue t

The time to get the texture UVs.

int i

The zero based index of the coordinate to return. This value must be >=0 and < 4.

int channel = 0

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.
DllExport void SetTextureUVs ( TimeValue  t,
int  i,
Point2  pt,
int  channel = 0 
)
Remarks:
Set the specified texture coordinate to the specified value.
Parameters:
TimeValue t

The time to set the texture UVs.

int i

The zero based index of the texture coordinate to set. This value must be >= 0 and < 4.

Point2 pt

The texture coordinate value to set.

int channel = 0

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.
DllExport void GetTileOffset ( TimeValue  t,
float &  ut,
float &  vt,
float &  uo,
float &  vo,
float &  a,
int  channel = 0 
)
Remarks:
Retrieves the texture tiling and offset values for the surface.
Parameters:
TimeValue t

The time to get the tile offset.

float &ut

The tiling value in the U direction.

float &vt

The tiling value in the V direction.

float &uo

The offset value in the U direction.

float &vo

The offset value in the V direction.

int channel = 0

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.
DllExport void SetTileOffset ( TimeValue  t,
float  ut,
float  vt,
float  uo,
float  vo,
float  a,
int  channel = 0 
)
Remarks:
Sets the texture tiling and offset values for the surface.
Parameters:
TimeValue t

The time to set the tile offset.

float ut

The tiling value in the U direction.

float vt

The tiling value in the V direction.

float uo

The offset value in the U direction.

float vo

The offset value in the V direction.

int channel = 0

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.
DllExport NURBSTextureSurface& GetTextureSurface ( int  channel )
Remarks:
Returns a reference to the texture surface used by this surface for the specified channel.
Parameters:
int channel

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.
DllExport void SetTextureSurface ( int  channel,
NURBSTextureSurface texSurf 
)
Remarks:
Sets the texture surface used by this surface for the specified channel.
Parameters:
int channel

The channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.

NURBSTextureSurface& texSurf

The texture surface to set.
DllExport int NumChannels ( )
Remarks:
Returns the number of channels used by the surface.
DllExport int GetChannelFromIndex ( int  index )
Remarks:
Returns a channel number corresponding to the specified index into the NURBSTextureChannelSet.
Parameters:
int index

The zero based index into the NURBSTextureChannelSet.
DllExport BOOL IsClosedInU ( void  )
Remarks:
Returns TRUE if the surface is closed in the U direction; otherwise FALSE.
DllExport BOOL IsClosedInV ( void  )
Remarks:
Returns TRUE if the surface is closed in the V direction; otherwise FALSE.
DllExport BOOL Evaluate ( TimeValue  t,
double  u,
double  v,
Point3 pt,
Point3 dPdU,
Point3 dPdV 
)
Remarks:
Retrieves the point on the surface, and the u and v derivatives based on the parameters u and v.
Parameters:
TimeValue t

The time at which to evaluate the surface.

double u

The value at which to evaluate the surface in u. This value must be between the uMin and uMax as returned from GetParameterRange().

double v

The value at which to evaluate the surface in v. This value must be between the vMin and vMax as returned from GetParameterRange().

Point3& pt

The point on the surface.

Point3& dPdU

The derivative along u.

Point3& dPdV

The derivative along v.
Returns:
TRUE if the method was able to evaluate the surface; otherwise FALSE.
DllExport BOOL Evaluate ( TimeValue  t,
double  u,
double  v,
Point3 pt,
Point3 dPdU,
Point3 dPdV,
Point3 d2PdU2,
Point3 d2PdV2,
Point3 d2PdUdV 
)
Remarks:
Retrieves the point on the surface, and the u and v derivatives and second derivatives based on the parameters u and v.
Parameters:
TimeValue t

The time at which to evaluate the surface.

double u

The value at which to evaluate the surface in u. This value must be between the uMin and uMax as returned from GetParameterRange().

double v

The value at which to evaluate the surface in v. This value must be between the vMin and vMax as returned from GetParameterRange().

Point3& pt

The point on the surface.

Point3& dPdU

The derivative along u.

Point3& dPdV

The derivative along v.

Point3& d2PdU2

The second derivative along u.

Point3& d2PdV2

The second derivative along v.

Point3& d2PdUdV
Returns:
TRUE if the method was able to evaluate the surface; otherwise FALSE.
DllExport void GetParameterRange ( TimeValue  t,
double &  uMin,
double &  uMax,
double &  vMin,
double &  vMax 
)
Remarks:
Retrieves the minimum and maximum valid values for u and v as passed to Evaluate().
Parameters:
TimeValue t

The time at which to get the parameter range.

double& uMin

The minimum value in u is returned here.

double& uMax

The maximum value in v is returned here.

double& vMin

The minimum value in u is returned here.

double& vMax

The maximum value in v is returned here.
DllExport BOOL GetNURBSData ( TimeValue  t,
int &  degreeInU,
int &  degreeInV,
int &  numInU,
int &  numInV,
NURBSCVTab cvs,
int &  numKnotsInU,
int &  numKnotsInV,
NURBSKnotTab uKnots,
NURBSKnotTab vKnots 
)
Remarks:
Retrieves data about the NURBSSurface at the specified time.
Parameters:
TimeValue t

The time at which to get the NURBS information.

int& degreeInU

The degree of the surface in U.

int& degreeInV

The degree of the surface in V.

int& numInU

The number of CVs in U.

int& numInV

The number of CVs in V.

NURBSCVTab& cvs

The table of CVs. Note: typedef Tab<NURBSControlVertex> NURBSCVTab;

int& numKnotsInU

The number of knots in U.

int& numKnotsInV

The number of knots in V.

NURBSKnotTab uKnots

A table of knots in U. Note: typedef Tab<double> NURBSKnotTab;

NURBSKnotTab vKnots

A table of knots in V.
Returns:
TRUE if the data was retrieved; otherwise FALSE.
DllExport BOOL GetCLPTextureSurfaceData ( TimeValue  t,
int  channel,
int &  degreeInU,
int &  degreeInV,
int &  numInU,
int &  numInV,
NURBSCVTab cvs,
int &  numKnotsInU,
int &  numKnotsInV,
NURBSKnotTab uKnots,
NURBSKnotTab vKnots 
)
Remarks:
This method retrieves the Chord Length Parameterization Texture Surface data.
Parameters:
TimeValue t

The time at which to retrieve the data.

int channel

The texture channel. This is a number in the range 0 and 98 which correspond to 1 to 99 in the user interface.

int& degreeInU

The degree of the surface in U.

int& degreeInV

The degree in V.

int& numInU

The number of CVs in U.

int& numInV

The number of CVs in V.

NURBSCVTab& cvs

The table of CVs. Note: typedef Tab<NURBSControlVertex> NURBSCVTab;

int& numKnotsInU

The number of knots in U.

int& numKnotsInV

The number of knots in V.

NURBSKnotTab uKnots

A table of knots in U. Note: typedef Tab<double> NURBSKnotTab;

NURBSKnotTab vKnots

A table of knots in V.
Returns:
TRUE if the data was retrieved; otherwise FALSE.
DllExport int NumTrimLoops ( TimeValue  t )
Remarks:
Returns the number of trim loops at the specified time. Each loop may be made up of several curves.
Parameters:
TimeValue t

The time at which to return the number.
DllExport int NumCurvesInLoop ( TimeValue  t,
int  loop 
)
Remarks:
Returns the number of curves in the specified trim loop.
Parameters:
TimeValue t

The time at which to return the number.

int loop

The zero based index of the trim loop.
DllExport BOOL Get2dTrimCurveData ( TimeValue  t,
int  loop,
int  curve,
int &  degree,
int &  numCVs,
NURBSCVTab cvs,
int &  numKnots,
NURBSKnotTab knots 
)
Remarks:
Retrieves data about the specified 2D trim curve in use by the surface.
Parameters:
TimeValue t

The time at which to retrieve the data.

int loop

The zero based index of the trim loop.

int curve

The zero based index of the trim curve within the loop.

int& degree

The degree of the curve is returned here.

int& numCVs

The number of CVs.

NURBSCVTab& cvs

The table of CVs. Note: typedef Tab<NURBSControlVertex> NURBSCVTab;

int& numKnots

The number of knots.

NURBSKnotTab knots

A table of knots. Note: typedef Tab<double> NURBSKnotTab;
Returns:
TRUE if the data was retrieved; otherwise FALSE.
DllExport BOOL Get3dTrimCurveData ( TimeValue  t,
int  loop,
int  curve,
int &  degree,
int &  numCVs,
NURBSCVTab cvs,
int &  numKnots,
NURBSKnotTab knots 
)
Remarks:
Retrieves data about the specified 2D trim curve in use by the surface.
Parameters:
TimeValue t

The time at which to retrieve the data.

int loop

The zero based index of the trim loop.

int curve

The zero based index of the trim curve within the loop.

int& degree

The degree of the curve is returned here.

int& numCVs

The number of CVs.

NURBSCVTab& cvs

The table of CVs. Note: typedef Tab<NURBSControlVertex> NURBSCVTab;

int& numKnots

The number of knots.

NURBSKnotTab knots

A table of knots. Note: typedef Tab<double> NURBSKnotTab;
Returns:
TRUE if the data was retrieved; otherwise FALSE.
DllExport TessApprox* GetProdTess ( NURBSTessType  type = kNTessSurface )
Remarks:
Returns a pointer to the TessApprox object used for production rendering of the specified type.
Parameters:
NURBSTessType type=kNTessSurface

The tesselation type. See NURBSTess Types.
DllExport TessApprox* GetViewTess ( NURBSTessType  type = kNTessSurface )
Remarks:
Returns a pointer to the TessApprox object used for viewport rendering of the specified type.
Parameters:
NURBSTessType type=kNTessSurface

The tesselation type. See NURBSTess Types.
DllExport void SetProdTess ( TessApprox tess,
NURBSTessType  type = kNTessSurface 
)
Remarks:
Sets the TessApprox object used for production rendering of the specified type.
Parameters:
TessApprox& tess

The object to set.

NURBSTessType type=kNTessSurface

The tesselation type. See NURBSTess Types.
DllExport void SetViewTess ( TessApprox tess,
NURBSTessType  type = kNTessSurface 
)
Remarks:
Sets the TessApprox object used for viewport rendering of the specified type.
Parameters:
TessApprox& tess

The object to set.

NURBSTessType type=kNTessSurface

The tesselation type. See NURBSTess Types.
DllExport void ClearViewTess ( NURBSTessType  type = kNTessSurface )
Remarks:
Clears (deletes) the TessApprox object used for viewport rendering of the specified type.
Parameters:
NURBSTessType type=kNTessSurface

The tesselation type. See NURBSTess Types.
DllExport void ClearProdTess ( NURBSTessType  type = kNTessSurface )
Remarks:
Clears (deletes) the TessApprox object used for production rendering of the specified type.
Parameters:
NURBSTessType type=kNTessSurface

The tesselation type. See NURBSTess Types.
Operators:

Friends And Related Function Documentation

friend class NURBSCVSurface [friend]
friend class NURBSPointSurface [friend]
friend class NURBSBlendSurface [friend]
friend class NURBSNBlendSurface [friend]
friend class NURBSOffsetSurface [friend]
friend class NURBSXFormSurface [friend]
friend class NURBSMirrorSurface [friend]
friend class NURBSCapSurface [friend]
friend class NURBSIsoCurve [friend]
friend class NURBSProjectVectorCurve [friend]
friend class NURBSProjectNormalCurve [friend]
friend class NURBSSurfSurfIntersectionCurve [friend]
friend class NURBSCurveOnSurface [friend]
friend class NURBSPointCurveOnSurface [friend]
friend class NURBSMultiCurveTrimSurface [friend]
friend class NURBSTextureChannel [friend]
friend class NURBSTextureChannelSet [friend]

Member Data Documentation

BOOL mFlipNormals [protected]
BOOL mRenderable [protected]
int mMatID [protected]
BOOL mClosedInU [protected]
BOOL mClosedInV [protected]
TessApprox* mpVTess [protected]
TessApprox* mpRTess [protected]
TessApprox* mpRTessDisp [protected]
TessApprox* mpVTessCurve [protected]
TessApprox* mpRTessCurve [protected]
void* mpSurfCache [protected]

NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface
NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface NURBSSurface