Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions

SimpleOSMToWSMObject Class Reference

Search for all occurrences

#include <simpobj.h>

Inheritance diagram for SimpleOSMToWSMObject:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport  SimpleOSMToWSMObject ()
CoreExport  SimpleOSMToWSMObject (SimpleMod *m)
int  NumRefs ()
  Returns the total number of references this ReferenceMaker can hold.
CoreExport RefTargetHandle  GetReference (int i)
  Returns the 'i-th' reference.
CoreExport IOResult  Load (ILoad *iload)
  Called for loading data.
int  NumSubs ()
CoreExport Animatable SubAnim (int i)
CoreExport MSTR  SubAnimName (int i)
CoreExport void  BuildMesh (TimeValue t)
CoreExport Modifier CreateWSMMod (INode *node)
  When the user binds a node to a space warp, a new modifier must be created and added to the node's WSM derived object.
CoreExport CreateMouseCallBack GetCreateMouseCallBack ()
  This method allows the system to retrieve a callback object used in creating an object in the 3D viewports.
CoreExport void  BeginEditParams (IObjParam *ip, ULONG flags, Animatable *prev)
CoreExport void  EndEditParams (IObjParam *ip, ULONG flags, Animatable *next)
CoreExport ParamDimension GetParameterDim (int pbIndex)
CoreExport MSTR  GetParameterName (int pbIndex)
CoreExport Deformer GetDecayDeformer (TimeValue t, Deformer &mdef, Point3 origin, Interval &iv)
CoreExport SimpleOSMToWSMObject SimpleOSMToWSMClone (SimpleOSMToWSMObject *from, RemapDir &remap)
CoreExport void  InvalidateUI ()

Public Attributes

SimpleMod mod

Static Public Attributes

static IParamMap pmapParam

Protected Member Functions

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

Constructor & Destructor Documentation

CoreExport SimpleOSMToWSMObject ( )
Remarks:
Constructor.
CoreExport SimpleOSMToWSMObject ( SimpleMod m )
Remarks:
Constructor.
Parameters:
SimpleMod *m

This is a pointer to the SimpleMod instance this WSM is based on.

Member Function Documentation

int NumRefs ( ) [inline, 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.

Returns:
The total number of references this plugin can hold. The default implementation is return 0.

Reimplemented from SimpleWSMObject.

{return 2;}
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.

Parameters:
i - The index of the reference to retrieve. Valid values are from 0 to NumRefs()-1.
Returns:
The reference handle of the 'i-th' reference. Note that different calls to this method with the same 'i' value can result in different reference handles being retrieved, as the plugin changes the scene objects it references as its 'i-th' reference.

Reimplemented from SimpleWSMObject.

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

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 SimpleWSMObject.

CoreExport 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.

int NumSubs ( ) [inline, virtual]
Remarks:
The system uses a virtual array mechanism to access the sub-anims of a plug-in. This method returns the total number of sub-anims maintained by the plug-in. If a plug-in is using a parameter block to manage its parameters it should just return 1 for all the parameters directed by the parameter block.
Returns:
The number of sub-anims used by the plug-in.
Default Implementation:
{ return 0; }

Reimplemented from SimpleWSMObject.

{return 2;}  
CoreExport Animatable* SubAnim ( int  i ) [virtual]
Remarks:
This method returns a pointer to the 'i-th' sub-anim. If a plug-in is using a parameter block to manage all its parameters it should just return a pointer to the parameter block itself from this method. This method may return NULL so developers need to check the return value before calling other sub anim methods (such as SubAnimName()).
Parameters:
i This is the index of the sub-anim to return.
Default Implementation:
{ return NULL };

Reimplemented from SimpleWSMObject.

CoreExport MSTR SubAnimName ( int  i ) [virtual]
Remarks:
This method returns the name of the 'i-th' sub-anim to appear in track view. The system has no idea what name to assign to the sub-anim (it only knows it by the virtual array index), so this method is called to retrieve the name to display. Developer need to make sure the 'i-th' SubAnim() is non-NULL or this method will fail.
Parameters:
i The index of the parameter name to return
Returns:
The name of the 'i-th' parameter.

Reimplemented from SimpleWSMObject.

CoreExport void BuildMesh ( TimeValue  t ) [virtual]
Remarks:
This method is called to build the mesh representation of the object using its parameter settings at the time passed.
Parameters:
TimeValue t

The time at which to build the mesh.

Implements SimpleWSMObject.

CoreExport Modifier* CreateWSMMod ( INode node ) [virtual]

When the user binds a node to a space warp, a new modifier must be created and added to the node's WSM derived object.

This method creates the new modifier.

Parameters:
node The node of the WSMObject.
Returns:
A pointer to the new modifier.

Implements WSMObject.

CoreExport CreateMouseCallBack* GetCreateMouseCallBack ( ) [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.

CoreExport void BeginEditParams ( IObjParam ip,
ULONG  flags,
Animatable prev 
) [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 SimpleWSMObject.

CoreExport void EndEditParams ( IObjParam ip,
ULONG  flags,
Animatable next 
) [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 SimpleWSMObject.

CoreExport ParamDimension* GetParameterDim ( int  pbIndex ) [inline, virtual]
Remarks:
This method returns the parameter dimension of the parameter whose index is passed.
Parameters:
int pbIndex

The index of the parameter to return the dimension of.
Returns:
Pointer to a ParamDimension.
Example:
return stdNormalizedDim;
Default Implementation:
The default implementation returns defaultDim.

See also:
ParamDimension

Reimplemented from SimpleWSMObject.

{return stdWorldDim;}
CoreExport MSTR GetParameterName ( int  pbIndex ) [virtual]
Remarks:
This method returns the name of the parameter whose index is passed.
Parameters:
int pbIndex

The index of the parameter to return the name of.
Returns:
The name of the parameter.
Default Implementation:
The default implementation returns MSTR(_M("Parameter"))

Reimplemented from SimpleWSMObject.

CoreExport Deformer& GetDecayDeformer ( TimeValue  t,
Deformer mdef,
Point3  origin,
Interval iv 
)
Remarks:
Implemented by the System.

This class enhances the deformation done by the object space modifier to include a decay parameter. This allows the deformation to decay over distance. This helper method is used internally in this.
CoreExport SimpleOSMToWSMObject* SimpleOSMToWSMClone ( SimpleOSMToWSMObject from,
RemapDir remap 
)
CoreExport void InvalidateUI ( ) [virtual]
Remarks:
This is called if the user interface parameters needs to be updated because the user moved to a new time. The UI controls must display values for the current time.
Example:
If the plug-in uses a parameter map for handling its UI, it may call a method of the parameter map to handle this: pmapParam->Invalidate();

If the plug-in does not use parameter maps, it should call the SetValue() method on each of its controls that display a value, for example the spinner controls. This will cause to the control to update the value displayed. The code below shows how this may be done for a spinner control. Note that ip and pblock are assumed to be initialized interface and parameter block pointers

(IObjParam *ip, IParamBlock *pblock).

float newval;

Interval valid=FOREVER;

TimeValue t=ip->GetTime();

// Get the value from the parameter block at the current time.

pblock->GetValue( PB_ANGLE, t, newval, valid );

// Set the value. Note that the notify argument is passed as FALSE.

// This ensures no messages are sent when the value changes.

angleSpin->SetValue( newval, FALSE );

Reimplemented from SimpleWSMObject.


Member Data Documentation


SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject
SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject SimpleOSMToWSMObject