Template Class IFFDMod

3DS Max Plug-In SDK

Template Class IFFDMod

See Also: Class Control, Class Point3, Class IPoint3, Class Modifier.

template <class T> class IFFDMod : public T

Description:

This class is available in release 3.0 and later only.

This class is an interface into both FFD OS modifiers and also into helper objects for FFD spacewarps.

Given a pointer to ReferenceTarget ref, you can use it as follows:

 Class_ID id = ref->ClassID();

 if (id==FFDNMOSSQUARE_CLASS_ID || id==FFDNMOSCYL_CLASS_ID ||

id==FFD44_CLASS_ID || id==FFD33_CLASS_ID || id==FFD22_CLASS_ID)

  IFFDMod<Modifier>* ffd = (IFFDMod<Modifier>*)ref;   

  // call various methods

 } 

 else if(id==FFDNMWSSQUARE_CLASS_ID || id = FFDNMWSCYL_CLASS_ID)

  IFFDMod<WSMObject>* ffd = (IFFDMod<WSMObject>*)ref;

  // call various methods

 }

Methods:

public:

Prototype:

virtual int NumPts()=0;

Remarks:

Returns the number of lattice control points.

Prototype:

virtual int NumPtConts()=0;

Remarks:

Returns the number of Control Ponits having controllers.

Prototype:

virtual Control* GetPtCont(int i)=0;

Remarks:

Returns a pointer to the 'i-th' Control Point controller.

Parameters:

int i

The zero based index of the Control Point.

Prototype:

virtual void SetPtCont(int i,Control *c)=0;

Remarks:

Sets the controller used by the specified Control Point.

Parameters:

int i

The zero based index of the Control Point.

Control *c

Points to the controller to set.

Prototype:

virtual Point3 GetPt(int i)=0;

Remarks:

Returns the 'i-th' Control Point.

Parameters:

int i

The zero based index of the Control Point.

Prototype:

virtual void SetPt(int i, Point3 p)=0;

Remarks:

Sets the 'i-th' control point.

Parameters:

int i

The zero based index of the Control Point.

Point3 p

The point to set.

Prototype:

virtual void SetGridDim(IPoint3 d);

Remarks:

Sets the lattice dimension.

Parameters:

IPoint3 d

The dimensions to set.

Default Implementation:

{ }

Prototype:

virtual IPoint3 GetGridDim();

Remarks:

Returns the lattice dimensions.

Default Implementation:

{ return IPoint3(0,0,0); }

Prototype:

virtual void AnimateAll();

Remarks:

This method assigns controllers to all the Control Points.

Default Implementation:

{ }

Prototype:

virtual void Conform();

Remarks:

Calling this method is the equivalent of pressing the Conform button in the FFD UI. Note: This method is not valid for WSMObject's.

Default Implementation:

{ }

Prototype:

virtual void SelectPt(int i, BOOL sel, BOOL clearAll=FALSE);

Remarks:

Selects or de-selects the specified Control Point.

Parameters:

int i

The zero based index of the Control Point.

BOOL sel

TRUE to select; FALSE to de-selelct.

BOOL clearAll=FALSE

TRUE to clear all the currently selected Control Points before setting the specified one; FALSE to leave the selected points alone.

Default Implementation:

{ }