Class NURBSRuledSurface

3DS Max Plug-In SDK

Class NURBSRuledSurface

See Also: Class NURBSSurface.

class NURBSRuledSurface : public NURBSSurface

Description:

This class is available in release 2.0 and later only.

This class defines a dependent ruled surface. A ruled surface is generated from two curve sub-objects. It lets you use curves to design the two opposite borders of a surface. Methods are available to get/set the indices of the parent surface in the NURBSSet and the parent Ids and to set the surface normal matching state of the surfaces.

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:

NURBSRuledSurface();

Remarks:

Constructor. The data members are initialized as follows:

 mType = kNRuledSurface;

 mpObject = NULL;

 mpNSet = NULL;

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

  mParentId[i] = 0;

  mParentIndex[i] = -1;

  mFlip[i] = FALSE;

  mCurveStartParam[i] = 0.0;

 }

Prototype:

virtual ~NURBSRuledSurface();

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 in the NURBSSet of the specified parent object.

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 SetFlip(int pnum, BOOL flip);

Remarks:

This allows one to control the matching of parent surface normals when creating the ruled surface. For example, normally when you create a ruled surface between two parent curves 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 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 ruled surface is created, a 'bow tie' won't occur.

Parameters:

int pnum

The number of the parent curve: 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 curve.

Parameters:

int pnum

The number of the parent curve: 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 curve: 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 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 get the start point.

int pnum

The number of the parent curve: 0 or 1.

Operators:

Prototype:

NURBSRuledSurface & operator=(const NURBSRuledSurface& surf);

Remarks:

Assignment operator.

Parameters:

const NURBSRuledSurface& surf

The surface to assign.