GvValue Class Reference

#include <c4d_graphview.h>

Detailed Description

Calculation interface for a port main ID. Used by the convenience functions, for example GvBuildValuesTable().

Note
Cannot be instantiated. Use GvNode::AllocCalculationHandler() to allocate it and GvNode::FreeCalculationHandler() to destroy it.

Public Member Functions

Bool Calculate (GvNode *node, GvPortIO io, GvRun *r, GvCalc *c, Int32 index=0, BaseTime *time=nullptr)
 
Bool IsConnected (Int32 index)
 
Bool IsPort ()
 
Int32 NrOfPorts ()
 
GvValueID GetValueID ()
 
Int32 GetMainID ()
 
GvPortGetPort (Int32 index=0)
 

Private Member Functions

 GvValue ()
 
 ~GvValue ()
 

Constructor & Destructor Documentation

◆ GvValue()

GvValue ( )
private

◆ ~GvValue()

~GvValue ( )
private

Member Function Documentation

◆ Calculate()

Bool Calculate ( GvNode node,
GvPortIO  io,
GvRun r,
GvCalc c,
Int32  index = 0,
BaseTime time = nullptr 
)

Calculates all ports of the value. This is the recommended method for calculating ports. After a port has been calculated you can get the value with the various functions in GvPort.

Note
This function is not equivalent to GvPort::Calculate().
Parameters
[in]nodeThe node that the ports of this value belongs to. The caller owns the pointed node.
[in]ioCurrently not used.
[in]rThe run helper. The caller owns the pointed run helper.
[in]cThe calculation helper. The caller owns the pointed calculation helper.
[in]indexThe port index or GV_MULTIPLE_PORTS to calculate all ports: 0 <= index < NrOfPorts()
[in]timeIf not nullptr animation tracks of the node are evaluated before the calculation.
Returns
true if the value was calculated, otherwise false.

◆ IsConnected()

Bool IsConnected ( Int32  index)

Checks if any port of the value is connected. This is equivalent to a || over all GetPort(index)->GvPort::IsIncomingConnected().

Parameters
[in]indexThe port index: 0 <= index < NrOfPorts()
Returns
true if the port is connected, otherwise false.

◆ IsPort()

Bool IsPort ( )

Checks if there are any ports in the value.

Returns
true if if NrOfPorts() > 0, otherwise false.

◆ NrOfPorts()

Int32 NrOfPorts ( )

The number of ports in this value.

Returns
The port count.

◆ GetValueID()

GvValueID GetValueID ( )

The value ID of the managed ports. For all 0 <= index < NrOfPorts() this is equal to GetPort(index)->GvPort::GetValueType GetValueType(). (Well defined since all ports are of the same type in a GvValue.)

Returns
The value ID.

◆ GetMainID()

Int32 GetMainID ( )

The main ID of the managed ports. For all 0 <= index < NrOfPorts() this is equal to GetPort(index)->GvPort::GetMainID GetMainID(). (Well defined since all ports are of the same type in a GvValue.)

Returns
The main ID.

◆ GetPort()

GvPort* GetPort ( Int32  index = 0)

Retrieves a port by index.

Parameters
[in]indexThe port index: 0 <= index < NrOfPorts()
Returns
The retrieved port. The node owns the pointed port.