This reference page is linked to from the following overview topics: Reference System Best Practices.
Reference Maker to single entity.
#include <ref.h>
Public Member Functions |
|
CoreExport | SingleRefMaker () |
Constructor. |
|
CoreExport | ~SingleRefMaker () |
Destructor. |
|
CoreExport void | SetRef (RefTargetHandle rt) |
Set the Reference. |
|
CoreExport RefTargetHandle | GetRef () const |
Get the Reference. |
|
CoreExport RefResult | NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message) |
By default handles
REFMSG_TARGET_DELETED message only. |
|
CoreExport void | DeleteThis () |
Deletes an instance of this class. |
|
CoreExport SClass_ID | SuperClassID () |
Retrieves a constant representing the type
of the plugin. |
|
CoreExport int | NumRefs () |
Returns the total number of references this
ReferenceMaker can hold. |
|
CoreExport RefTargetHandle | GetReference (int i) |
Returns the 'i-th' reference. |
|
CoreExport BOOL | CanTransferReference (int i) |
Tells whether this reference can be
transfered. |
|
Protected Member Functions |
|
virtual CoreExport void | SetReference (int i, RefTargetHandle rtarg) |
Stores a
ReferenceTarget as its 'i-th' reference`. |
|
Protected Attributes |
|
RefTargetHandle | rtarget |
Handle to the single reference. |
CoreExport SingleRefMaker | ( | ) |
Constructor.
CoreExport ~SingleRefMaker | ( | ) |
Destructor.
Suspended from Undo system
CoreExport void SetRef | ( | RefTargetHandle | rt | ) |
CoreExport RefTargetHandle GetRef | ( | ) | const |
Get the Reference.
CoreExport RefResult NotifyRefChanged | ( | Interval | changeInt, |
RefTargetHandle | hTarget, | ||
PartID & | partID, | ||
RefMessage | message | ||
) | [virtual] |
By default handles REFMSG_TARGET_DELETED message only.
This function should be overridden by plugins that need to respond to reference messages. If this is done, it is still recommended to call the original implementation
NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message ) { switch(message) { // Handle our messages } // Handles REFMSG_TARGET_DELETED return SingleRefMaker::NotifyRefChanged(changeInt, hTarget, partID, message); }
See ReferenceMaker::NotifyRefChanged for complete documentation
Implements ReferenceMaker.
Reimplemented in SingleRefMakerPatchNode, SingleRefMakerPatchMtl, SingleWeakRefMaker, SingleRefMakerSplineNode, and SingleRefMakerSplineMtl.
CoreExport void DeleteThis | ( | ) | [virtual] |
Deletes an instance of this class.
3ds Max calls this method when it needs to delete a plugin object (an instance of a class derived from Animatable). Similarly, plugins that need to delete instances of an Animatable or a class directly derived from it via an Animatable pointer, should call this method instead of calling directly operator delete. Following these rules will ensure that the same memory manager is used to allocate and deallocate the object. The default implementation of this method deletes the object. Plugin instances that never need to be deleted from the heap can overwrite this method to do nothing.
Reimplemented from Animatable.
Reimplemented in SingleWeakRefMaker.
CoreExport SClass_ID SuperClassID | ( | ) | [virtual] |
Retrieves a constant representing the type of the plugin.
Reimplemented from ReferenceMaker.
Reimplemented in SingleWeakRefMaker.
CoreExport int NumRefs | ( | ) | [virtual] |
Returns the total number of references this ReferenceMaker can hold.
The plugin implements this method to indicate the total number of of references it can make. This includes all references whether they are NULL (inactive) or non-NULL (active) at the time when this method is called. A plugin can hold a variable number of references, thus the return value of this method is not to be cached and reused by client code.
Reimplemented from ReferenceMaker.
CoreExport RefTargetHandle GetReference | ( | int | i | ) | [virtual] |
Returns the 'i-th' reference.
The plugin implements this method to return its 'i-th' reference. The plug-in simply keeps track of its references using an integer index for each one. This method is normally called by the system.
i | - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1. |
Reimplemented from ReferenceMaker.
virtual CoreExport void SetReference | ( | int | i, |
RefTargetHandle | rtarg | ||
) | [protected, virtual] |
Stores a ReferenceTarget as its 'i-th' reference`.
The plugin implements this method to store the reference handle passed to it as its 'i-th' reference. In its implementation of this method, the plugin should simply assign the reference handle passed in as a parameter to the member variable that holds the 'i-th' reference. Other reference handling methods such as ReferenceMaker::DeleteReference(), or ReferenceMaker::ReplaceReference() should not be called from within this method. The plugin itself or other plugins should not call this method directly. The system will call this method when a new reference is created or an existing one is replaced by calling ReferenceMaker::ReplaceReference().
i | - The index of the reference to store. Valid values are from 0 to NumRefs()-1. |
rtarg | - The reference handle to store. |
Reimplemented from ReferenceMaker.
CoreExport BOOL CanTransferReference | ( | int | i | ) | [virtual] |
Tells whether this reference can be transfered.
A ReferenceMaker can choose not to let ReferenceTarget::TransferReferences() affect it. Note that plugins probably should not use this. It is used by certain system objects that have references.
i | - Currently not used. |
Reimplemented from ReferenceMaker.
RefTargetHandle rtarget
[protected] |
Handle to the single reference.