GvWorld Class Reference Graph View

#include <c4d_graphview.h>

详细描述

The GV world class. Cannot be instantiated. To retrieve the global instance call GvGetWorld() .

私有成员函数

  GvWorld ()
  ~GvWorld ()

Alloc/Free Node Master

GvNodeMaster AllocNodeMaster ( BaseList2D *object, Bool add_to_list=true, Bool send_messages=true)
void  FreeNodeMaster ( GvNodeMaster *&master)

Alloc/Free Node GUI

GvNodeGUI AllocNodeGUI (GvShape *shape, GvShape *group, Int32 user_area_id)
void  FreeNodeGUI ( GvNodeGUI *&gui)

Alloc/Free Shape

GvShape *  AllocShape (void)
GvShape *  AllocGroupShape (void)
void  FreeShape (GvShape *&shape)

Hook

Bool   RegisterHook (const GvHook &hook, void *user)
Bool   AttachHook ( Int32 hook_id, GvHookCallback callback)
void  DetachHook ( Int32 hook_id)
BaseList2D GetHookInstance ( BaseDocument *doc, Int32 hook_id)

Send Message

Bool   SendHookMessage ( BaseDocument *doc, GvNodeMaster *master, GvMessHook &data, Int32 owner_id)
Bool   SendOperatorMessage ( BaseDocument *doc, Int32 message_id, void *data)

Dialog

Bool   OpenDialog ( Int32 id, GvNodeMaster *master)
void  CloseDialog ( Int32 id)

Redraw

void  RedrawAll (void)
void  RedrawMaster ( GvNodeMaster *master)
Bool   AttachNode ( GvNodeMaster *master, GvNode *node, Int32 x, Int32 y)

Get String/Float/Integer

const String   GetString (const maxon::String &title, const maxon::String &default_value)
Float   GetFloat (const maxon::String &title, Float default_value)
Int32   GetInteger (const maxon::String &title, Int32 default_value)

Data Types Information

Int32   GetDataTypesMenu ( BaseContainer &bc, BaseContainer &index, Int32 first_menu_id, Int32 first_sub_id, Bool show_undefined_type=false, GvValueFlags flags= GV_CALC_NOP )
Int32   GetDataTypes ( BaseContainer &bc, GvDataOptions options= GV_DATA_OPTIONS_NONE , GvValueFlags flags= GV_CALC_NOP )
Bool   GetDataTypesTable ( GvDataInfo *&info, Int32 &count)
Int32   GetDataTypeIndex ( GvDataID id)
GvDataInfo GetDataTypeInfo ( GvDataID id)
Int32   GetDataTypeNames ( BaseContainer &bc, GvDataID *ids)

杂项

BaseBitmap GetDefaultOperatorIcon ( GvOperatorType type)
GvNodeMaster GetMaster ( Int32 id)
GvNodeGUI GetMasterGUI ( GvNodeMaster *master, UInt32 nr=0)
UInt32   GetUniqueID (void)
void  SetForceUpdate (void)

首选项

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

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

◆  GvWorld()

GvWorld () private

◆  ~GvWorld()

~ GvWorld () private

成员函数文档编制

◆  AllocNodeMaster()

GvNodeMaster * AllocNodeMaster ( BaseList2D object ,
Bool   add_to_list = true ,
Bool   send_messages = true  
)

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()

void FreeNodeMaster ( GvNodeMaster *&  master )

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()

void FreeNodeGUI ( GvNodeGUI *&  gui )

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()

Bool AttachHook ( Int32   hook_id ,
GvHookCallback   callback  
)

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()

BaseList2D * GetHookInstance ( BaseDocument doc ,
Int32   hook_id  
)

返回 (*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()

Bool SendHookMessage ( BaseDocument doc ,
GvNodeMaster master ,
GvMessHook data ,
Int32   owner_id  
)

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()

Bool SendOperatorMessage ( BaseDocument doc ,
Int32   message_id ,
void *  data  
)

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()

Bool OpenDialog ( Int32   id ,
GvNodeMaster master  
)

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()

void RedrawAll ( void  )

Redraws all opened dialogs.

注意
Currently there can only be one dialog, so this is for future extensions.

◆  RedrawMaster()

void RedrawMaster ( GvNodeMaster master )

Redraws a node master.

参数
[in] master The node master to redraw. The caller owns the pointed node master.

◆  AttachNode()

Bool AttachNode ( GvNodeMaster master ,
GvNode node ,
Int32   x ,
Int32   y  
)

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()

const String GetString ( const maxon::String title ,
const maxon::String default_value  
)

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()

Float GetFloat ( const maxon::String title ,
Float   default_value  
)

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()

Int32 GetInteger ( const maxon::String title ,
Int32   default_value  
)

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()

Int32 GetDataTypesMenu ( BaseContainer bc ,
BaseContainer index ,
Int32   first_menu_id ,
Int32   first_sub_id ,
Bool   show_undefined_type = false ,
GvValueFlags   flags = GV_CALC_NOP  
)

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()

Int32 GetDataTypes ( BaseContainer bc ,
GvDataOptions   选项 = GV_DATA_OPTIONS_NONE ,
GvValueFlags   flags = GV_CALC_NOP  
)

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()

Bool GetDataTypesTable ( GvDataInfo *&  info ,
Int32 count  
)

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()

Int32 GetDataTypeIndex ( GvDataID   id )

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()

GvDataInfo * GetDataTypeInfo ( GvDataID   id )

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()

Int32 GetDataTypeNames ( BaseContainer bc ,
GvDataID ids  
)

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()

BaseBitmap * GetDefaultOperatorIcon ( GvOperatorType   type )

Gets the default operator icon for an operator type .

参数
[in] type The operator type: GvOperatorType
返回
The default operator icon. The GV world owns the pointed bitmap.

◆  GetMaster()

GvNodeMaster * GetMaster ( Int32   id )

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()

GvNodeGUI * GetMasterGUI ( GvNodeMaster master ,
UInt32   nr = 0  
)

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()

UInt32 GetUniqueID ( void  )

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()

void SetPrefs ( const BaseContainer bc )

Sets the preferences for the GV world.

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

◆  GetPrefs()

void GetPrefs ( BaseContainer bc )

Gets the preferences for the GV world.

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