Class IFaceDataChannel

3DS Max Plug-In SDK

Class IFaceDataChannel

See Also: Class IDataChannel, Class IFaceDataChannelsEnumCallBack , Class IFaceDataMgr

class IFaceDataChannel : public IDataChannel

Description:

This class is available in release 4.0 and later only.

This class represents the face-data channel interface and as such is an abstraction of a collection of data objects that is associated with faces of 3ds max objects. 3ds max objects that have face-data channels call the methods of this interface when those faces change in some way. The data channels can then react to the changes to the faces. You can use the macro GetFaceDataChannelInterface(obj) to obtain a pointer to this interface.

Currently in version 4.0 only Meshes support face-data channels.

Methods:

public:

Face Operations and Events

The face operations and events are called by the owner of face-data channels when its faces change in some way. It's up to the face-data channel to do wathever it wants to do on these notification methods.

Prototype:

virtual BOOL FacesCreated(ULONG at, ULONG num) = 0;

Remarks:

This method is called when num new faces are created at the index at in the object’s list of faces.

Parameters:

ULONG at

The index in the object’s array of faces where the new faces are inserted.

ULONG num

The number of new faces which are created.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual BOOL FacesClonedAndAppended(BitArray& set) = 0;

Remarks:

This method is called when the owner object has cloned some of its faces and appended these to its list of faces. The bits in the set array correspond to the cloned faces.

Parameters:

BitArray& set

The array of bits. Note that this array has as many bits as there are faces in the owner object.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual BOOL FacesDeleted(BitArray& set) = 0;

Remarks:

This method is called when faces were deleted in the owner object. The bits in the set array correspond to the deleted faces.

Parameters:

BitArray& set

The array of bits. Note that this array has as many bits as there are faces in the owner object.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual BOOL FacesDeleted(ULONG from, ULONG num) = 0;

Remarks:

This method is called when faces were deleted in the owner object. This method allows for a more efficient deletion of a range of data objects than the previous BitArray based one.

Parameters:

ULONG from

The index in the object’s array of faces. Faces starting at this index were deleted.

ULONG num

The number of faces that were deleted.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual void AllFacesDeleted() = 0;

Remarks:

This method is called when all faces in the owner object are deleted

Prototype:

virtual BOOL FaceCopied(ULONG from, ULONG to) = 0;

Remarks:

This method is called when a face has been copied from index from in the owner object's array of faces to the face at index to.

Parameters:

ULONG from

The index of the source face.

ULONG to

The index of the destination face.

Return Value:

TRUE if successful, otherwise FALSE.

Prototype:

virtual BOOL FaceInterpolated(ULONG numSrc, ULONG* srcFaces, float* coeff, ULONG targetFace) = 0;

Remarks:

This method is called when a new face has been created in the owner object based on data interpolated from other faces.

Parameters:

ULONG numSrc

The number of faces used in the interpolation.

ULONG* srcFaces

The array of numSrc face indices into the owner object’s face array. These faces were used when creating the new face.

float* coeff

The array of numSrc coefficients used in the interpolation.

ULONG targetFac

The index in the owner object’s array of faces of the newly created face.

Return Value:

TRUE if successful, otherwise FALSE.

Geometry pipeline (stack) methods

These methods are called when the owner object is flowing up the pipeline (stack). They must be implemented to ensure that the face-data channel flows up the pipeline correctly. The owner object expects the face-data to do exactly what the names of these methods imply. These can be seen as commands that are given by the owner object to the face-data channel

Prototype:

virtual IFaceDataChannel* CreateChannel( ) = 0;

Remarks:

This method will allocate an empty data-channel.

Prototype:

virtual IFaceDataChannel* CloneChannel( ) = 0;

Remarks:

The data-channel needs to allocate a new instance of itself and fill it with copies of all data items it stores. Note: This method makes it more efficient to clone the whole data-channel.

Prototype:

virtual BOOL AppendChannel(const IFaceDataChannel* fromChan) = 0;

Remarks:

The data-channel needs to append the data objects in the fromChan to itself.

Parameters:

const IFaceDataChannel* fromChan

The channel containing the data objects to append.

Return Value:

TRUE if successful, otherwise FALSE.