GvOperatorData Class Reference

#include <c4d_operatordata.h>

Inheritance diagram for GvOperatorData:

Detailed Description

A class for registering new Graph View operators. These show up as nodes in XPresso.
Use GvRegisterOperatorPlugin() to register a Graph View operator.
Information on how to handle data in a GvOperatorData plugin can be found in the articles Graph View Calculation (XPresso) Manual and Graph View Data Format (XPresso) Manual.

NodeData Overloads

virtual Bool Init (GeListNode *node)
 
virtual Bool GetDDescription (GeListNode *node, Description *description, DESCFLAGS_DESC &flags)
 
virtual Bool GetDParameter (GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
 
virtual Bool GetDEnabling (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
 
virtual Bool SetDParameter (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
 

Internal

virtual void iGetPortList (GvNode *bn, GvPortIO port, GvPortList &portlist)
 
virtual Bool iGetPortDescription (GvNode *bn, GvPortIO port, Int32 id, GvPortDescription *pd)
 
virtual Bool iCreateOperator (GvNode *bn)
 

Port Description Cache

virtual Bool CreatePortDescriptionCache (GvNode *bn, Bool lock_only=false)
 
virtual void FreePortDescriptionCache (GvNode *bn)
 

Operator Information

virtual const String GetDetailedText (GvNode *bn)
 
virtual const String GetText (GvNode *bn)
 
virtual const String GetTitle (GvNode *bn)
 
virtual BaseBitmapGetPortIcon (GvNode *bn, Int32 id, GvLayoutType layout_type)
 
virtual void GetBodySize (GvNode *bn, Int32 *width, Int32 *height)
 
virtual const Vector GetBodyColor (GvNode *bn)
 
virtual Bool GetOperatorDescription (GvNode *bn, GvOperatorDescription *od)
 

Special Events

virtual void EditorDraw (GvNode *bn, GvNodeGUI *gui, GeUserArea *da, Int32 x1, Int32 y1, Int32 x2, Int32 y2)
 
virtual Bool SceneDraw (GvNode *bn, BaseDraw *bd, BaseDrawHelp *bh, BaseThread *bt, SCENEHOOKDRAW flags, void *data, UInt32 counter)
 
virtual Bool BodyMessage (GvNode *bn, GvNodeGUI *gui, Int32 x, Int32 y, Int32 chn, Int32 qua, const BaseContainer &msg)
 
virtual Bool EditSettings (GvNode *bn, GvNodeGUI *gui)
 

Calculation

virtual Bool QueryCalculation (GvNode *bn, GvQuery *query)
 
virtual Bool InitCalculation (GvNode *bn, GvCalc *calc, GvRun *run)
 
virtual void FreeCalculation (GvNode *bn, GvCalc *calc)
 
virtual Bool Calculate (GvNode *bn, GvPort *port, GvRun *run, GvCalc *calc)
 
virtual Bool AddToCalculationTable (GvNode *bn, GvRun *run)
 
virtual Bool SetRecalculate (GvNode *bn, GvPort *port, GvRun *run, Bool force_set=false)
 

Set Data

virtual Bool SetData (GvNode *bn, GvDataType type, void *data, GvOpSetDataMode mode=GV_OP_SET)
 
virtual Bool IsSetDataAllowed (GvNode *bn, GvDataType type, void *data, GvOpSetDataMode mode=GV_OP_SET)
 

Menus

virtual Int32 FillPortMenu (GvNode *bn, BaseContainer &menu, Int32 port_id, Int32 first_menu_id)
 
virtual Bool PortMenuCommand (GvNode *bn, Int32 menu_id, Int32 port_id, Int32 mx, Int32 my)
 
virtual Int32 FillOperatorMenu (GvNode *bn, BaseContainer &menu, Int32 first_menu_id)
 
virtual Bool OperatorMenuCommand (GvNode *bn, Int32 menu_id, Int32 mx, Int32 my)
 
virtual Int32 FillPortsMenu (GvNode *bn, BaseContainer &names, BaseContainer &ids, GvValueID value_type, GvPortIO port, Int32 first_menu_id)
 

Miscellaneous

virtual const String GetErrorString (GvNode *bn, Int32 error)
 
virtual Int32 GetMainID (GvNode *bn, GvPortIO io, const DescID &desc_id)
 
virtual const DescID GetDescID (GvNode *bn, GvPortIO io, Int32 main_id)
 

Additional Inherited Members

- Public Member Functions inherited from NodeData
 NodeData ()
 
GeListNodeGet () const
 
virtual Bool Message (GeListNode *node, Int32 type, void *data)
 
virtual void GetBubbleHelp (GeListNode *node, maxon::String &str)
 
virtual BaseDocumentGetDocument (GeListNode *node)
 
virtual Int32 GetBranchInfo (GeListNode *node, BranchInfo *info, Int32 max, GETBRANCHINFO flags)
 
virtual Bool IsInstanceOf (const GeListNode *node, Int32 type) const
 
virtual Bool IsDocumentRelated (const GeListNode *node, Bool &docrelated) const
 
virtual void Free (GeListNode *node)
 
virtual Bool Read (GeListNode *node, HyperFile *hf, Int32 level)
 
virtual Bool Write (GeListNode *node, HyperFile *hf)
 
virtual Bool CopyTo (NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn)
 
virtual Bool TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, C4DAtom *&res_at)
 
- Public Member Functions inherited from BaseData
 BaseData ()
 
virtual ~BaseData ()
 
void Destructor ()
 
- Protected Attributes inherited from NodeData
GeListNodeprivate_link
 

Member Function Documentation

◆ Init()

virtual Bool Init ( GeListNode node)
virtual

Called when a new instance of the node type is being allocated.

The parameters of a node must be initialized in this method. NodeData::Init is being called frequently due to nodes being reallocated in the background by Cinema 4D. One should therefore be careful with carrying out computationally complex tasks in this function.

Bool BlinkerKey::Init(GeListNode *node)
{
BaseKey *op = (BaseKey*) node;
BaseContainer *data = op->GetDataInstance();
data->SetFloat(BLINKERKEY_NUMBER, 1.0);
data->SetFloat(BLINKERKEY_STRENGTH, 1.0);
data->SetBool(BLINKERKEY_SOFT, false);
return true;
}
Definition: c4d_basecontainer.h:47
void SetFloat(Int32 id, Float r)
Definition: c4d_basecontainer.h:533
void SetBool(Int32 id, Bool b)
Definition: c4d_basecontainer.h:498
Represents a C4DAtom that resides in a 4D list.
Definition: c4d_baselist.h:1831
maxon::Bool Bool
Definition: ge_sys_math.h:55
PyObject * op
Definition: object.h:520
Definition: node.h:10
Note
If the node data class has a constructor it is called as usual before, but at that time there is no GeListNode link established.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
Returns
true if the node was initialized, otherwise false.

Reimplemented from NodeData.

◆ GetDDescription()

virtual Bool GetDDescription ( GeListNode node,
Description description,
DESCFLAGS_DESC flags 
)
virtual

Called to add parameters to the description for the node.
Modify the passed description as needed, set the appropriate flags. Make sure to include a call to the parent at the end.

Note
{The SUPER syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::GetDDescription implementation.}
return SUPER::GetDDescription(data, description, flags, parentdescription);
PyCompilerFlags * flags
Definition: ast.h:14
If only a description resource is used it is not needed to overload GetDDescription.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in,out]descriptionThe node's description to add the parameters to. Cinema 4D owns the pointed description.
[in,out]flagsThe flags for the description operation: DESCFLAGS_DESC
Returns
true if successful, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from NodeData.

◆ GetDParameter()

virtual Bool GetDParameter ( GeListNode node,
const DescID id,
GeData t_data,
DESCFLAGS_GET flags 
)
virtual

Called to override the reading of description parameters.
Necessary for parameters that are not simply stored in the node's container, e.g. the global position of an object.
Modify the passed t_data if the right id is provided, and set the appropriate flags. Make sure to include a call to the parent at the end.

Note
{The SUPER syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::GetDParameter implementation.}
return SUPER::GetDParameter(data, id, t_data, flags);
If only a description resource is used it is not needed to overload GetDParameter.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]idThe ID of the parameter.
[out]t_dataThe parameter data to return. Cinema 4D owns the pointed data.
[in,out]flagsThe flags for the description operation: DESCFLAGS_GET
Returns
true if successful, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from NodeData.

◆ GetDEnabling()

virtual Bool GetDEnabling ( GeListNode node,
const DescID id,
const GeData t_data,
DESCFLAGS_ENABLE  flags,
const BaseContainer itemdesc 
)
virtual

Called to decide which description parameters should be enabled or disabled.
Can be used both for parameters that are stored in the node's description and for dynamic parameters.
Read the passed t_data if the right id was provided, and return true to enable the parameter or false to disable it. Make sure to include a call to the parent at the end.

Note
{The SUPER syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::GetDEnabling implementation.}
return SUPER::GetDEnabling(data, id, t_data, flags, itemdesc);
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]idThe ID of the parameter.
[in]t_dataThe parameter data. Cinema 4D owns the pointed data.
[in]flagsNot used.
[in]itemdescThe parameter's description, encoded to a container as described in Description.
Returns
true if the parameter should be enabled, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from NodeData.

◆ SetDParameter()

virtual Bool SetDParameter ( GeListNode node,
const DescID id,
const GeData t_data,
DESCFLAGS_SET flags 
)
virtual

Called to override the writing of parameters.

Read the passed t_data if the right id was provided, store the data, and set the appropriate flags. Make sure to include a call to the parent at the end.

Note
{The SUPER syntax is only available when the INSTANCEOF macro has been invoked for the NodeData which contains the NodeData::SetDParameter implementation.}
class MyObjectData : public ObjectData
{
INSTANCEOF(MyObjectData, ObjectData)
// ...
}
Bool MyObjectData::SetDParameter(GeListNode* node, const DescID& id, const GeData& t_data, DESCFLAGS_SET& flags)
{
// ...
return SUPER::SetDParameter(node, id, t_data, flags);
}
#define INSTANCEOF(X, Y)
Definition: c4d_baselist.h:38
Definition: lib_description.h:330
Definition: c4d_gedata.h:83
Definition: c4d_objectdata.h:169
DESCFLAGS_SET
Definition: ge_prepass.h:3359
If only a description resource is used it is not needed to overload SetDParameter.
Parameters
[in]nodeThe GeListNode connected with the NodeData instance. Equal to Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]idThe ID of the parameter.
[in]t_dataThe parameter data to set. Cinema 4D owns the pointed data.
[in,out]flagsThe flags for the description operation: DESCFLAGS_SET
Returns
true if successful, otherwise false. It is recommended to include a call to the parent function as last return.

Reimplemented from NodeData.

◆ iGetPortList()

virtual void iGetPortList ( GvNode bn,
GvPortIO  port,
GvPortList portlist 
)
virtual

Internal wrapper for GvNode::GetPortList(). Normally it is not need to override this function.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]portOnly retrieve ports with the IO mode: GvPortIO
[out]portlistFilled with the ports for this node. The caller owns the pointed GvPortList.

◆ iGetPortDescription()

virtual Bool iGetPortDescription ( GvNode bn,
GvPortIO  port,
Int32  id,
GvPortDescription pd 
)
virtual

Internal wrapper for GvNode::GetPortDescription(). Normally it is not need to override this function.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]portOnly retrieve port description with the IO mode: GvPortIO
[in]idThe port ID.
[in]pdFilled with the port description. The caller owns the pointed GvPortDescription.
Returns
true if successful, otherwise false.

◆ iCreateOperator()

virtual Bool iCreateOperator ( GvNode bn)
virtual

Internal wrapper for GvNode::CreateOperator().
Initialize here default parameters for the operator:

{
if (!bc)
return false;
return SUPER::iCreateOperator(bn);
}
Definition: c4d_graphview.h:429
BaseContainer * GetOpContainerInstance()
Definition: c4d_graphview.h:766
virtual Bool iCreateOperator(GvNode *bn)
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
Returns
true if successful, otherwise false.

◆ CreatePortDescriptionCache()

virtual Bool CreatePortDescriptionCache ( GvNode bn,
Bool  lock_only = false 
)
virtual

Called before a node master's Calculate() is executed to give the node the chance to cache internal data.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]lock_onlytrue to lock only.
Returns
true if successful, otherwise false.

◆ FreePortDescriptionCache()

virtual void FreePortDescriptionCache ( GvNode bn)
virtual

Called after a node master's Calculate() is executed to free the cached internal data.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.

◆ GetDetailedText()

virtual const String GetDetailedText ( GvNode bn)
virtual

◆ GetText()

virtual const String GetText ( GvNode bn)
virtual

Called to retrieve the text for the operator.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
Returns
The operator text.

◆ GetTitle()

virtual const String GetTitle ( GvNode bn)
virtual

◆ GetPortIcon()

virtual BaseBitmap* GetPortIcon ( GvNode bn,
Int32  id,
GvLayoutType  layout_type 
)
virtual

Called to provide an icon for a port.

Note
Currently this is not used anywhere.
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]idThe port ID.
[in]layout_typeThe layout type: GvLayoutType
Returns
The port icon. The operator owns the pointed BaseBitmap.

◆ GetBodySize()

virtual void GetBodySize ( GvNode bn,
Int32 width,
Int32 height 
)
virtual

Called to give a default body size for the operator.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[out]widthAssign the default width in pixels.
[out]heightAssign the default height in pixels.

◆ GetBodyColor()

virtual const Vector GetBodyColor ( GvNode bn)
virtual

Called to give a default body color for the operator.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
Returns
The default body color.

◆ GetOperatorDescription()

virtual Bool GetOperatorDescription ( GvNode bn,
GvOperatorDescription od 
)
virtual

Called to set operator flags in od.

Note
This is for future extensions. Currently all flags that affect the node are static and set with GvRegisterOperatorPlugin().
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[out]odThe operator description. The caller owns the pointed GvOperatorDescription.
Returns
true if successful, otherwise false.

◆ EditorDraw()

virtual void EditorDraw ( GvNode bn,
GvNodeGUI gui,
GeUserArea da,
Int32  x1,
Int32  y1,
Int32  x2,
Int32  y2 
)
virtual

Called to draw inside the operator body.
Use the da pointer to draw in the rectangle defined by (x1, y1) and (x2, y2).
A clipping rectangle is set, so it does not matter if draw occurs outside this bound.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]guiThe current GUI. The caller owns the pointed GvNodeGUI.
[in]daThe user area to draw in. The caller owns the pointed GeUserArea.
[in]x1The upper left X coordinate.
[in]y1The upper left Y coordinate.
[in]x2The lower right X coordinate.
[in]y2The lower right Y coordinate.

◆ SceneDraw()

virtual Bool SceneDraw ( GvNode bn,
BaseDraw bd,
BaseDrawHelp bh,
BaseThread bt,
SCENEHOOKDRAW  flags,
void *  data,
UInt32  counter 
)
virtual

Allows the node to draw into the editor window.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]bdThe BaseDraw object for the active editor view. Cinema 4D owns the pointed BaseDraw.
[in]bhThe BaseDrawHelp object for the active editor view. Cinema 4D owns the pointed BaseDrawHelp.
[in]btThe calling thread. Cinema 4D owns the pointed BaseThread.
[in]flagsThe pass: SCENEHOOKDRAW
[in]dataThe user defined data passed to GvNodeMaster::AddToDrawList(), or nullptr.
[in]counterThis counter is increased on every InitCalculation(). It helps determine when the GvNodeMaster::AddToDrawList() occurred. The counter will be the same for every SceneDraw().
Returns
true if successful, otherwise false.

◆ BodyMessage()

virtual Bool BodyMessage ( GvNode bn,
GvNodeGUI gui,
Int32  x,
Int32  y,
Int32  chn,
Int32  qua,
const BaseContainer msg 
)
virtual

Called if the user clicks in the body of the node.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]guiThe node GUI. The caller owns the pointed GvNodeGUI.
[in]xThe mouse X coordinate.
[in]yThe mouse Y coordinate.
[in]chnThe mouse channel: BFM_INPUT_CHANNEL
[in]quaA bitmask with the qualifiers at the time when the mouse event occurred: QUALIFIERS
[in]msgThe original message. See Input Events.
Returns
true if the message was handled, otherwise false.

◆ EditSettings()

virtual Bool EditSettings ( GvNode bn,
GvNodeGUI gui 
)
virtual

Called to give the operator the chance to provide a custom settings dialog.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]guiThe node GUI. The caller owns the pointed GvNodeGUI.
Returns
true if successful, otherwise false.

◆ QueryCalculation()

virtual Bool QueryCalculation ( GvNode bn,
GvQuery query 
)
virtual

Called to check if it is OK to start a calculation. If false is returned tell the caller why by setting an error flag in query.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[out]queryThe query parameter. The caller owns the pointed GvQuery.
Returns
true if it is OK to start a calculation, otherwise false.

◆ InitCalculation()

virtual Bool InitCalculation ( GvNode bn,
GvCalc calc,
GvRun run 
)
virtual

Called before the calculation is started.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]calcThe current calculation helper. The caller owns the pointed GvCalc.
[in]runThe current run helper. The caller owns the pointed GvRun.
Returns
true if calculation was initialized, otherwise false.

◆ FreeCalculation()

virtual void FreeCalculation ( GvNode bn,
GvCalc calc 
)
virtual

Called after the calculation is finished.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]calcThe current calculation helper. The caller owns the pointed GvCalc.

◆ Calculate()

virtual Bool Calculate ( GvNode bn,
GvPort port,
GvRun run,
GvCalc calc 
)
virtual

Called either from the node master, when the node has called GvRun::AddNodeToCalculationTable(), or from another node that calls GvValue::Calculate() for a port that is connected to the node.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]portIf the call comes directly from the node master this is nullptr. Otherwise it is the outport that another node wants to be calculated. The caller owns the pointed GvPort.
[in]runThe current run helper. The caller owns the pointed GvRun.
[in]calcThe current calculation helper. The caller owns the pointed GvCalc.
Returns
true if calculation was successful, otherwise false.

◆ AddToCalculationTable()

virtual Bool AddToCalculationTable ( GvNode bn,
GvRun run 
)
virtual

Called by the node master before the calculation starts.
To set if a node can be evaluated regardless of whether another node requests data from its output ports or not, call GvRun::AddNodeToCalculationTable() here.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]runThe current run helper. The caller owns the pointed GvRun.
Returns
true if successful, otherwise false.

◆ SetRecalculate()

virtual Bool SetRecalculate ( GvNode bn,
GvPort port,
GvRun run,
Bool  force_set = false 
)
virtual

Called by the node master when someone has called SetRecalculate().
As a rule of thumb, if GvRun::AddNodeToCalculationTable() is called in AddToCalculationTable() this should be done here as well. Otherwise this method should not be implemented.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]portThe port that was invalidated.
[in]runThe current run helper. The caller owns the pointed GvRun.
[in]force_setIf true the recalculation is forced even if the data is already updated.
Returns
true if successful, otherwise false.

◆ SetData()

virtual Bool SetData ( GvNode bn,
GvDataType  type,
void *  data,
GvOpSetDataMode  mode = GV_OP_SET 
)
virtual

Called for example when the user drops something on the node.

Note
Overload IsSetDataAllowed() to specify what kinds of data is accepted.
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]typeThe data type: GvDataType
[in]dataThe data pointer. The format depends on type.
[in]modeThe mode: GvOpSetDataMode
Returns
true if successful, otherwise false.

◆ IsSetDataAllowed()

virtual Bool IsSetDataAllowed ( GvNode bn,
GvDataType  type,
void *  data,
GvOpSetDataMode  mode = GV_OP_SET 
)
virtual

Called to check if the specified data would be acceptable for a SetData() action. This is used to for example determine the cursor during drag-and-drop.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]typeThe data type: GvDataType
[in]dataThe data pointer. The format depends on type.
[in]modeThe mode: GvOpSetDataMode
Returns
true if data is acceptable, otherwise false.

◆ FillPortMenu()

virtual Int32 FillPortMenu ( GvNode bn,
BaseContainer menu,
Int32  port_id,
Int32  first_menu_id 
)
virtual

Called when the user has opened the port menu, for example by right-clicking on a port.
Add menu items to the menu container, as described in ShowPopupMenu(), and then return the number of entries added. Do not use menu IDs below first_menu_id.
If the user chooses one of the commands, PortMenuCommand() is called.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[out]menuThe menu container to add entries to.
[in]port_idThe port ID.
[in]first_menu_idThe first menu item ID.
Returns
The number of menu entries added.

◆ PortMenuCommand()

virtual Bool PortMenuCommand ( GvNode bn,
Int32  menu_id,
Int32  port_id,
Int32  mx,
Int32  my 
)
virtual

Called when the user chooses one of the commands in the port menu set in FillPortMenu().

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]menu_idThe menu item ID.
[in]port_idThe port ID.
[in]mxThe mouse X coordinate.
[in]myThe mouse Y coordinate.
Returns
true if the command was handled, otherwise false.

◆ FillOperatorMenu()

virtual Int32 FillOperatorMenu ( GvNode bn,
BaseContainer menu,
Int32  first_menu_id 
)
virtual

Called when the user has opened the operator menu, for example by right-clicking on the operator.
Add menu items to the menu container, as described in ShowPopupMenu(), and then return the number of entries added. Do not use menu IDs below first_menu_id.
If the user chooses one of the commands, OperatorMenuCommand() is called.

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[out]menuThe menu container to add entries to.
[in]first_menu_idThe first menu item ID.
Returns
The number of menu entries added.

◆ OperatorMenuCommand()

virtual Bool OperatorMenuCommand ( GvNode bn,
Int32  menu_id,
Int32  mx,
Int32  my 
)
virtual

Called when the user chooses one of the commands in the operator menu set in FillOperatorMenu().

Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]menu_idThe menu item ID.
[in]mxThe mouse X coordinate.
[in]myThe mouse Y coordinate.
Returns
true if the command was handled, otherwise false.

◆ FillPortsMenu()

virtual Int32 FillPortsMenu ( GvNode bn,
BaseContainer names,
BaseContainer ids,
GvValueID  value_type,
GvPortIO  port,
Int32  first_menu_id 
)
virtual

Called when the user has opened the ports menu, for example by clicking on the corner of the node or dragging a connection from another port.
Add a name entry to names and an ID entry to ids for each possible port to create for this action and return the number of added entries.
The ids container is a translation between menu IDs and the port IDs of the data types:

names.SetString(first_menu_id + i, "Port name");
ids.SetInt32(first_menu_id + i, PORT_ID);
Py_ssize_t i
Definition: abstract.h:645
PyObject PyObject * names
Definition: code.h:159
See also
ShowPopupMenu() for the name formatting.
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[out]namesThe container with the menu entries.
[out]idsThe container for the translation between menu ID and port ID.
[in]value_typeThe value type for drag-and-drop, or ID_GV_VALUE_TYPE_NONE if this is not a drag-and-drop action.
[in]portThe IO mode: GvPortIO
[in]first_menu_idThe first menu item ID.
Returns
The number of menu entries added.

◆ GetErrorString()

virtual const String GetErrorString ( GvNode bn,
Int32  error 
)
virtual

Called to let translate error messages that have been set when the calculation failed.

Note
Currently this function is not called.
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]errorThe error ID.
Returns
The error message.

◆ GetMainID()

virtual Int32 GetMainID ( GvNode bn,
GvPortIO  io,
const DescID desc_id 
)
virtual

Return the port main ID of the given desc_id.

Note
Normally it is not need to implement this method. It is currently only used by the object node.
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]ioThe IO mode: GvPortIO
[in]desc_idThe description ID.
Returns
The main ID.

◆ GetDescID()

virtual const DescID GetDescID ( GvNode bn,
GvPortIO  io,
Int32  main_id 
)
virtual

Return the description ID of the given port main_id.

Note
Normally it is not need to implement this method. It is currently only used by the object node.
Parameters
[in]bnEqual to static_cast<GvNode*>->Get(). Provided for speed and convenience. Cinema 4D owns the pointed node.
[in]ioThe IO mode: GvPortIO
[in]main_idThe main ID.
Returns
The description ID.