GvOperatorData Class Reference Graph View

#include <c4d_operatordata.h>

Inheritance diagram for GvOperatorData:

详细描述

A class for registering new Graph View operators. These show up as nodes in XPresso.
使用 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, 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 BaseBitmap GetPortIcon ( GvNode *bn, Int32 id, GvLayoutType layout_type)
virtual void  GetBodySize ( GvNode *bn, Int32 *width, Int32 *height)
virtual const 向量   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 )

菜单

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)

杂项

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 ()
GeListNode Get (void) const
virtual Bool   消息 ( GeListNode *node, Int32 type, void *data)
virtual void  GetBubbleHelp ( GeListNode *node, maxon::String &str)
virtual BaseDocument GetDocument ( 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   读取 ( 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)
void  Destructor (void)
-  Protected Attributes inherited from NodeData
GeListNode private_link

成员函数文档编制

◆  Init()

virtual Bool Init ( GeListNode node )
virtual

Called when a new instance of the node data is allocated.
Allocate and initialize member variables of the node data class here. Fill also the container of the node data and connected nodes with default values:

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 ; }
注意
If the node data class has a constructor it is called as usual before, but at that time there is no GeListNode link established.
参数
[in] node The GeListNode connected with the NodeData instance. Equal to Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
返回
true node was initialized, otherwise false .

Reimplemented from NodeData .

◆  GetDDescription()

virtual Bool GetDDescription ( GeListNode node ,
描述 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 and then make sure to include a call to the parent at the end:

return SUPER::GetDDescription(data, description, flags, parentdescription);
注意
If only a description resource is used it is not needed to overload GetDDescription .
参数
[in] node The GeListNode connected with the NodeData instance. Equal to Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in,out] description The node's description to add the parameters to. Cinema 4D owns the pointed description.
[in,out] flags The flags for the description operation: DESCFLAGS_DESC
返回
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 . Then make sure to include a call to the parent at the end:

return SUPER::GetDParameter(data, id , t_data, flags);
注意
If only a description resource is used it is not needed to overload GetDParameter .
参数
[in] node The GeListNode connected with the NodeData instance. Equal to Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] id The ID of the parameter.
[out] t_data The parameter data to return. Cinema 4D owns the pointed data.
[in,out] flags The flags for the description operation: DESCFLAGS_GET
返回
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. Then make sure to include a call to the parent at the end:

return SUPER::GetDEnabling(data, id , t_data, flags, itemdesc);
参数
[in] node The GeListNode connected with the NodeData instance. Equal to Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] id The ID of the parameter.
[in] t_data The parameter data. Cinema 4D owns the pointed data.
[in] flags Not used.
[in] itemdesc The parameter's description, encoded to a container as described in 描述 .
返回
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 . Then make sure to include a call to the parent at the end:

return SUPER::SetDParameter(data, id , t_data, flags);
注意
If only a description resource is used it is not needed to overload SetDParameter .
参数
[in] node The GeListNode connected with the NodeData instance. Equal to Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] id The ID of the parameter.
[in] t_data The parameter data to set. Cinema 4D owns the pointed data.
[in,out] flags The flags for the description operation: DESCFLAGS_SET
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] port Only retrieve ports with the IO mode: GvPortIO
[out] portlist Filled 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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] port Only retrieve port description with the IO mode: GvPortIO
[in] id The port ID.
[in] pd Filled with the port description. The caller owns the pointed GvPortDescription .
返回
true if successful, otherwise false .

◆  iCreateOperator()

virtual Bool iCreateOperator ( GvNode bn )
virtual

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

virtual Bool iCreateOperator ( GvNode *bn) { BaseContainer *bc = bn-> GetOpContainerInstance (); if (!bc) return false ; return SUPER::iCreateOperator(bn); }
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] lock_only true to lock only.
返回
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.

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

◆  GetDetailedText()

virtual const String GetDetailedText ( GvNode bn )
virtual

Called to retrieve the detailed text for the operator. The easiest way is to just return GvGetOperatorDetailedText (this, bn).

另请参阅
GvGetOperatorDetailedText()
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
返回
The operator detailed text.

◆  GetText()

virtual const String GetText ( GvNode bn )
virtual

Called to retrieve the text for the operator.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
返回
The operator text.

◆  GetTitle()

virtual const String GetTitle ( GvNode bn )
virtual

Called to retrieve the title of the operator. The easiest way is to just return GvGetOperatorTitle (this, bn).

另请参阅
GvGetOperatorTitle()
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
返回
The operator title.

◆  GetPortIcon()

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

Called to provide an icon for a port.

注意
Currently this is not used anywhere.
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] id The port ID.
[in] layout_type The layout type: GvLayoutType
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[out] width Assign the default width in pixels.
[out] height Assign the default height in pixels.

◆  GetBodyColor()

virtual const 向量 GetBodyColor ( GvNode bn )
virtual

Called to give a default body color for the operator.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
返回
The default body color.

◆  GetOperatorDescription()

virtual Bool GetOperatorDescription ( GvNode bn ,
GvOperatorDescription od  
)
virtual

Called to set operator flags in od .

注意
This is for future extensions. Currently all flags that affect the node are static and set with GvRegisterOperatorPlugin() .
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[out] od The operator description. The caller owns the pointed GvOperatorDescription .
返回
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.
使用 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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] gui The current GUI. The caller owns the pointed GvNodeGUI .
[in] da The user area to draw in. The caller owns the pointed GeUserArea .
[in] x1 The upper left X coordinate.
[in] y1 The upper left Y coordinate.
[in] x2 The lower right X coordinate.
[in] y2 The 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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] bd The BaseDraw object for the active editor view. Cinema 4D owns the pointed BaseDraw .
[in] bh The BaseDrawHelp object for the active editor view. Cinema 4D owns the pointed BaseDrawHelp .
[in] bt The calling thread. Cinema 4D owns the pointed BaseThread .
[in] flags The pass: SCENEHOOKDRAW
[in] data The user defined data passed to GvNodeMaster::AddToDrawList() ,或 nullptr .
[in] counter This counter is increased on every InitCalculation() . It helps determine when the GvNodeMaster::AddToDrawList() occurred. The counter will be the same for every SceneDraw() .
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] gui The node GUI. The caller owns the pointed GvNodeGUI .
[in] x The mouse X coordinate.
[in] y The mouse Y coordinate.
[in] chn The mouse channel: BFM_INPUT_CHANNEL
[in] qua A bitmask with the qualifiers at the time when the mouse event occurred: QUALIFIERS
[in] msg The original message. See Input Events .
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] gui The node GUI. The caller owns the pointed GvNodeGUI .
返回
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 .

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[out] query The query parameter. The caller owns the pointed GvQuery .
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] calc The current calculation helper. The caller owns the pointed GvCalc .
[in] run The current run helper. The caller owns the pointed GvRun .
返回
true if calculation was initialized, otherwise false .

◆  FreeCalculation()

virtual void FreeCalculation ( GvNode bn ,
GvCalc calc  
)
virtual

Called after the calculation is finished.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] calc The 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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] port If 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] run The current run helper. The caller owns the pointed GvRun .
[in] calc The current calculation helper. The caller owns the pointed GvCalc .
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] run The current run helper. The caller owns the pointed GvRun .
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] port The port that was invalidated.
[in] run The current run helper. The caller owns the pointed GvRun .
[in] force_set true the recalculation is forced even if the data is already updated.
返回
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.

注意
Overload IsSetDataAllowed() to specify what kinds of data is accepted.
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] type The data type: GvDataType
[in] data The data pointer. The format depends on type .
[in] mode The mode: GvOpSetDataMode
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] type The data type: GvDataType
[in] data The data pointer. The format depends on type .
[in] mode The mode: GvOpSetDataMode
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[out] menu The menu container to add entries to.
[in] port_id The port ID.
[in] first_menu_id The first menu item ID.
返回
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() .

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] menu_id The menu item ID.
[in] port_id The port ID.
[in] mx The mouse X coordinate.
[in] my The mouse Y coordinate.
返回
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.

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[out] menu The menu container to add entries to.
[in] first_menu_id The first menu item ID.
返回
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() .

参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] menu_id The menu item ID.
[in] mx The mouse X coordinate.
[in] my The mouse Y coordinate.
返回
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);
另请参阅
ShowPopupMenu() for the name formatting.
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[out] names The container with the menu entries.
[out] ids The container for the translation between menu ID and port ID.
[in] value_type The value type for drag-and-drop, or ID_GV_VALUE_TYPE_NONE if this is not a drag-and-drop action.
[in] port The IO mode: GvPortIO
[in] first_menu_id The first menu item ID.
返回
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.

注意
Currently this function is not called.
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] error The error ID.
返回
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 .

注意
Normally it is not need to implement this method. It is currently only used by the object node.
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] io The IO mode: GvPortIO
[in] desc_id The description ID.
返回
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 .

注意
Normally it is not need to implement this method. It is currently only used by the object node.
参数
[in] bn Equal to static_cast< GvNode *>-> Get() . Provided for speed and convenience. Cinema 4D owns the pointed node.
[in] io The IO mode: GvPortIO
[in] main_id The main ID.
返回
The description ID.
GvOperatorData::iCreateOperator
virtual Bool iCreateOperator(GvNode *bn)
GvNode::GetOpContainerInstance
BaseContainer * GetOpContainerInstance(void)
定义: c4d_graphview.h:766
BaseContainer::SetBool
void SetBool(Int32 id, Bool b)
定义: c4d_basecontainer.h:498
GeListNode
Represents a C4DAtom that resides in a 4D list.
定义: c4d_baselist.h:1767
BaseContainer::SetFloat
void SetFloat(Int32 id, Float r)
定义: c4d_basecontainer.h:533
Bool
maxon::Bool Bool
定义: ge_sys_math.h:53
GvNode
定义: c4d_graphview.h:428
BaseContainer
定义: c4d_basecontainer.h:46