-
首页
-
C4D R23.110 C++ SDK
#include <c4d_graphview.h>
详细描述
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
Additional Inherited Members
|
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)
|
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)
|
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
BaseList2D
*
|
Alloc
(
Int32
type)
|
static void
|
Free
(
BaseList2D
*&bl)
|
static const
Int32
|
SETBIT_FLAG_NODIRTY
|
static const
Int32
|
SETBIT_FLAG_REMOVE
|
构造函数 & 析构函数文档编制
◆
GvNodeMaster()
◆
~GvNodeMaster()
成员函数文档编制
◆
AllocNode()
Allocates a GV node without inserting it. Use
FreeNode()
to free the node.
-
注意
-
It is recommended to use
CreateNode()
instead.
-
参数
-
-
返回
-
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()
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()
Retrieves the root node.
-
返回
-
The root node. The master owns the pointed node.
◆
GetOwner()
Retrieves the owner of the node master.
-
返回
-
The owner.
Cinema 4D
owns the pointed owner.
◆
IsConnectionValid()
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()
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()
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()
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()
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()
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()
Starts a calculation.
-
参数
-
[in]
|
cpu_id
|
The CPU ID. Normally
0
.
|
-
返回
-
The result of the calculation.
◆
Recalculate()
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()
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()
类似
GeListNode::GetBranchInfo()
.
◆
GetRun()
Retrieves the current run helper.
-
返回
-
The run helper. The caller owns the pointed
GvRun
.
◆
GetCalc()
Retrieves the current calculation helper.
-
返回
-
The calculation helper. The caller owns the pointed
GvRun
.
◆
IsEnabled()
Returns the inverse of
GetRoot()
->GetDisabledState(), or
false
if there is no root.
-
返回
-
true
if the node master is enabled, otherwise
false
.
◆
AllocQuery()
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()
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()
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()
Sets the user data pointer.
-
参数
-
[in]
|
id
|
The user data ID.
|
[in]
|
data
|
The new user data.
|
◆
GetUserData()
Retrieves the user data pointer.
-
参数
-
[in]
|
id
|
The user data ID.
|
-
返回
-
The user data pointer.
◆
AllocCalculationTable()
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()
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()
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()
Sets the preferences for the node master.
-
参数
-
◆
GetPrefs()
Gets the preferences for the node master.
-
参数
-
[out]
|
bc
|
Filled with the current preferences. Use these container IDs:
GvMasterConfigIDs
|
◆
AddUndo()
Adds changes made in the node master to the undo list.
-
返回
-
true
if successful, otherwise
false
.
◆
Execute2()
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.