#include <c4d_graphview.h>
The GV world class. Cannot be instantiated. To retrieve the global instance call GvGetWorld().
Private Member Functions | |
| 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 () |
| GvShape * | AllocGroupShape () |
| 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 | 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) |
Miscellaneous | |
| BaseBitmap * | GetDefaultOperatorIcon (GvOperatorType type) |
| GvNodeMaster * | GetMaster (Int32 id) |
| GvNodeGUI * | GetMasterGUI (GvNodeMaster *master, UInt32 nr=0) |
| UInt32 | GetUniqueID () |
| void | SetForceUpdate () |
Preferences | |
| void | SetPrefs (const BaseContainer &bc) |
| void | GetPrefs (BaseContainer &bc) |
|
private |
|
private |
| GvNodeMaster* AllocNodeMaster | ( | BaseList2D * | object, |
| Bool | add_to_list = true, |
||
| Bool | send_messages = true |
||
| ) |
Allocates a node master. Must be freed with FreeNodeMaster().
| [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 | If true messages are sent to object for example when nodes are added. |
| 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. |
Allocates a node GUI. Must be freed with FreeNodeGUI().
| [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. |
| 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. |
| GvShape* AllocShape | ( | ) |
Allocates a shape. Must be freed with FreeShape().
| GvShape* AllocGroupShape | ( | ) |
Allocates a group shape. Must be freed with 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. |
Registers a hook. See GvHook for more information.
| [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. |
| 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. |
| 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. |
| BaseList2D* GetHookInstance | ( | BaseDocument * | doc, |
| Int32 | hook_id | ||
| ) |
Returns (*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. |
| 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. |
| 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. |
| 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. |
| void CloseDialog | ( | Int32 | id | ) |
Closes a dialog opened with OpenDialog().
| [in] | id | The plugin ID that the dialog was opened with. |
| void RedrawAll | ( | ) |
Redraws all opened dialogs.
| void RedrawMaster | ( | GvNodeMaster * | master | ) |
Redraws a node master.
| [in] | master | The node master to redraw. The caller owns the pointed node master. |
| 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. |
| 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. |
| 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. |
| 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. |
| 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 | If true the data type "Undefined" is included where needed. |
| [in] | flags | If set, only data types that can handle these calculations are retrieved: GvValueFlags |
| Int32 GetDataTypes | ( | BaseContainer & | bc, |
| GvDataOptions | options = 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] | options | The data options: GvDataOptions |
| [in] | flags | If set, only data types that can handle these calculations are retrieved: GvValueFlags |
| 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. |
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. |
| GvDataInfo* GetDataTypeInfo | ( | GvDataID | id | ) |
Gets the data type information for a data type.
| [in] | id | The data type ID. |
| 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. |
| BaseBitmap* GetDefaultOperatorIcon | ( | GvOperatorType | type | ) |
Gets the default operator icon for an operator type.
| [in] | type | The operator type: GvOperatorType |
| 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. |
| GvNodeGUI* GetMasterGUI | ( | GvNodeMaster * | master, |
| UInt32 | nr = 0 |
||
| ) |
Gets the node GUI for a node master.
| [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. |
| UInt32 GetUniqueID | ( | ) |
Gets a unique ID. The generated ID is unique within the GvWorld during the session only.
| void SetForceUpdate | ( | ) |
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.
| void SetPrefs | ( | const BaseContainer & | bc | ) |
Sets the preferences for the GV world.
| [in] | bc | The new preferences. Use these container IDs: GvWorldConfigIDs |
| void GetPrefs | ( | BaseContainer & | bc | ) |
Gets the preferences for the GV world.
| [out] | bc | Filled with the current preferences. Use these container IDs: GvWorldConfigIDs |