GvNodeGUI Class Reference

#include <c4d_graphview.h>

Detailed Description

GV node GUI helper class. Cannot be instantiated.

Private Member Functions

 GvNodeGUI ()
 
 ~GvNodeGUI ()
 

Attach/Detach

Bool Attach (GeDialog *dialog, GvNodeMaster *master)
 
void Detach ()
 

User Area Events

void MouseDown (Int32 x, Int32 y, Int32 chn, Int32 qa, const BaseContainer &msg)
 
Int32 Message (const BaseContainer &msg, BaseContainer &result)
 
Int32 Command (Int32 id)
 

Draw/Redraw

void Draw ()
 
void Redraw ()
 

Get User Area/Node Master/Dialog

GeUserAreaGetUserArea ()
 
GvNodeMasterGetMaster ()
 
GeDialogGetDialog ()
 

Select/Focus

void SelectAllNodes (GvNode *node, Bool select_state, Bool add_to_selection=false)
 
void RemoveAllSelectedNodes (GvNode *node)
 
void SelectNode (GvNode *node, Bool select_state, Bool add_to_selection=false, Bool send_message=true)
 
void DisableSelected (GvNode *node, Bool disable_state)
 
void SetFocus (GvNode *node, Bool activate)
 

Get Node at Position

GvNodeGetNodeGlobal (Int32 x, Int32 y)
 
GvNodeGetNodeLocal (GvNode *node, Int32 x, Int32 y)
 

Check in Node Position

Bool IsInNodeBody (GvNode *node, Int32 x, Int32 y)
 
Bool IsInNodeHead (GvNode *node, Int32 x, Int32 y)
 

Preferences

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

Set Node Position/Size

void SetNodePosGlobal (GvNode *node, Int32 x, Int32 y, Bool center=false)
 
void SetNodePos (GvNode *node, Int32 x, Int32 y)
 
void SetNodeSize (GvNode *node, Int32 width, Int32 height)
 
void OptimizeNode (GvNode *node)
 

Node Utilities

void ShowAllNodes (GvNode *node)
 
void CenterNodes (GvNode *node)
 
void AlignNodesToUpperLeft (GvNode *node)
 

Miscellaneous

void GetZoom (GvNode *node, Float &zoom)
 
Bool InitShapes ()
 
Bool NodeContextMenu (GvNode *node)
 

Constructor & Destructor Documentation

◆ GvNodeGUI()

GvNodeGUI ( )
private

◆ ~GvNodeGUI()

~GvNodeGUI ( )
private

Member Function Documentation

◆ Attach()

Bool Attach ( GeDialog dialog,
GvNodeMaster master 
)

Attaches the node GUI to dialog and master.

Note
Normally you do not need to call this function.
Parameters
[in]dialogA dialog. The caller owns the pointed dialog.
[in]masterA node master. The caller owns the pointed node master.
Returns
true if successful, otherwise false.

◆ Detach()

void Detach ( )

Detaches the node GUI.

Note
Normally you do not need to call this function.

◆ MouseDown()

void MouseDown ( Int32  x,
Int32  y,
Int32  chn,
Int32  qa,
const BaseContainer msg 
)

Handles mouse down messages routed from the user area.

Parameters
[in]xThe X coordinate.
[in]yThe Y coordinate.
[in]chnThe channel.
[in]qaThe qualifiers.
[in]msgThe message container.

◆ Message()

Int32 Message ( const BaseContainer msg,
BaseContainer result 
)

Handles messages routed from the user area.

Parameters
[in]msgThe message container.
[in]resultA container to place results in.
Returns
true if the message was handled, otherwise false.

◆ Command()

Int32 Command ( Int32  id)

Handles commands routed from the user area.

Parameters
[in]idThe command ID.
Returns
The command result.

◆ Draw()

void Draw ( )

Draws the window content. Called by GeUserArea::DrawMsg().

◆ Redraw()

void Redraw ( )

Redraws the node GUI and calls all draw hooks attached to the node master. Called by GvNodeMaster.

◆ GetUserArea()

GeUserArea* GetUserArea ( )

Gets the user area for the node GUI.

Returns
The user area. The node GUI owns the pointed user area.

◆ GetMaster()

GvNodeMaster* GetMaster ( )

Gets the node master for the node GUI.

Returns
The node master. The node GUI owns the pointed node master.

◆ GetDialog()

GeDialog* GetDialog ( )

Gets the dialog for the node GUI.

Returns
The dialog. The node GUI owns the pointed dialog.

◆ SelectAllNodes()

void SelectAllNodes ( GvNode node,
Bool  select_state,
Bool  add_to_selection = false 
)

Selects all nodes.

Parameters
[in]nodeThe node. The caller owns the pointed node.
[in]select_stateThe selection state.
[in]add_to_selectionIf true the node is added to the selection.

◆ RemoveAllSelectedNodes()

void RemoveAllSelectedNodes ( GvNode node)

Removes all selected nodes.

Parameters
[in]nodeThe node. The caller owns the pointed node.

◆ SelectNode()

void SelectNode ( GvNode node,
Bool  select_state,
Bool  add_to_selection = false,
Bool  send_message = true 
)

Selects a node.

Parameters
[in]nodeThe node to select. The caller owns the pointed node.
[in]select_stateThe selection state.
[in]add_to_selectionIf true the node is added to the selection.
[in]send_messageIf true a message is sent about the selection.

◆ DisableSelected()

void DisableSelected ( GvNode node,
Bool  disable_state 
)

Disables or enables a node.

Parameters
[in]nodeThe node to disable or enable. The caller owns the pointed node.
[in]disable_statetrue means disabled, false means enabled.

◆ SetFocus()

void SetFocus ( GvNode node,
Bool  activate 
)

Sets the focus to node.

Parameters
[in]nodeThe node to focus. The caller owns the pointed node.
[in]activatetrue to activate the node, false to deactivate.

◆ GetNodeGlobal()

GvNode* GetNodeGlobal ( Int32  x,
Int32  y 
)

Gets the node at the global position (x, y).

Parameters
[in]xThe X coordinate.
[in]yThe Y coordinate.
Returns
The found node, or nullptr if there was no match. The node GUI owns the pointed node.

◆ GetNodeLocal()

GvNode* GetNodeLocal ( GvNode node,
Int32  x,
Int32  y 
)

Gets the node at the local position (x, y).

Parameters
[in]nodeThe node for the local coordinates. The caller owns the pointed node.
[in]xThe X coordinate.
[in]yThe Y coordinate.
Returns
The found node, or nullptr if there was no match. The node GUI owns the pointed node.

◆ IsInNodeBody()

Bool IsInNodeBody ( GvNode node,
Int32  x,
Int32  y 
)

Checks if the position (x, y) is inside the body of node.

Parameters
[in]nodeThe node. The caller owns the pointed node.
[in]xThe X coordinate.
[in]yThe Y coordinate.
Returns
true if the position is in the body, otherwise false.

◆ IsInNodeHead()

Bool IsInNodeHead ( GvNode node,
Int32  x,
Int32  y 
)

Checks if the position (x, y) is inside the head of node.

Parameters
[in]nodeThe node. The caller owns the pointed node.
[in]xThe X coordinate.
[in]yThe Y coordinate.
Returns
true if the position is in the head, otherwise false.

◆ SetPrefs()

void SetPrefs ( const BaseContainer bc)

Sets the preferences for the node GUI.

Parameters
[in]bcThe new preferences. Use these container IDs: GvGuiConfigIDs

◆ GetPrefs()

void GetPrefs ( BaseContainer bc)

Gets the preferences for the node GUI.

Parameters
[out]bcFilled with the current preferences. Use these container IDs: GvGuiConfigIDs

◆ SetNodePosGlobal()

void SetNodePosGlobal ( GvNode node,
Int32  x,
Int32  y,
Bool  center = false 
)

Sets the global position of node to (x, y).

Parameters
[in]nodeThe node. The caller owns the pointed node.
[in]xThe X coordinate.
[in]yThe Y coordinate.
[in]centerIf true the node is centered.

◆ SetNodePos()

void SetNodePos ( GvNode node,
Int32  x,
Int32  y 
)

Sets the position of node to (x, y).

Parameters
[in]nodeThe node. The caller owns the pointed node.
[in]xThe X coordinate.
[in]yThe Y coordinate.

◆ SetNodeSize()

void SetNodeSize ( GvNode node,
Int32  width,
Int32  height 
)

Sets the size of node.

Parameters
[in]nodeThe node. The caller owns the pointed node.
[in]widthThe width.
[in]heightThe height.

◆ OptimizeNode()

void OptimizeNode ( GvNode node)

Optimizes the size of node.

Parameters
[in]nodeThe node. The caller owns the pointed node.

◆ ShowAllNodes()

void ShowAllNodes ( GvNode node)

Shows all nodes.

Parameters
[in]nodeThe node. The caller owns the pointed node.

◆ CenterNodes()

void CenterNodes ( GvNode node)

Centers nodes.

Parameters
[in]nodeThe node. The caller owns the pointed node.

◆ AlignNodesToUpperLeft()

void AlignNodesToUpperLeft ( GvNode node)

Aligns all nodes to the upper left.

Parameters
[in]nodeThe node. The caller owns the pointed node.

◆ GetZoom()

void GetZoom ( GvNode node,
Float zoom 
)

Gets the zoom of node.

Parameters
[in]nodeThe node. The caller owns the pointed node.
[out]zoomThis value is multiplied by the zoom factor.

◆ InitShapes()

Bool InitShapes ( )

Initializes the node GUI shapes.

Returns
true if successful, otherwise false.

◆ NodeContextMenu()

Bool NodeContextMenu ( GvNode node)

Opens the context menu of node.

Parameters
[in]nodeThe node. The caller owns the pointed node.
Returns
true if successful, otherwise false.