GvNodeMaster Class Reference Graph View

#include <c4d_graphview.h>

Inheritance diagram for GvNodeMaster:

详细描述

The GV node master class handles a collection of GV nodes and calculates them.
Normally you do not need to create it yourself, but this can be done with GvWorld::AllocNodeMaster() and GvWorld::FreeNodeMaster() .
The node master sends these message to its parent: GvMessage

私有成员函数

  GvNodeMaster ()
  ~GvNodeMaster ()

Alloc/Free/Create

GvNode AllocNode ( Int32 id)
void  FreeNode ( GvNode *&node)
GvNode CreateNode ( GvNode *parent, Int32 id, GvNode *insert=nullptr, Int32 x=-1, Int32 y=-1)

杂项

GvNode GetRoot (void)
BaseList2D GetOwner (void)
Bool   IsConnectionValid ( GvNode *source_node, GvPort *source_port, GvNode *dest_node, GvPort *dest_port, GvNode *&source_node_out, GvPort *&source_port_out, GvNode *&dest_node_out, GvPort *&dest_port_out)
Int32   GetBranchInfo ( BranchInfo *info, Int32 max, GETBRANCHINFO flags)
GvRun GetRun (void)
GvCalc GetCalc (void)
Bool   IsEnabled (void)

Insert/Hierarchy Node

Bool   InsertFirst ( GvNode *parent, GvNode *node)
Bool   InsertLast ( GvNode *parent, GvNode *node)
Bool   SetHierarchy ( GvNode *insert, GvNode *node, GvInsertMode mode= GV_INSERT_AFTER )

Calculation

GvCalcError   QueryCalculation ( GvQuery *query, BaseThread *thread)
GvCalcError   InitCalculation ( GvInit *init, BaseThread *thread)
GvCalcError   Calculate ( Int32 cpu_id)
GvCalcError   Recalculate ( GvNodeMaster *master, GvNode *node, Int32 cpu_id)
void  FreeCalculation (void)
GvCalcError   Execute ( BaseThread *thread)

Query

GvQuery AllocQuery (void)
void  FreeQuery ( GvQuery *&query)

Init

GvInit AllocInit (void)
void  FreeInit ( GvInit *&init)

用户数据

GvUserDataID   RegisterUserData (void *data=nullptr)
void  SetUserData ( GvUserDataID id, void *data)
void *  GetUserData ( GvUserDataID id)

Calculation Table

GvCalcTable AllocCalculationTable ( Int32 cpu_count, Bool sort=true, Int32 nr_of_preallocated_entries=16, Bool iteration=false)
void  FreeCalculationTable ( GvCalcTable *&table)

Draw List

Bool   AddToDrawList ( GvNode *bn, void **data=nullptr, Int32 data_size=0)

Copy Buffer

GvCopyBuffer *  GetCopyBuffer ( GvNode *first=nullptr, Bool copy_selected=true)
void  FreeCopyBuffer (GvCopyBuffer *&buffer)
Bool   PasteFromBuffer (GvCopyBuffer &buffer, GvInsertMode mode= GV_INSERT_UNDER , GvNode *dest=nullptr, Int32 x=( LIMIT < Int32 >:: MAX ), Int32 y=( LIMIT < Int32 >:: MAX ), Bool center=false, void *info=nullptr)

首选项

void  SetPrefs (const BaseContainer &bc)
void  GetPrefs ( BaseContainer &bc)

Undo

Bool   AddUndo (void)

Execute2

GvCalcError   Execute2 ( BaseThread *thread, GvCalcFlags flags)

Additional Inherited Members

-  Public Member Functions inherited from BaseList2D
const Char GetViewportRenderId ( VIEWPORT_RENDER_ID typeId) const
BaseList2D GetNext ()
BaseList2D GetPred ()
void  SetBit ( Int32 mask)
Bool   GetBit ( Int32 mask) const
void  DelBit ( Int32 mask)
void  ToggleBit ( Int32 mask)
Int32   GetAllBits () const
void  SetAllBits ( Int32 bits)
void  SetBitEx ( Int32 mask, Int32 flags)
BaseContainer   GetData ()
void  SetData (const BaseContainer &bc, Bool add=true)
const BaseContainer GetDataInstance () const
BaseContainer GetDataInstance ()
const BaseContainer GetDataInstanceRef () const
BaseContainer GetDataInstanceRef ()
String   GetName () const
void  SetName (const maxon::String &name)
String   GetBubbleHelp ()
Bool   TransferGoal ( BaseList2D *dst, Bool undolink)
Bool   TransferMarker ( BaseList2D *dst) const
Bool   比例 ( Float scale)
Bool   编辑 ()
void  GetIcon ( IconData *dat)
GeListHead GetNLARoot ()
BaseList2D AnimationLayerRemap ( BaseObject **layer=nullptr)
String   GetTypeName ()
BaseList2D GetMain () const
void  InsertTrackSorted ( CTrack *track)
Bool   AddEventNotification ( BaseList2D *bl, NOTIFY_EVENT eventid, NOTIFY_EVENT_FLAG flags, const BaseContainer *data)
Bool   RemoveEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   FindEventNotification ( BaseDocument *doc, BaseList2D *bl, NOTIFY_EVENT eventid)
Bool   SetDescIDState (const DescID &id, DESCIDSTATE descidstate)
DESCIDSTATE   GetDescIDState (const DescID &id, Bool tolerant) const
GeListHead GetOverrideRoot ()
BaseOverride GetFirstOverride ()
GeListHead GetShaderRepositoryRoot ()
GeListHead GetHiddenShaderRoot ()
maxon::NimbusInterface *  GetNimbusRef (const maxon::Id &spaceId) const
maxon::Result < maxon::NimbusInterface * >  GetOrCreateNimbusRef (const maxon::Id &spaceId)
void  RemoveNimbusRef (const maxon::Id &spaceId)
maxon::Result < maxon::HashMap < maxon::Id , maxon::ForwardRef < maxon::NimbusRef > > >  GetAllNimbusRefs () const
Bool   IsNodeBased () const
void  GetMarkerStampEx ( UInt32 *l1, UInt32 *l2)
const GeMarker GetMarker () const
void  SetMarker (const GeMarker &m)
Bool   AddUniqueID ( Int32 appid, const Char *const mem, Int bytes)
Bool   FindUniqueID ( Int32 appid, const Char *&mem, Int &bytes) const
Int32   GetUniqueIDCount () const
Bool   GetUniqueIDIndex ( Int32 idx, Int32 &id, const Char *&mem, Int &bytes) const
Bool   SetAnimatedParameter ( CTrack *track, const DescID &id, const GeData &t_data1, const GeData &t_data2, Float mix, DESCFLAGS_SET flags)
Bool   GetAnimatedParameter (const DescID &id, GeData &t_data1, GeData &t_data2, Float &mix, DESCFLAGS_GET flags)
BaseShader GetFirstShader () const
void  InsertShader ( BaseShader *shader, BaseShader *pred=nullptr)
void  ClearKeyframeSelection ()
Bool   FindKeyframeSelection (const DescID &id)
Bool   SetKeyframeSelection (const DescID &id, Bool selection)
Bool   KeyframeSelectionContent ()
LayerObject GetLayerObject ( BaseDocument *doc)
Bool   SetLayerObject ( LayerObject *layer)
const LayerData GetLayerData ( BaseDocument *doc, Bool rawdata=false)
Bool   SetLayerData ( BaseDocument *doc, const LayerData &data)
GeListHead GetCTrackRoot ()
CTrack GetFirstCTrack ()
CTrack FindCTrack (const DescID &id)
-  Public Member Functions inherited from GeListNode
GeListNode GetNext ()
GeListNode GetPred ()
GeListNode GetDown ()
GeListNode GetUp ()
GeListNode GetDownLast ()
void  InsertBefore ( GeListNode *bl)
void  InsertAfter ( GeListNode *bl)
void  InsertUnder ( GeListNode *bl)
void  InsertUnderLast ( GeListNode *bl)
void  移除 ()
GeListHead GetListHead ()
Int32   GetNodeID ( Int32 index=0) const
template<typename CAST >
const CAST *  GetNodeData ( Int32 index=0) const
template<typename CAST >
CAST *  GetNodeData ( Int32 index=0)
void  SetCustomData ( GeListNode *node)
GeListNode GetCustomData ()
BaseDocument GetDocument ()
Int32   GetBranchInfo ( BranchInfo *info, Int32 max, GETBRANCHINFO flags)
Bool   IsDocumentRelated ()
Int32   GetInfo ()
Bool   GetNBit ( NBIT bit) const
UInt32   GetNBitMask ( Int32 index) const
Bool   ChangeNBit ( NBIT bit, NBITCONTROL bitmode)
-  Public Member Functions inherited from C4DAtom
Int32   GetType () const
Int32   GetRealType () const
Int32   GetDiskType () const
Bool   IsInstanceOf ( Int32 id) const
Int32   GetClassification () const
Bool   消息 ( Int32 type, void *data=nullptr)
Bool   MultiMessage ( MULTIMSG_ROUTE flags, Int32 type, void *data)
C4DAtom GetClone ( COPYFLAGS flags, AliasTrans *trn)
Bool   CopyTo ( C4DAtom *dst, COPYFLAGS flags, AliasTrans *trn)
Bool   读取 ( HyperFile *hf, Int32 id, Int32 level)
Bool   Write ( HyperFile *hf)
Bool   ReadObject ( HyperFile *hf, Bool readheader)
Bool   WriteObject ( HyperFile *hf)
Bool   GetDescription ( 描述 *description, DESCFLAGS_DESC flags)
Bool   GetParameter (const DescID &id, GeData &t_data, DESCFLAGS_GET flags)
Bool   SetParameter (const DescID &id, const GeData &t_data, DESCFLAGS_SET flags)
DynamicDescription GetDynamicDescription ()
Bool   GetEnabling (const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
Bool   TranslateDescID (const DescID &id, DescID &res_id, C4DAtom *&res_at)
UInt32   GetDirty ( DIRTYFLAGS flags) const
void  SetDirty ( DIRTYFLAGS flags)
UInt32   GetHDirty ( HDIRTYFLAGS mask) const
void  SetHDirty ( HDIRTYFLAGS mask)
-  Static Public Member Functions inherited from BaseList2D
static BaseList2D Alloc ( Int32 type)
static void  Free ( BaseList2D *&bl)
-  Static Public Attributes inherited from BaseList2D
static const Int32   SETBIT_FLAG_NODIRTY
static const Int32   SETBIT_FLAG_REMOVE

构造函数 & 析构函数文档编制

◆  GvNodeMaster()

GvNodeMaster () private

◆  ~GvNodeMaster()

~ GvNodeMaster () private

成员函数文档编制

◆  AllocNode()

GvNode * AllocNode ( Int32   id )

Allocates a GV node without inserting it. Use FreeNode() to free the node.

注意
It is recommended to use CreateNode() instead.
参数
[in] id The GV node ID, for example ID_OPERATOR_OBJECT or a custom ID.
返回
The allocated GV node, or nullptr . The caller owns the pointed node.

◆  FreeNode()

void FreeNode ( GvNode *&  node )

Frees GV nodes allocated with AllocNode() .

参数
[in,out] node The GV node to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  CreateNode()

GvNode * CreateNode ( GvNode parent ,
Int32   id ,
GvNode insert = nullptr ,
Int32   x = -1 ,
Int32   y = -1  
)

Creates a node and inserts it.

参数
[in] parent The parent node. GetRoot() to insert a top node.
[in] id The GV node ID, for example ID_OPERATOR_OBJECT or a custom ID.
[in] insert The insertion point.
[in] x The X position.
[in] y The Y position.
返回
The created GV node, or nullptr . The master owns the pointed node.

◆  GetRoot()

GvNode * GetRoot ( void  )

Retrieves the root node.

返回
The root node. The master owns the pointed node.

◆  GetOwner()

BaseList2D * GetOwner ( void  )

Retrieves the owner of the node master.

返回
The owner. Cinema 4D owns the pointed owner.

◆  IsConnectionValid()

Bool IsConnectionValid ( GvNode source_node ,
GvPort source_port ,
GvNode dest_node ,
GvPort dest_port ,
GvNode *&  source_node_out ,
GvPort *&  source_port_out ,
GvNode *&  dest_node_out ,
GvPort *&  dest_port_out  
)

Has to be called to make sure that the connection is valid before attempting a GvNode::AddConnection() .

注意
Swaps the nodes and the ports to ensure that always source is the output and dest the input. Use the _out parameters with GvNode::AddConnection() if the connection is allowed.
参数
[in] source_node The source node input. The caller owns the pointed node.
[in] source_port The source port input. The caller owns the pointed node.
[in] dest_node The destination node input. The caller owns the pointed node.
[in] dest_port The destination port input. The caller owns the pointed node.
[in] source_node_out The source node output. The caller owns the pointed node.
[in] source_port_out The source port output. The caller owns the pointed node.
[in] dest_node_out The destination node output. The caller owns the pointed node.
[in] dest_port_out The destination port output. The caller owns the pointed node.
返回
true if the connection is allowed, otherwise false .

◆  InsertFirst()

Bool InsertFirst ( GvNode parent ,
GvNode node  
)

Inserts a node first in the node list of an Xgroup .

注意
Equivalent to GeListNode::InsertUnder() , but with additional checks that parent is a group node, and that node is removed.
参数
[in] parent The parent GV node. Must be a group node owned by the node master.
[in] node The GV node to insert. The master takes over the ownership of the pointed node.
返回
true if the node was inserted, otherwise false .

◆  InsertLast()

Bool InsertLast ( GvNode parent ,
GvNode node  
)

Inserts a node last in the node list of an Xgroup .

注意
Equivalent to GeListNode::InsertUnderLast() , but with additional checks that parent is a group node, and that node is removed.
参数
[in] parent The parent GV node. Must be a group node owned by the node master.
[in] node The GV node to insert. The master takes over the ownership of the pointed node.
返回
true if the node was inserted, otherwise false .

◆  SetHierarchy()

Bool SetHierarchy ( GvNode insert ,
GvNode node ,
GvInsertMode   mode = GV_INSERT_AFTER  
)

Performs a hierarchy operation.

注意
Equivalent to the standard GeListNode calls, but with additional checks.
参数
[in] insert The insertion point. Must be owned by the node master.
[in] node The GV node to perform the operation on. The master takes over the ownership of the pointed object.
[in] mode The insertion mode: GvInsertMode
返回
true if the hierarchy was set, otherwise false .

◆  QueryCalculation()

GvCalcError QueryCalculation ( GvQuery query ,
BaseThread thread  
)

Checks if it is OK to begin a calculation.

参数
[in] query The GV query object. The caller owns the pointed GvQuery .
[in] thread The thread to use for break checks. The caller owns the pointed thread.
返回
The result of the check.

◆  InitCalculation()

GvCalcError InitCalculation ( GvInit init ,
BaseThread thread  
)

Tells the nodes to allocate resources for a calculation. Must be called before Calculate() . Call FreeCalculation() afterwards.

参数
[in] init The GV init object. The caller owns the pointed GvInit .
[in] thread The thread to use for break checks. The caller owns the pointed thread.
返回
The result of the initialization.

◆  Calculate()

GvCalcError Calculate ( Int32   cpu_id )

Starts a calculation.

参数
[in] cpu_id The CPU ID. Normally 0 .
返回
The result of the calculation.

◆  Recalculate()

GvCalcError Recalculate ( GvNodeMaster master ,
GvNode node ,
Int32   cpu_id  
)

Sets all operators' ports connected to the output ports of node to invalid, to enable an iterator loop path.

参数
[in] master Not used. The method always uses the this pointer instead.
[in] node The GV node to recalculate. The caller owns the pointed node.
[in] cpu_id The CPU ID. Normally 0 .
返回
The result of the recalculation.

◆  FreeCalculation()

void FreeCalculation ( void  )

Frees resources allocated by the GV nodes for calculation.

◆  Execute()

GvCalcError Execute ( BaseThread thread )

Equivalent to calling QueryCalculation() , InitCalculation() , Calculate() and FreeCalculation() with some error checks.

注意
This is the recommended way to execute XPresso. Use Execute2() to pass flags for the execution.
参数
[in] thread The thread to use for break checks. The caller owns the pointed thread.
返回
The result of the execution.

◆  GetBranchInfo()

Int32 GetBranchInfo ( BranchInfo info ,
Int32   max ,
GETBRANCHINFO   flags  
)

类似 GeListNode::GetBranchInfo() .

◆  GetRun()

GvRun * GetRun ( void  )

Retrieves the current run helper.

返回
The run helper. The caller owns the pointed GvRun .

◆  GetCalc()

GvCalc * GetCalc ( void  )

Retrieves the current calculation helper.

返回
The calculation helper. The caller owns the pointed GvRun .

◆  IsEnabled()

Bool IsEnabled ( void  )

Returns the inverse of GetRoot() ->GetDisabledState(), or false if there is no root.

返回
true if the node master is enabled, otherwise false .

◆  AllocQuery()

GvQuery * AllocQuery ( void  )

Allocates a GV query object. Must be freed with FreeQuery() .

返回
The allocated query object. The caller owns the pointed GvQuery .

◆  FreeQuery()

void FreeQuery ( GvQuery *&  query )

Frees GV query objects allocated with AllocQuery() .

参数
[in,out] query The query object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  AllocInit()

GvInit * AllocInit ( void  )

Allocates a GV init object. Must be freed with FreeInit() .

返回
The allocated GV init object. The caller owns the pointed GvInit .

◆  FreeInit()

void FreeInit ( GvInit *&  init )

Frees GV init objects allocated with AllocInit() .

参数
[in,out] init The GV init object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  RegisterUserData()

GvUserDataID RegisterUserData ( void *  data = nullptr )

Registers a user data pointer with the node master. The user data pointers are only stored for the current session.

参数
[in] data The initial value of the user data.
返回
The ID of the registered pointer.

◆  SetUserData()

void SetUserData ( GvUserDataID   id ,
void *  data  
)

Sets the user data pointer.

参数
[in] id The user data ID.
[in] data The new user data.

◆  GetUserData()

void* GetUserData ( GvUserDataID   id )

Retrieves the user data pointer.

参数
[in] id The user data ID.
返回
The user data pointer.

◆  AllocCalculationTable()

GvCalcTable * AllocCalculationTable ( Int32   cpu_count ,
Bool   sort = true ,
Int32   nr_of_preallocated_entries = 16 ,
Bool   iteration = false  
)

Allocates an allocation table. The allocated table must be freed with FreeCalculationTable() .

参数
[in] cpu_count The CPU count. Normally 1 .
[in] sort true the table is sorted to reflect the hierarchy.
[in] nr_of_preallocated_entries The space is preallocated for this many entries. The table will still grow if necessary.
[in] iteration true if this is an iteration path.
返回
The allocated calculation table. The caller owns the pointed table.

◆  FreeCalculationTable()

void FreeCalculationTable ( GvCalcTable *&  table )

Frees calculation tables allocated with AllocCalculationTable() .

参数
[in] table The table to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  AddToDrawList()

Bool AddToDrawList ( GvNode bn ,
void **  data = nullptr ,
Int32   data_size = 0  
)

Adds a node the internal list of nodes that need GvOperatorData::SceneDraw() called during the next internal draw.

参数
[in] bn The node to add. The caller owns the pointed node.
[in] data This should either be nullptr or point to a data pointer.
The function allocates a memory block of data_size bytes and stores a pointer to it in data .
Store custom data in this memory block that GvOperatorData::SceneDraw() use.
The caller owns the pointed data. The node master owns the pointed data.
[in] data_size The size of data in bytes. Stored and passed to the draw list call.
返回
true if the node was added to the draw list, otherwise false .

◆  GetCopyBuffer()

GvCopyBuffer* GetCopyBuffer ( GvNode first = nullptr ,
Bool   copy_selected = true  
)

Allocates a copy buffer. Must be freed with FreeCopyBuffer() . Paste the buffer with PasteFromBuffer() .

参数
[in] first The optional first node of the hierarchy to be copied. The caller owns the pointed node.
[in] copy_selected true (default) the selected objects are copied.
返回
The allocated copy buffer. The caller owns the pointed buffer.

◆  FreeCopyBuffer()

void FreeCopyBuffer ( GvCopyBuffer *&  buffer )

Frees copy buffers allocated with GetCopyBuffer() .

参数
[in] buffer The buffer to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  PasteFromBuffer()

Bool PasteFromBuffer ( GvCopyBuffer &  buffer ,
GvInsertMode   mode = GV_INSERT_UNDER ,
GvNode dest = nullptr ,
Int32   x = (LIMIT<Int32>::MAX) ,
Int32   y = (LIMIT<Int32>::MAX) ,
Bool   center = false ,
void *  info = nullptr  
)

Pastes the contents of a copy buffer created with GetCopyBuffer() .

参数
[in] buffer The buffer to paste.
[in] mode The insert mode: GvInsertMode
[out] dest An optional destination node. The caller owns the pointed node.
[out] x An optional destination X coordinate.
[out] y An optional destination Y coordinate.
[in] center true the pasted nodes are centered.
[in] info Internal parameter. Must always be nullptr .
返回
true if successful, otherwise false .

◆  SetPrefs()

void SetPrefs ( const BaseContainer bc )

Sets the preferences for the node master.

参数
[in] bc The new preferences. Use these container IDs: GvMasterConfigIDs

◆  GetPrefs()

void GetPrefs ( BaseContainer bc )

Gets the preferences for the node master.

参数
[out] bc Filled with the current preferences. Use these container IDs: GvMasterConfigIDs

◆  AddUndo()

Bool AddUndo ( void  )

Adds changes made in the node master to the undo list.

返回
true if successful, otherwise false .

◆  Execute2()

GvCalcError Execute2 ( BaseThread thread ,
GvCalcFlags   flags  
)

Equivalent to Execute() but additional flags are used for the calculation.

参数
[in] thread The thread to use for break checks. The caller owns the pointed thread.
[in] flags The calculation flags: GvCalcFlags
返回
The result of the execution.