3ds Max C++ API Reference
Loading...
Searching...
No Matches
AnimEnum Class Referenceabstract

A callback class for Animatable::EnumAnimTree(). More...

#include <AnimEnum.h>

+ Inheritance diagram for AnimEnum:

Public Member Functions

 AnimEnum (int s=SCOPE_OPEN, int deep=0, DWORD tv=0xffffffff)
 Constructor.
 
virtual ~AnimEnum ()
 Destructor.
 
void SetScope (int s)
 Implemented by the System.
 
int Scope ()
 Implemented by the System.
 
void IncDepth ()
 Implemented by the System.
 
void DecDepth ()
 Implemented by the System.
 
int Depth ()
 Implemented by the System.
 
DWORD TVBits ()
 
virtual int proc (Animatable *anim, Animatable *client, int subNum)=0
 This is a method called by EnumAnimTree().
 
virtual int node_subAnim_proc (Animatable *anim, Animatable *client, int subNum)
 This is a method called by EnumAnimTree().
 

Protected Attributes

int depth
 
int scope
 
DWORD tv
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

Detailed Description

A callback class for Animatable::EnumAnimTree().

This class automatically keeps track of the depth of the enumeration.

See also
class Animatable

Constructor & Destructor Documentation

◆ AnimEnum()

AnimEnum ( int  s = SCOPE_OPEN,
int  deep = 0,
DWORD  tv = 0xffffffff 
)
inline

Constructor.

Sets default scope and depth if specified.

46 {scope = s; depth = deep; this->tv = tv;}
int depth
Definition: AnimEnum.h:40
int scope
Definition: AnimEnum.h:41
DWORD tv
Definition: AnimEnum.h:42

◆ ~AnimEnum()

virtual ~AnimEnum ( )
inlinevirtual

Destructor.

48{;}

Member Function Documentation

◆ SetScope()

void SetScope ( int  s)
inline

Implemented by the System.



Sets the scope. See below for possible values.

Parameters
sSpecifies the scope to set. See below.
52{ scope = s; }

◆ Scope()

int Scope ( )
inline

Implemented by the System.



Returns the scope.

Returns
One or more of the following scope values:

SCOPE_DOCLOSED

Do closed animatables.

SCOPE_SUBANIM

Do the sub anims

SCOPE_CHILDREN

Do the node children

SCOPE_OPEN

Do all open animatables

Equal to (SCOPE_SUBANIM|SCOPE_CHILDREN)

SCOPE_ALL

Do all animatables.

Equal to (SCOPE_OPEN|SCOPE_DOCLOSED)
68{ return scope; }

◆ IncDepth()

void IncDepth ( )
inline

Implemented by the System.



Increments the depth count.

71{ depth++; }

◆ DecDepth()

void DecDepth ( )
inline

Implemented by the System.



Decrements the depth count.

74{ depth--; }

◆ Depth()

int Depth ( )
inline

Implemented by the System.



Returns the depth count.

77{ return depth; }

◆ TVBits()

DWORD TVBits ( )
inline
78{return tv;}

◆ proc()

virtual int proc ( Animatable anim,
Animatable client,
int  subNum 
)
pure virtual

This is a method called by EnumAnimTree().

If anim is an INode and client is not either an INode or the scene root pointer, node_subAnim_proc is called instead of this method.

Parameters
animThe sub anim.
clientThe client anim. This is the parent with a sub-anim of anim.
subNumThe index of the sub-anim that anim is to client. For example, if you were to call client->SubAnim(subNum) it would return anim. The exception to this is the handling of the scene node hierarchy. In this case anim would be an INode and client would be either its parent INode or the scene root pointer, and subNum would be the child index.
Returns
One of the following values:

ANIM_ENUM_PROCEED

Continue the enumeration process.

ANIM_ENUM_STOP

Stop the enumeration process at this level.

ANIM_ENUM_ABORT

Abort the enumeration processing.

Implemented in ClearAnimFlagEnumProc.

◆ node_subAnim_proc()

virtual int node_subAnim_proc ( Animatable anim,
Animatable client,
int  subNum 
)
inlinevirtual

This is a method called by EnumAnimTree().

Normally, if anim is an INode then client would be either its parent INode or the scene root pointer. However it is possible that an Animatable can return an INode as a sub-anim. In the event that client is a sub-anim somewhere under a node, and anim is a parent node of that node, the potential for infinite recursion exists since continuing enumeration into that parent node will result in returning to this point. Calling proc and then stopping enumeration at this level would result in the method implementation flagging the node as visited. If the method implementation returns ENUM_STOP if it is passed an anim that has been previously visited, and the node is processed again as the node hierarchy is enumerated, ENUM_STOP would be returned resulting in its sub-anims not being visited. Due to this issue, if anim is an INode and client is not either an INode or the scene root pointer, this method is called instead of proc The default implementation for this method is to just return ANIM_ENUM_STOP. An implementation of this method should account for the potential for recursion. A sample scene to test implementations against can be created by running the following script.

plugin helper testNodeSubAnim
classID:#(5432156,5432110)
extends:Point
(
parameters main
(
thenode type:#node subanim:true
)
)
s = sphere pos:[50,50,0]
testNode = testNodeSubAnim parent:s
testNode.thenode = s
controller mat max min numsubs x z controller keys x z pos
Definition: generics.inl:208
MAXClass sphere
Parameters
animThe sub anim.
clientThe client anim. This is the parent with a sub-anim of anim.
subNumThe index of the sub-anim that anim is to client. For example, if you were to call client->SubAnim(subNum) it would return anim.
Returns
One of the following values:

ANIM_ENUM_PROCEED

Continue the enumeration process.

ANIM_ENUM_STOP

Stop the enumeration process at this level.

ANIM_ENUM_ABORT

Abort the enumeration processing.
145 {
146 UNUSED_PARAM(anim);
147 UNUSED_PARAM(client);
148 UNUSED_PARAM(subNum);
149 return ANIM_ENUM_STOP;
150 }
#define ANIM_ENUM_STOP
Don't do my children but keep going with the rest of the tree.
Definition: AnimEnum.h:27
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18

Member Data Documentation

◆ depth

int depth
protected

◆ scope

int scope
protected

◆ tv

DWORD tv
protected