Public Member Functions | Protected Member Functions | Protected Attributes

PFSimpleAction Class Reference

Search for all occurrences

#include <PFSimpleAction.h>

Inheritance diagram for PFSimpleAction:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual PFExport RefResult  NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message)
  Receives and responds to messages.
virtual PFExport int  RemapRefOnLoad (int iref)
  Used to load old files with references.
virtual PFExport IOResult  Save (ISave *isave)
  Called for saving data.
virtual PFExport IOResult  Load (ILoad *iload)
  Called for loading data.
virtual CreateMouseCallBack GetCreateMouseCallBack ()
  This method allows the system to retrieve a callback object used in creating an object in the 3D viewports.
virtual BOOL  OKToChangeTopology (MSTR &modName)
  Implemented by the System.
virtual void  InitNodeName (MSTR &s)
  Implemented by the System.
virtual ObjectState  Eval (TimeValue t)
  This method is called to evaluate the object and return the result as an ObjectState.
  PFSimpleAction ()
virtual void  GetClassName (MSTR &s)
  Retrieves the name of the plugin class.
virtual Class_ID  ClassID ()
  Retrieves a constant that uniquely identifies the plugin class.
virtual void  BeginEditParams (IObjParam *ip, ULONG flags, Animatable *prev)=0
virtual void  EndEditParams (IObjParam *ip, ULONG flags, Animatable *next)=0
virtual RefTargetHandle  Clone (RemapDir &remap)=0
  This method is used by 3ds Max to clone an object.
virtual MCHAR *  GetObjectName ()=0
virtual PFExport bool  Init (IObject *pCont, Object *pSystem, INode *node, Tab< Object * > &actions, Tab< INode * > &actionNodes)
  Returns true if the operation has been proceeded successfully.
virtual PFExport bool  Release (IObject *pCont)
  See Init().
virtual bool  SupportRand () const
  An Action may carry some chaos/unpredictibility in its processing.
virtual int  GetRand ()
  For chaos/unpredictibility action, gets rand value.
virtual void  SetRand (int seed)
  For chaos/unpredictibility action, sets rand value.
virtual PFExport int  NewRand ()
  For chaos/unpredictibility action, sets and returns new rand value.
virtual const ParticleChannelMask ChannelsUsed (const Interval &time) const =0
  See Init().
virtual const Interval  ActivityInterval () const =0
  Casting the FPValue->ptr parameter to Tab<Interface_ID>* as in PFExport void ChannelsUsed(...); an Action may have a time interval when the Action is active.
virtual PFExport IObject GetCurrentState (IObject *pContainer)
  Returns action state (see IPFActionState.h for details).
virtual PFExport void  SetCurrentState (IObject *actionState, IObject *pContainer)
  Sets the state of the action to the given state.
virtual int  NumPViewParamBlocks () const
virtual PFExport IParamBlock2 GetPViewParamBlock (int i) const
virtual ClassDesc GetClassDesc () const =0
PFExport void  RefreshUI (WPARAM message, IParamMap2 *map=NULL) const
PFExport void  UpdatePViewUI (ParamID updateID) const
IParamBlock2 pblock () const
const RandObjLinker randLinker () const
IParamBlock2 *&  _pblock ()
RandObjLinker _randLinker ()

Protected Member Functions

virtual PFExport void  SetReference (int i, RefTargetHandle rtarg)
  Stores a ReferenceTarget as its 'i-th' reference`.

Protected Attributes

IParamBlock2 m_pblock
RandObjLinker  m_randLinker

Constructor & Destructor Documentation

PFSimpleAction ( ) [inline]
                                       { ; }

Member Function Documentation

virtual PFExport 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().

Parameters:
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.

virtual PFExport RefResult NotifyRefChanged ( Interval  changeInt,
RefTargetHandle  hTarget,
PartID partID,
RefMessage  message 
) [virtual]

Receives and responds to messages.

A plugin which makes references must implement a method to receive and respond to messages broadcast by its dependents. This is done by implementing NotifyRefChanged(). The plugin developer usually implements this method as a switch statement where each case is one of the messages the plugin needs to respond to. The Method StdNotifyRefChanged calls this, which can change the partID to new value. If it doesn't depend on the particular message& partID, it should return REF_DONTCARE.

  • For developer that need to update a dialog box with data about an object you reference note the following related to this method: This method may be called many times. For instance, say you have a dialog box that displays data about an object you reference. This method will get called many time during the drag operations on that object. If you updated the display every time you'd wind up with a lot of 'flicker' in the dialog box. Rather than updating the dialog box each time, you should just invalidate the window in response to the NotifyRefChanged() call. Then, as the user drags the mouse your window will still receive paint messages. If the scene is complex the user may have to pause (but not let up on the mouse) to allow the paint message to go through since they have a low priority. This is the way many windows in 3ds Max work.
Parameters:
changeInt - This is the interval of time over which the message is active. Currently, all plug-ins will receive FOREVER for this interval.
hTarget - This is the handle of the reference target the message was sent by. The reference maker uses this handle to know specifically which reference target sent the message.
partID - This contains information specific to the message passed in. Some messages don't use the partID at all. See the section List of Reference Messages for more information about the meaning of the partID for some common messages.
message - The message parameters passed into this method is the specific message which needs to be handled.
Returns:
The return value from this method is of type RefResult. This is usually REF_SUCCEED indicating the message was processed. Sometimes, the return value may be REF_STOP. This return value is used to stop the message from being propagated to the dependents of the item.

Implements ReferenceMaker.

virtual PFExport int RemapRefOnLoad ( int  iref ) [virtual]

Used to load old files with references.

Implement this if you have added or deleted references and are loading an old file that needs to have its references remapped. This method is used when you have modified a ReferenceMaker to add or delete references, and are loading old files. It gets called during the reference mapping process, after the Load() method is called. You determine what version is loading in the Load(), and store the version in a variable which you can look at in RemapRefOnLoad() to determine how to remap references. The default implementation of this method just returns the same value it is passed, so you don't need to implement it unless you have added or deleted references from your class. This method makes it a lot easier to load old files when the reference topology has changed.

Parameters:
iref - The input index of the reference.
Returns:
The output index of the reference.

Reimplemented from ReferenceMaker.

virtual PFExport IOResult Save ( ISave isave ) [virtual]

Called for saving data.

Called by the system to allow the plugin to save its data.

Parameters:
isave - This pointer may be used to call methods to write data to disk. See the section on Loading and Saving for an overview of the load/save process.
Returns:
The default implementation is return IO_OK.
  • IO_OK means the result was acceptable, with no errors.
  • IO_ERROR This should be returned if an error occurred.

Reimplemented from ReferenceMaker.

virtual PFExport IOResult Load ( ILoad iload ) [virtual]

Called for loading data.

Called by the system to allow the plug-in to load its data. See the section on Loading and Saving for an overview of the load - save process.

Parameters:
iload - This interface pointer may be used to call methods to read data from disk.
Returns:
The default implementation is return IO_OK.
  • IO_OK means the result was acceptable, with no errors.
  • IO_ERROR This should be returned if an error occurred.

Reimplemented from ReferenceMaker.

virtual CreateMouseCallBack* GetCreateMouseCallBack ( ) [inline, virtual]

This method allows the system to retrieve a callback object used in creating an object in the 3D viewports.

This method returns a pointer to an instance of a class derived from CreateMouseCallBack. This class has a method proc() which is where the programmer defines the user/mouse interaction during the object creation phase.

Returns:
A pointer to an instance of a class derived from CreateMouseCallBack.

Implements BaseObject.

{
virtual BOOL OKToChangeTopology ( MSTR modName ) [inline, virtual]

Implemented by the System.

This method is called to see if any modifiers down in the pipeline depend on topology. It sends the message REFMSG_IS_OK_TO_CHANGE_TOPOLOGY to see if any modifiers or objects down the pipeline depend on topology.

Parameters:
modName This parameter is set to the dependent modifier's name if there is an item that depends on topology.
Returns:
TRUE if it is okay to change the topology; FALSE if it is not okay to change the topology.

Reimplemented from BaseObject.

{
virtual void InitNodeName ( MSTR s ) [inline, virtual]

Implemented by the System.

Sets the default node name to "Helper".

Reimplemented from HelperObject.

{
virtual ObjectState Eval ( TimeValue  t ) [inline, virtual]

This method is called to evaluate the object and return the result as an ObjectState.

When the system has a pointer to an object it doesn't know if it's a procedural object or a derived object. So it calls Eval() on it and gets back an ObjectState. A derived object managed by the system may have to call Eval() on its input for example. A plug-in (like a procedural object) typically just returns itself. A plug-in that does not just return itself is the Morph Object (/MAXSDK/SAMPLES/OBJECTS/MORPHOBJ.CPP). This object uses a morph controller to compute a new object and fill in an ObjectState which it returns.

Parameters:
t Specifies the time to evaluate the object.
Returns:
The result of evaluating the object as an ObjectState.
Sample Code:
Typically this method is implemented as follows:
    { return ObjectState(this); }

Implements Object.

{
virtual void GetClassName ( MSTR s ) [inline, virtual]

Retrieves the name of the plugin class.

This name is usually used internally for debugging purposes. For Material plug-ins this method is used to put up the material "type" name in the Material Editor.

Parameters:
s Reference to a string filled in with the name of the plugin class

Reimplemented from ReferenceTarget.

{ return false; }
virtual Class_ID ClassID ( ) [inline, virtual]

Retrieves a constant that uniquely identifies the plugin class.

This method must return the unique ID for the plugin class. If two ClassIDs conflict, the system will only load the first conflicting one it finds. A program (gencid.exe) is provided to generate unique class id values.

Returns:
A class id that uniquely identifies a plugin class
See also:
Class ClassID, List of Class IDs.

Reimplemented from Animatable.

{ return false; }
virtual void BeginEditParams ( IObjParam ip,
ULONG  flags,
Animatable prev 
) [pure virtual]
Remarks:
This method is called by the system when the user may edit the item's (object, modifier, controller, etc.) parameters.
Parameters:
ip Interface pointer. The developer can use it to call methods such as AddRollupPage(). Note that this pointer is only valid between BeginEditParams() and EndEditParams(). It should not be used outside this interval.
flags Describe which branch of the command panel or dialog the item is being edited in. The following are possible values:

BEGIN_EDIT_CREATE
Indicates an item is being edited in the create branch.

BEGIN_EDIT_MOTION
Indicates a controller is being edited in the motion branch.

BEGIN_EDIT_HIERARCHY
Indicates a controller is being edited in the Pivot subtask of the hierarchy branch.

BEGIN_EDIT_IK
Indicates a controller is being edited in the IK subtask of the hierarchy branch.

BEGIN_EDIT_LINKINFO
Indicates a controller is being edited in the Link Info subtask of the hierarchy branch.

prev Pointer to an Animatable object. This parameter may be used in the motion and hierarchy branches of the command panel. This pointer allows a plug-in to look at the ClassID of the previous item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel, but simply update the values displayed in the UI fields. This prevents the UI from 'flickering' when the current item begins its edit. For example, if you are in the motion branch and are looking at an item's PRS controller values, and then select another item that is displayed with a PRS controller, the UI will not change - only the values displayed in the fields will change. If however you selected a target camera that has a lookat controller (not a PRS controller) the UI will change because a different set of parameters need to be displayed. Note that for items that are edited in the modifier branch this field can be ignored.

Reimplemented from Animatable.

virtual void EndEditParams ( IObjParam ip,
ULONG  flags,
Animatable next 
) [pure virtual]
Remarks:
This method is called when the user is finished editing an objects parameters. The system passes a flag into the EndEditParams() method to indicate if the rollup page should be removed. If this flag is TRUE, the plug-in must un-register the rollup page, and delete it from the panel.
Parameters:
ip An interface pointer. The developer may use the interface pointer to call methods such as DeleteRollupPage().

flags The following flag may be set:

END_EDIT_REMOVEUI
If TRUE, the item's user interface should be removed.

next Animatable pointer. Can be used in the motion and hierarchy branches of the command panel. It allows a plug-in to look at the ClassID of the next item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel. Note that for items that are edited in the modifier branch this field can be ignored.

Reimplemented from Animatable.

virtual RefTargetHandle Clone ( RemapDir remap ) [pure virtual]

This method is used by 3ds Max to clone an object.

See also:
CloneRefHierarchy(), class RemapDir This method is called by 3ds Max to have the plugin clone itself. The plug-in's implementation of this method should copy both the data structure and all the data residing in the data structure of this reference target. The plugin should clone all its references as well. Also, the plug-in's implementation of this method must call BaseClone(). In order for classes derived from this class to clone cleanly, the Clone method should just create the new instance, and then call an implementation of BaseClone that clones the references and copies any other necessary data. For example:
            class MyDerivedPlugin
                : public MyBasePlugin
            {
                const int MY_REFERENCE = 1;

                ReferenceTarget* Clone(RemapDir& remap)
                {
                    ReferenceTarget* result = new MyDerivedPlugin();
                    BaseClone(this, result, remap);
                    return result;
                }

                void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap)
                {
                    if (!to || !from || from == to)
                        return;    
                    MyBasePlugin::BaseClone(from, to, remap);
                    to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE)));
                }
            };

This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations

Note:
See the remarks in method BaseClone() below.
Parameters:
remap - A RemapDir instance used for remapping references during a Clone.
Returns:
A pointer to the cloned item.

Reimplemented from ReferenceTarget.

virtual MCHAR* GetObjectName ( ) [pure virtual]
Returns:
the name that will appear in the history browser (modifier stack).

Reimplemented from BaseObject.

virtual PFExport bool Init ( IObject pCont,
Object pSystem,
INode node,
Tab< Object * > &  actions,
Tab< INode * > &  actionNodes 
) [virtual]

Returns true if the operation has been proceeded successfully.

The method is called when the ActionList is established the first time, when there is a first particle that enters the ActionList and there is a need to proceed particles. /param pCont: particle container with particle data /param pSystem: the particle system that generates the particle stream; the same operator may get calls from different particle systems; if the result varies according to the particle system that generates particles, then this parameter is useful. /param pNode: INode of the particle system that generates the particles. /param actions: Tab<Object*> of Actions in the current ActionList. The stack will be used to proceed particles. The stack is mutable: an Action may change the stack (to remove or add some Actions) to fine-tune the order of execution or add some extra actions. The next parameter should sync with the mutation. /param actionNodes: Tab<INode*> of action nodes.

Implements IPFAction.

virtual PFExport bool Release ( IObject pCont ) [virtual]
virtual bool SupportRand ( ) const [inline, virtual]

An Action may carry some chaos/unpredictibility in its processing.

This method supports chaos randomness.

Implements IPFAction.

{ return 1; } // the paramBlock
virtual int GetRand ( ) [inline, virtual]

For chaos/unpredictibility action, gets rand value.

Implements IPFAction.

{ return 1; } // the paramBlock
virtual void SetRand ( int  seed ) [inline, virtual]

For chaos/unpredictibility action, sets rand value.

Implements IPFAction.

{ return 1; } // the paramBlock
virtual PFExport int NewRand ( ) [virtual]

For chaos/unpredictibility action, sets and returns new rand value.

Reimplemented from IPFAction.

virtual const ParticleChannelMask& ChannelsUsed ( const Interval time ) const [pure virtual]
virtual const Interval ActivityInterval ( ) const [pure virtual]

Casting the FPValue->ptr parameter to Tab<Interface_ID>* as in PFExport void ChannelsUsed(...); an Action may have a time interval when the Action is active.

Outside this interval the Action does nothing, therefore there is no need to proceed particles outside the activity interval.

Implements IPFAction.

virtual PFExport IObject* GetCurrentState ( IObject pContainer ) [virtual]

Returns action state (see IPFActionState.h for details).

You have to delete the IObject by DeleteIObject method when the state is no longer needed.

Reimplemented from IPFAction.

virtual PFExport void SetCurrentState ( IObject actionState,
IObject pContainer 
) [virtual]

Sets the state of the action to the given state.

Reimplemented from IPFAction.

virtual int NumPViewParamBlocks ( ) const [inline, virtual]

Implements IPViewItem.

:
        PFExport void RefreshUI(WPARAM message, IParamMap2* map=NULL) const;
virtual PFExport IParamBlock2* GetPViewParamBlock ( int  i ) const [virtual]
virtual ClassDesc* GetClassDesc ( ) const [pure virtual]
PFExport void RefreshUI ( WPARAM  message,
IParamMap2 map = NULL 
) const
PFExport void UpdatePViewUI ( ParamID  updateID ) const
IParamBlock2* pblock ( ) const [inline]
:
        // parameters
const RandObjLinker& randLinker ( ) const [inline]
:
        // parameters
IParamBlock2*& _pblock ( ) [inline]
RandObjLinker& _randLinker ( ) [inline]

Member Data Documentation

IParamBlock2* m_pblock [protected]

PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction
PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction PFSimpleAction