-
首页
-
C4D R23.110 C++ SDK
#include <c4d_graphview.h>
详细描述
The GV world class. Cannot be instantiated. To retrieve the global instance call
GvGetWorld()
.
构造函数 & 析构函数文档编制
◆
GvWorld()
◆
~GvWorld()
成员函数文档编制
◆
AllocNodeMaster()
Allocates a node master. Must be freed with
FreeNodeMaster()
.
-
注意
-
This function is normally not needed. Use
XPressoTag::Alloc()
instead.
-
参数
-
[in]
|
object
|
The parent object for the node master. The caller owns the pointed object.
|
[in]
|
add_to_list
|
Add this master to the global list of masters. To have a private master, set this to
false
.
|
[in]
|
send_messages
|
若
true
messages are sent to object for example when nodes are added.
|
-
返回
-
The allocated node master. The caller owns the pointed node master.
◆
FreeNodeMaster()
Frees node masters allocated with
AllocNodeMaster()
.
-
参数
-
[in,out]
|
master
|
The node master to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
AllocNodeGUI()
GvNodeGUI
* AllocNodeGUI
|
(
|
GvShape *
|
shape
,
|
|
|
GvShape *
|
group
,
|
|
|
Int32
|
user_area_id
|
|
)
|
|
|
Allocates a node GUI. Must be freed with
FreeNodeGUI()
.
-
注意
-
This function is normally not needed.
-
参数
-
[in]
|
shape
|
The GV shape. The caller owns the pointed shape.
|
[in]
|
group
|
The group shape. The caller owns the pointed group shape.
|
[in]
|
user_area_id
|
The user area ID.
|
-
返回
-
The allocated node GUI. The caller owns the pointed node GUI.
◆
FreeNodeGUI()
Frees node GUIs allocated with
AllocNodeGUI()
.
-
参数
-
[in,out]
|
gui
|
The node GUI to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
AllocShape()
GvShape* AllocShape
|
(
|
void
|
|
)
|
|
Allocates a shape. Must be freed with
FreeShape()
.
-
注意
-
A shape defines the layout of the nodes and the click behavior. It is completely private, but maybe in future versions it will be possible to use different shapes.
-
返回
-
The allocated shape. The caller owns the pointed shape.
◆
AllocGroupShape()
GvShape* AllocGroupShape
|
(
|
void
|
|
)
|
|
Allocates a group shape. Must be freed with
FreeShape()
.
-
注意
-
A shape defines the layout of the nodes and the click behavior. It is completely private, but maybe in future versions it will be possible to use different shapes.
-
返回
-
The allocated group shape. The caller owns the pointed group shape.
◆
FreeShape()
void FreeShape
|
(
|
GvShape *&
|
shape
|
)
|
|
Frees shapes allocated with
AllocShape()
or
AllocGroupShape()
.
-
参数
-
[in,out]
|
shape
|
The shape to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
RegisterHook()
Bool
RegisterHook
|
(
|
const
GvHook
&
|
hook
,
|
|
|
void *
|
user
|
|
)
|
|
|
Registers a hook. See
GvHook
了解更多信息。
-
参数
-
[in]
|
hook
|
The hook to register.
|
[in]
|
user
|
The user data pointer for the hook. Passed to the hook functions. The caller owns the pointed data.
|
-
返回
-
true
if successful, otherwise
false
.
◆
AttachHook()
Attaches a callback to a hook. The callback function is evaluated with
GetHookInstance()
.
-
参数
-
[in]
|
hook_id
|
The hook ID.
|
[in]
|
callback
|
The callback to register.
|
-
返回
-
true
if successful, otherwise
false
.
◆
DetachHook()
void DetachHook
|
(
|
Int32
|
hook_id
|
)
|
|
Detaches a callback attached with
AttachHook()
. This makes
GetHookInstance()
return
nullptr
for
hook_id
.
-
参数
-
[in]
|
hook_id
|
The hook ID.
|
◆
GetHookInstance()
返回
(*callback)(
doc
,
hook_id
) for callbacks registered with
AttachHook()
.
-
参数
-
[in]
|
doc
|
The document. The caller owns the pointed document.
|
[in]
|
hook_id
|
The hook ID.
|
-
返回
-
The callback return, or
nullptr
if no callback was attached.
◆
SendHookMessage()
Sends a message to all hooks with the given
owner_id
set in
GvHook::owner_id
.
-
参数
-
[in]
|
doc
|
The document. The caller owns the pointed document.
|
[in]
|
master
|
The node master. The caller owns the pointed node master.
|
[in]
|
data
|
The message data.
|
[in]
|
owner_id
|
The owner ID.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SendOperatorMessage()
Sends a message to all nodes, i.e. calls
NodeData::Message()
for all
GvOperatorData
.
-
参数
-
[in]
|
doc
|
The document. The caller owns the pointed document.
|
[in]
|
message_id
|
The message ID.
|
[in]
|
data
|
The message data. The caller owns the pointed data.
|
-
返回
-
true
if successful, otherwise
false
.
◆
OpenDialog()
Opens the XPresso dialog for a specific node master.
-
参数
-
[in]
|
id
|
The plugin ID. See
GeDialog::Open()
.
|
[in]
|
master
|
The node master to open the dialog for. The caller owns the pointed node master.
|
-
返回
-
true
if the dialog was opened, otherwise
false
.
◆
CloseDialog()
void CloseDialog
|
(
|
Int32
|
id
|
)
|
|
Closes a dialog opened with
OpenDialog()
.
-
参数
-
[in]
|
id
|
The plugin ID that the dialog was opened with.
|
◆
RedrawAll()
Redraws all opened dialogs.
-
注意
-
Currently there can only be one dialog, so this is for future extensions.
◆
RedrawMaster()
Redraws a node master.
-
参数
-
[in]
|
master
|
The node master to redraw. The caller owns the pointed node master.
|
◆
AttachNode()
Attaches a node to a node master.
-
参数
-
[in]
|
master
|
The node master to attach the node to. The caller owns the pointed node master.
|
[in]
|
node
|
The node to attach. The caller owns the pointed node.
|
[in]
|
x
|
The X coordinate.
|
[in]
|
y
|
The Y coordinate.
|
-
返回
-
true
if the node was attached, otherwise
false
.
◆
GetString()
Opens a dialog where the user can enter a string value.
-
参数
-
[in]
|
title
|
The dialog title.
|
[in]
|
default_value
|
The default value.
|
-
返回
-
The string entered by the user.
◆
GetFloat()
Opens a dialog where the user can enter a float value.
-
参数
-
[in]
|
title
|
The dialog title.
|
[in]
|
default_value
|
The default value.
|
-
返回
-
The float entered by the user.
◆
GetInteger()
Opens a dialog where the user can enter an integer value.
-
参数
-
[in]
|
title
|
The dialog title.
|
[in]
|
default_value
|
The default value.
|
-
返回
-
The integer entered by the user.
◆
GetDataTypesMenu()
Fills
bc
with a menu description of all data types, suitable for e.g.
ShowPopupMenu()
.
The
index
container is a translation between the menu ID and the
GvDataID
of the data types.
Optionally the set of data types can be restricted to only those that allows a set of calculation
flags
.
-
参数
-
[in]
|
bc
|
Filled with the menu entries.
|
[in]
|
index
|
Filled with a translation table between menu ID and
GvDataID
.
|
[in]
|
first_menu_id
|
The first menu item ID. You can pass
FIRST_POPUP_ID
.
|
[in]
|
first_sub_id
|
The first sub menu item ID. Use something slightly larger than
first_menu_id
, for example
FIRST_POPUP_ID
+
1000
.
|
[in]
|
show_undefined_type
|
若
true
the data type "Undefined" is included where needed.
|
[in]
|
flags
|
If set, only data types that can handle these calculations are retrieved:
GvValueFlags
|
-
返回
-
The number of data types found.
◆
GetDataTypes()
Fills
bc
with a description of all data types, as
String
values with the name of the data type and an ID with the corresponding GvDataID.
Optionally the set of data types can be restricted to only those that allows a set of calculation
flags
.
-
参数
-
[in]
|
bc
|
Filled with the data types.
|
[in]
|
选项
|
The data options:
GvDataOptions
|
[in]
|
flags
|
If set, only data types that can handle these calculations are retrieved:
GvValueFlags
|
-
返回
-
The number of data types found.
◆
GetDataTypesTable()
Retrieves the complete data types table.
-
参数
-
[out]
|
info
|
Set to point to an array of length
count
with the currently registered data types. The GV world owns the pointed array.
|
[out]
|
count
|
Assigned the number of elements in the retrieved
info
table.
|
-
返回
-
true
if the table was retrieved, otherwise
false
.
◆
GetDataTypeIndex()
Gets the index of the given data type in the data type table returned by
GetDataTypesTable()
.
-
参数
-
[in]
|
id
|
The ID of the data type to look for.
|
-
返回
-
The index of the data type.
◆
GetDataTypeInfo()
Gets the data type information for a data type.
-
参数
-
[in]
|
id
|
The data type ID.
|
-
返回
-
The data type information. The GV world owns the pointed information.
◆
GetDataTypeNames()
Fills
bc
with a description of the data types with IDs in
ids
, just as
GetDataTypes()
.
-
参数
-
[in]
|
bc
|
Filled with the data type names.
|
[in]
|
ids
|
A zero terminated array of data type IDs. The caller owns the pointed array.
|
-
返回
-
The number of data types found.
◆
GetDefaultOperatorIcon()
Gets the default operator icon for an operator
type
.
-
参数
-
-
返回
-
The default operator icon. The GV world owns the pointed bitmap.
◆
GetMaster()
Returns the GV node master.
-
参数
-
[in]
|
id
|
The node GUI index. Currently not used, should be set to
0
. This is for future extensions.
|
-
返回
-
The node master. The GV world owns the pointed node master.
◆
GetMasterGUI()
Gets the node GUI for a node master.
-
注意
-
返回
nullptr
if the XPresso window has not been opened yet.
-
参数
-
[in]
|
master
|
The node master to get the GUI for. The caller owns the pointed node master.
|
[in]
|
nr
|
The node GUI index. Currently not used, should be set to
0
. This is for future extensions.
|
-
返回
-
The node GUI for master. The GV world owns the pointed node GUI.
◆
GetUniqueID()
Gets a unique ID. The generated ID is unique within the
GvWorld
during the session only.
-
返回
-
The generated unique ID for the session.
◆
SetForceUpdate()
void SetForceUpdate
|
(
|
void
|
|
)
|
|
Sets a flag that forces nodes to compute for the rest of the current scene evaluation even if the time since the last evaluation has not changed.
-
由于
-
R16.050
◆
SetPrefs()
Sets the preferences for the GV world.
-
参数
-
◆
GetPrefs()
Gets the preferences for the GV world.
-
参数
-
[out]
|
bc
|
Filled with the current preferences. Use these container IDs:
GvWorldConfigIDs
|