Class NURBSBlendSurface

3DS Max Plug-In SDK

Class NURBSBlendSurface

See Also: Class NURBSSurface.

class NURBSBlendSurface : public NURBSSurface

Description:

This class is available in release 2.0 and later only.

This class defines a dependent blend surface. A blend surface connects the edge of one surface to the edge of another, blending the curvature of the parents to create a smooth surface between them. Methods are available to get/set the parents, parent Ids, tension parameters and surface normal matching state.

All methods of this class are implemented by the system.

Friend Classes:

friend class NURBSSet

Methods:

protected:

Prototype:

void Clean(NURBSIdTab ids);

Remarks:

This method is available in release 3.0 and later only.

This methods breaks the relation between this NURBSObject and a NURBSSet.

Parameters:

NURBSIdTab ids

A table with the IDs of each object in the NURBSSet.

public:

Prototype:

NURBSBlendSurface();

Remarks:

Constructor. The data members are initialized as follows:

 mType = kNBlendSurface;

 mpObject = NULL;

 mpNSet = NULL;

 for (int i = 0; i < 2; i++) {

  mParentId[i] = 0;

  mParentIndex[i] = -1;

  mParentEdge[i] = 0;

  mFlip[i] = FALSE;

  mTension[i] = 1.0;

  mCurveStartParam[i] = 0.0;

 }

Prototype:

virtual ~NURBSBlendSurface();

Remarks:

Destructor.

Prototype:

void SetParent(int pnum, int index);

Remarks:

Sets the index in the NURBSSet of the specified parent object.

Parameters:

int pnum

The parent number: 0 or 1.

int index

The index into the NURBSSet of the parent surface.

Prototype:

void SetParentId(int pnum, NURBSId id);

Remarks:

Sets the NURBSId of the specified parent.

Parameters:

int pnum

The parent number: 0 or 1.

NURBSId id

The id to set.

Prototype:

int GetParent(int pnum);

Remarks:

Returns the index in the NURBSSet of the specified parent object.

Parameters:

int pnum

The parent number: 0 or 1.

Prototype:

NURBSId GetParentId(int pnum);

Remarks:

Returns the NURBSId of the specified parent. Note that a NURBSId won't be valid until the object has been instantiated in the scene.

Parameters:

int pnum

The parent number: 0 or 1.

Prototype:

void SetEdge(int pnum, int edge);

Remarks:

Sets which edge of the specified surface is used for the blend.

Parameters:

int pnum

The parent number: 0 or 1.

int edge

One of the following values:

0: The low U edge.

1: The high U edge.

2: The low V edge.

3: The high V edge.

Prototype:

int GetEdge(int pnum);

Remarks:

Returns an integer that determines which edge of the specified surface is used for the blend.

Parameters:

int pnum

The parent number: 0 or 1.

Return Value:

One of the following values:

0: The low U edge.

1: The high U edge.

2: The low V edge.

3: The high V edge.

Prototype:

void SetTension(TimeValue t, int pnum, double ten);

Remarks:

Sets the tension value for the specified parent surface.

Parameters:

TimeValue t

The time at which to set the tension value.

int pnum

The parent number: 0 or 1.

double ten

The tension value to set.

Prototype:

double GetTension(TimeValue t, int pnum);

Remarks:

Returns the tension value for the specified parent surface.

Parameters:

TimeValue t

The time at which to return the tension value.

int pnum

The parent number: 0 or 1.

Prototype:

void SetFlip(int pnum, BOOL flip);

Remarks:

This allows one to control the matching of parent surface normals when creating the blend surface. For example, normally when you create a blend surface between two parent surfaces you don't want a 'bow tie' surface (one with the ends rotated 180 degrees so it crosses on itself in the middle). If you simply match the parent normals you'll occasionally get a 'bow tie' surface. To prevent this you use this method to set a state indicating that one or the other should be flipped before it's used. In this way, when the blend is created, a 'bow tie' won't occur.

Parameters:

int pnum

The number of the parent surface: 0 or 1.

BOOL flip

TRUE to match the parent surface normal; FALSE to not match it.

Prototype:

BOOL GetFlip(int pnum);

Remarks:

Returns the flip state of the specified parent surface.

Parameters:

int pnum

The number of the parent surface: 0 or 1.

Prototype:

void SetCurveStartPoint(TimeValue t, int pnum, double startpoint);

Remarks:

This method is available in release 3.0 and later only.

Sets the start point for the specified parent curve. Note: This is only applicable if the parent is a closed curve.

Parameters:

TimeValue t

The time at which to set the start point.

int pnum

The number of the parent surface: 0 or 1.

double startpoint

The start point in the range 0.0 to 1.0.

Prototype:

double GetCurveStartPoint(TimeValue t, int pnum);

Remarks:

This method is available in release 3.0 and later only.

Returns the start point of the specified parent curve.

Note: This is only applicable if the parent is a closed curve.

Parameters:

TimeValue t

The time at which to get the start point.

int pnum

The number of the parent surface: 0 or 1.

Operators:

Prototype:

NURBSBlendSurface & operator=(const NURBSBlendSurface& surf);

Remarks:

Assignment operator.

Parameters:

const NURBSBlendSurface& surf

The surface to assign.