3ds Max C++ API Reference
IGraphObjectManager Class Referenceabstract

Represents an instance of a schematic view window and provides methods for adding nodes and node pointers, refreshing the schematic view, accessing filter bits and updating and controlling the various editors within 3ds Max in ways that are not surfaced in the general interface. More...

#include <svcore.h>

+ Inheritance diagram for IGraphObjectManager:

Public Member Functions

virtual void PushLevel (Animatable *anim, int id=SV_NO_ID)=0
 Push a level onto the animatable ownership stack. More...
 
virtual void PopLevel ()=0
 Pops a level off the animatable ownership stack. More...
 
virtual SvGraphNodeReference AddAnimatable (Animatable *anim, Animatable *owner, int id, DWORD flags=0)=0
 Adds an Animatable to the schematic view. More...
 
virtual IGraphRefAddReference (IGraphNode *maker, IGraphNode *target, SvReferenceType type)=0
 This method adds a reference from the specified "maker" node to the specified "target" node. More...
 
virtual IGraphRefAddRelationship (IGraphNode *maker, Animatable *target, int id, SvRelationshipType type)=0
 This method adds a relationship from the specified "maker" node to the specified "target" node. More...
 
virtual void SvEditSelectedNodeProperties ()=0
 Pops up the property editor dialog on the selected nodes in the schematic view. More...
 
virtual void SvSelectInMaterialEditor (IGraphNode *gNode)=0
 Selects the given node in the material editor. More...
 
virtual void SvSetCurEditObject (IGraphNode *gNode)=0
 Selects the given node in the modifier panel. More...
 
virtual bool SvIsCurEditObject (IGraphNode *gNode)=0
 Returns true if the given node is current in the modifier panel. More...
 
virtual bool ApplyModifier (IGraphNode *gModNode, IGraphNode *gParentNode)=0
 
virtual bool DeleteModifier (IGraphNode *gNode)=0
 
virtual bool ApplyController (IGraphNode *gSrcNode, IGraphNode *gDestNode)=0
 Invokes the copy/instance controller dialog within schematic view. More...
 
virtual void SvInvalidateView ()=0
 Invalidates the schematic view window. More...
 
virtual void SvInvalidateNode (IGraphNode *gNode)=0
 Invalidates a node in the schematic view window. More...
 
virtual void SvUpdateMaterialEditor ()=0
 Forces the material editor to update. More...
 
virtual void SvUpdateModifierPanel ()=0
 Forces the modifier panel to update. More...
 
virtual void SetFilter (DWORD mask)=0
 Sets the specified filter bits. More...
 
virtual void ClearFilter (DWORD mask)=0
 Clears the specified filter bits. More...
 
virtual bool TestFilter (DWORD mask)=0
 Tets the specified filter bits. More...
 
virtual COLORREF SvGetUIColor (int colorIndex)=0
 Get a SV UI color given a color index. More...
 
virtual HWND GetHWnd ()=0
 Get HWnd for Schematic View window. More...
 

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

Represents an instance of a schematic view window and provides methods for adding nodes and node pointers, refreshing the schematic view, accessing filter bits and updating and controlling the various editors within 3ds Max in ways that are not surfaced in the general interface.


See also
IGraphNode, IGraphRef, Animatable

Member Function Documentation

◆ PushLevel()

virtual void PushLevel ( Animatable anim,
int  id = SV_NO_ID 
)
pure virtual

Push a level onto the animatable ownership stack.

During traversal of the Animatable graph via SvTraverseAnimGraph(), this method (along with PopLevel()) should be called appropriately to maintain an ownership stack. This is required by the schematic view when nodes are added to the graph with the SV_DUPLICATE_INSTANCES flag set. Note: In 3ds Max 3.0, SV_DUPLICATE_INSTANCES is always on (i.e., the flag is ignored). Because of this, PushLevel() and PopLevel() should always be called in SvTraverseAnimGraph(). See the sample code in Animatable::SvStdTraverseAnimGraph() for an example of this.

Parameters
animThis is the Animatable that you are, in all likelihood, about to add to the graph via the AddAnimatable() call.
id(default to SV_NO_ID) This is also the same "id" you'd pass into AddAnimatable(). The "id" is only required in cases where it's impossible for the schematic view to distinguish between two (or more) children in the tree that have the same Animatable but represent different sub-anims. For example, a box has both its width and height set to the same controller (instanced). In the schematic view, this is still shown in tree form so we need the ID to distinguish between the "width" and "height" children.

◆ PopLevel()

virtual void PopLevel ( )
pure virtual

Pops a level off the animatable ownership stack.

See also
PushLevel()

◆ AddAnimatable()

virtual SvGraphNodeReference AddAnimatable ( Animatable anim,
Animatable owner,
int  id,
DWORD  flags = 0 
)
pure virtual

Adds an Animatable to the schematic view.

Note that "owner" and "id" are actually arbitrary - they are used to provide context for this Animatable. This means that the plug-in developer can set them to any value. They are not used internally by the schematic view except in the "Sv*" methods (which the developer can override). So, when you add an Animatable to the schematic view, you would typically add the owner (parent) Animatable as well as the sub-anim id. This allows you to, for example, easily return the name of the object when queried by the SvGetName() call (whose default implementation is shown below):

MSTR Animatable::SvGetName(IGraphObjectManager *gom, IGraphNode *gNode, bool isBeingEdited)
{
Animatable *owner;
int subNum;
MSTR name;
owner = gNode->GetOwner();
subNum = gNode->GetID();
name = owner->SubAnimName(subNum);
return name;
}
Definition: Animatable.h:118
virtual MSTR SubAnimName(int i) MAX_SEALED
Definition: Animatable.h:650
virtual CoreExport MSTR SvGetName(IGraphObjectManager *gom, IGraphNode *gNode, bool isBeingEdited)
Represents a node in the schematic view graph and provides a few methods for querying information abo...
Definition: svcore.h:303
virtual int GetID()=0
Returns the ID of this node.
virtual Animatable * GetOwner()=0
Returns the "owner" of this node.
Represents an instance of a schematic view window and provides methods for adding nodes and node poin...
Definition: svcore.h:354
Definition: strclass.h:738
Parameters
animPoints to the animatable to add.
ownerPoints to the owner of "anim" above (typically).
idWhen nodes are added to the schematic view via this method this integer is provided. This value is not used internally by the schematic view. Rather, it is available to implementers of the Animatable::Sv*() methods to aid in identifying the node.
flagsThis flag is some combination of the bit flags in Flags for AddAnimatable() and SvTravereseAnimGraph()
Returns
A SvGraphNodeReference object.

◆ AddReference()

virtual IGraphRef* AddReference ( IGraphNode maker,
IGraphNode target,
SvReferenceType  type 
)
pure virtual

This method adds a reference from the specified "maker" node to the specified "target" node.

Parameters
makerPoints to the 'maker' node in schematic view.
targetPoints to the 'target' node in schematic view.
typeOne of the following enum values:
  • REFTYPE_CHILD
  • REFTYPE_SUBANIM
  • REFTYPE_PLUGIN
Returns
A pointer to an IGraphRef object.
Sample Code:
{
int i;
SvGraphNodeReference childNodeRef;
//
// Test filter to see if "Controllers" are active.
// Bail out if they're off (being filtered out)...
//
//
// Push this level in the tree. Note that the sub-anim id is passed
// in here because it's possible that the same instance of this control
// may exist in multiple tracks of "owner".
//
gom->PushLevel(this, id);
//
// Some flags are set here pertaining to the control being added.
// Note that the flags are also propagated down the tree
// by passing them on to SubAnim(i)->SvTraverseAnimGraph(gom, this, i, flags);
// SV_DUPLICATE_INSTANCES tells the schematic view not to
// represent multiple instances with a single node. Instead they
// are represented by multiple nodes in the schematic view
// with the "triangle thingy" attached to the side to indicate
// shared instances. This flag is ignored in R3 because
// this mode of operation is globally enabled
// SV_INITIALLY_HIDDEN tells the schematic view that this
// control's node is to be initially displayed in the closed state.
// Note that this has no effect if the node already exists
// in the graph -- it only applies to newly added nodes.
//
//
// The control is added to the schematic view...
//
nodeRef = gom->AddAnimatable(this, owner, id, flags);
if (nodeRef.stat == SVT_PROCEED) {
//
// This control's sub-anims are iterated over...
//
for (i = 0; i < NumSubs(); i++) {
if (SubAnim(i)) {
//
// SvTraverseAnimGraph() is recursively called to add this sub-anim (and all its descendants) to the graph...
//
childNodeRef = SubAnim(i)->SvTraverseAnimGraph(gom, this, i, flags);
//
// Now a link (node pointer) is created in the schematic between the control (nodeRef.gNode) and its child sub-anim (childNodeRef.gNode)....
//
if (childNodeRef.stat != SVT_DO_NOT_PROCEED)
gom->AddReference(nodeRef.gNode, childNodeRef.gNode, REFTYPE_SUBANIM);
}
}
}
//
// The tree level is popped. Note: a PopLevel() call must always be paired with a PushLevel() call!
//
gom->PopLevel();
return nodeRef;
}
virtual CoreExport SvGraphNodeReference SvTraverseAnimGraph(IGraphObjectManager *gom, Animatable *object, int id, DWORD flags)
virtual bool TestFilter(DWORD mask)=0
Tets the specified filter bits.
virtual void PopLevel()=0
Pops a level off the animatable ownership stack.
virtual IGraphRef * AddReference(IGraphNode *maker, IGraphNode *target, SvReferenceType type)=0
This method adds a reference from the specified "maker" node to the specified "target" node.
virtual SvGraphNodeReference AddAnimatable(Animatable *anim, Animatable *owner, int id, DWORD flags=0)=0
Adds an Animatable to the schematic view.
virtual void PushLevel(Animatable *anim, int id=SV_NO_ID)=0
Push a level onto the animatable ownership stack.
A small container type class that associates graph nodes with traversal status.
Definition: svcore.h:332
SvTraverseStatus stat
The traversal status.
Definition: svcore.h:338
IGraphNode * gNode
Points to the interface for the node in the schematic view.
Definition: svcore.h:336
static const DWORD SV_DUPLICATE_INSTANCES
If set, shared instances of an animatable will produce multiple graph nodes in the schematic view ins...
Definition: svcore.h:125
static const DWORD SV_INITIALLY_HIDDEN
If set, newly created node will be in the hidden state.
Definition: svcore.h:121
static const DWORD SV_FILTER_CONTROLLERS
Show controllers.
Definition: svcore.h:54
@ SVT_PROCEED
The traversal should proceed.
Definition: svcore.h:15
@ SVT_DO_NOT_PROCEED
The traversal should not proceed.
Definition: svcore.h:17
@ REFTYPE_SUBANIM
Definition: svcore.h:24

◆ AddRelationship()

virtual IGraphRef* AddRelationship ( IGraphNode maker,
Animatable target,
int  id,
SvRelationshipType  type 
)
pure virtual

This method adds a relationship from the specified "maker" node to the specified "target" node.

Parameters
makerPoints to the 'maker' node in schematic view.
targetPoints to the 'target' node in schematic view.
idAn arbitrary ID that the Animatable can use later to identify itself.
typethe type of the relationship
Returns
A pointer to an IGraphRef object.

◆ SvEditSelectedNodeProperties()

virtual void SvEditSelectedNodeProperties ( )
pure virtual

Pops up the property editor dialog on the selected nodes in the schematic view.

◆ SvSelectInMaterialEditor()

virtual void SvSelectInMaterialEditor ( IGraphNode gNode)
pure virtual

Selects the given node in the material editor.

Does nothing if "gNode" does not represent a material or map.

Parameters
gNodePoints to the node in schematic view.

◆ SvSetCurEditObject()

virtual void SvSetCurEditObject ( IGraphNode gNode)
pure virtual

Selects the given node in the modifier panel.

Does nothing if "gNode" does not represent an object.

Parameters
gNodePoints to the node in schematic view.

◆ SvIsCurEditObject()

virtual bool SvIsCurEditObject ( IGraphNode gNode)
pure virtual

Returns true if the given node is current in the modifier panel.

◆ ApplyModifier()

virtual bool ApplyModifier ( IGraphNode gModNode,
IGraphNode gParentNode 
)
pure virtual

◆ DeleteModifier()

virtual bool DeleteModifier ( IGraphNode gNode)
pure virtual

◆ ApplyController()

virtual bool ApplyController ( IGraphNode gSrcNode,
IGraphNode gDestNode 
)
pure virtual

Invokes the copy/instance controller dialog within schematic view.

The controller referenced by gSrcNode will be either copied or instanced into gDestNode. This is typically called from within a link callback:

bool myControl::SvLinkChild(IGraphObjectManager *gom, IGraphNode *gNodeThis, IGraphNode *gNodeChild)
{
if( SvCanConcludeLink( gom, gNodeThis, gNodeChild ) )
return gom->ApplyController(gNodeChild, gNodeThis);
return false;
}
virtual bool ApplyController(IGraphNode *gSrcNode, IGraphNode *gDestNode)=0
Invokes the copy/instance controller dialog within schematic view.
Parameters
gSrcNodeThe node that supplies the Matrix3 controller to apply.
gDestNodeThe node to apply the controller to.
Returns
true if the controller is successfully applied, false if not.

◆ SvInvalidateView()

virtual void SvInvalidateView ( )
pure virtual

Invalidates the schematic view window.

◆ SvInvalidateNode()

virtual void SvInvalidateNode ( IGraphNode gNode)
pure virtual

Invalidates a node in the schematic view window.

Parameters
gNode- Points to the node in schematic view.

◆ SvUpdateMaterialEditor()

virtual void SvUpdateMaterialEditor ( )
pure virtual

Forces the material editor to update.

◆ SvUpdateModifierPanel()

virtual void SvUpdateModifierPanel ( )
pure virtual

Forces the modifier panel to update.

◆ SetFilter()

virtual void SetFilter ( DWORD  mask)
pure virtual

Sets the specified filter bits.

Parameters
maskSee Schematic View Filter bits

◆ ClearFilter()

virtual void ClearFilter ( DWORD  mask)
pure virtual

Clears the specified filter bits.

Parameters
maskSee Schematic View Filter bits

◆ TestFilter()

virtual bool TestFilter ( DWORD  mask)
pure virtual

Tets the specified filter bits.

Returns true if set; otherwise false.

Parameters
maskSee Schematic View Filter bits

◆ SvGetUIColor()

virtual COLORREF SvGetUIColor ( int  colorIndex)
pure virtual

Get a SV UI color given a color index.

◆ GetHWnd()

virtual HWND GetHWnd ( )
pure virtual

Get HWnd for Schematic View window.