GvPort Class Reference Graph View

#include <c4d_graphview.h>

详细描述

There are three kinds of port IDs:

Cannot be instantiated. Call GvNode::AddPort() to create a port.

私有成员函数

  GvPort ()
  ~GvPort ()

Connections

void  RemoveConnection (void)
Int32   GetNrOfConnections (void)
void  RemovePortConnections (void)
Bool   IsIncomingConnected (void)
Bool   GetIncomingDestination ( GvNode *&node, GvPort *&port)
Bool   GetIncomingSource ( GvNode *&node, GvPort *&port)

Port IDs

GvPortIO   GetIO (void)
void  SetMainID ( Int32 id)
Int32   GetMainID (void)
Int32   GetSubID (void)
void  SetUserID ( Int32 id)
Int32   GetUserID (void)

ValueType/Visible/Valid

GvValueID   GetValueType (void)
void  SetVisible ( Bool v)
Bool   GetVisible (void)
void  SetValid ( GvRun *r, Bool v)
Bool   GetValid ( GvRun *r)

Calculate

void  SetCalculated ( GvRun *r)
GvPort Calculate ( GvNode *bn, GvRun *r, GvCalc *c)
Bool   SetRecalculate ( GvRun *r, Bool force_set=false)

Get Value

Bool   GetBool ( Bool *b, GvRun *r)
Bool   GetInteger ( Int32 *i, GvRun *r)
Bool   GetFloat ( Float *f, GvRun *r)
Bool   GetVector ( 向量 *v, GvRun *r)
Bool   GetNormal ( 向量 *n, GvRun *r)
Bool   GetMatrix ( 矩阵 *m, GvRun *r)
Bool   GetTime ( BaseTime *t, GvRun *r)
Bool   GetString ( String *s, GvRun *r)
Bool   GetObject ( BaseList2D *&o, GvRun *r)
Bool   GetData (void *d, GvValueID type, GvRun *r)
Bool   GetDataInstance (const void *&d, GvValueID type, GvRun *r)

Set Value

Bool   SetBool ( Bool b, GvRun *r)
Bool   SetInteger ( Int32 i, GvRun *r)
Bool   SetFloat ( Float f, GvRun *r)
Bool   SetVector (const 向量 &v, GvRun *r)
Bool   SetMatrix (const 矩阵 &m, GvRun *r)
Bool   SetNormal (const 向量 &n, GvRun *r)
Bool   SetTime (const BaseTime &t, GvRun *r)
Bool   SetString (const maxon::String &s, GvRun *r)
Bool   SetObject (const BaseList2D *o, GvRun *r)
Bool   SetData (const void *d, GvValueID type, GvRun *r)
const String   GetName ( GvNode *node)
void  SetName (const maxon::String &name)

Copy Data

Bool   CopyPortData ( GvPort *source, GvRun *r)
Bool   CopyRawData (void *source, GvRun *r)

Calculate Data

Bool   CalculateRawData (void *data, void *dest, GvRun *r, GvValueFlags calculation, Float parm1=0.0_f)
Bool   CalculateRawRawData (void *data1, void *data2, void *dest, GvRun *r, GvValueFlags calculation, Float parm1=0.0_f)
Bool   CalculatePortData ( GvPort *data, void *dest, GvRun *r, GvValueFlags calculation, Float parm1=0.0_f)
Bool   CalculateRawDataRev (void *data, void *dest, GvRun *r, GvValueFlags calculation, Float parm1=0.0_f)

Get/Set Tag/Material/Instance/Object

Bool   GetTag ( BaseList2D *&t, GvRun *r, Int32 *index=nullptr)
Bool   SetTag (const BaseList2D *const t, GvRun *r, Int32 index=0)
Bool   GetMaterial ( BaseList2D *&m, GvRun *r, Int32 *index=nullptr)
Bool   SetMaterial (const BaseList2D *const m, GvRun *r, Int32 index=0)
Bool   GetInstance ( BaseList2D *&i, GvRun *r, Int32 *index=nullptr)
Bool   SetInstance (const BaseList2D *const i, GvRun *r, Int32 index=0)
Bool   GetObjectWithIndex ( BaseList2D *&o, GvRun *r, Int32 *index=nullptr)
Bool   SetObjectWithIndex (const BaseList2D *const o, GvRun *r, Int32 index=0)

Outgoing/Destination Information

GvDestination GetOutgoing ( Int32 index)

用户数据

GeData GetUserData ()
void  SetUserData (const GeData &data)

构造函数 & 析构函数文档编制

◆  GvPort()

GvPort () private

◆  ~GvPort()

~ GvPort () private

成员函数文档编制

◆  RemoveConnection()

void RemoveConnection ( void  )

Removes the incoming connection.

◆  GetNrOfConnections()

Int32 GetNrOfConnections ( void  )

Gets the number of connections, including both the incoming and outgoing connections.

返回
The number of connections.

◆  RemovePortConnections()

void RemovePortConnections ( void  )

Removes all outgoing connections.

◆  IsIncomingConnected()

Bool IsIncomingConnected ( void  )

Checks if there is an incoming connection.

返回
true if there is an incoming connection to the port, otherwise false .

◆  GetIncomingDestination()

Bool GetIncomingDestination ( GvNode *&  node ,
GvPort *&  port  
)

Gets the destination of the incoming connection.

参数
[out] node Assigned the incoming destination node.
[out] port Assigned the incoming destination port.
返回
true if the incoming destination was retrieved, otherwise false .

◆  GetIncomingSource()

Bool GetIncomingSource ( GvNode *&  node ,
GvPort *&  port  
)

Gets the source of the incoming connection.

参数
[out] node Assigned the incoming source node.
[out] port Assigned the incoming source port.
返回
true if the incoming source was retrieved, otherwise false .

◆  GetIO()

GvPortIO GetIO ( void  )

Gets the IO mode for the port.

返回
The IO mode: GvPortIO

◆  SetMainID()

void SetMainID ( Int32   id )

Sets the main ID of the port.

参数
[in] id The main ID to set.

◆  GetMainID()

Int32 GetMainID ( void  )

Gets the main ID of the port.

返回
The main ID.

◆  GetSubID()

Int32 GetSubID ( void  )

Gets the sub ID of the port.

返回
The sub ID.

◆  SetUserID()

void SetUserID ( Int32   id )

Sets the user ID of the port.

参数
[in] id The user ID to set.

◆  GetUserID()

Int32 GetUserID ( void  )

Gets the user ID of the port.

返回
The user ID.

◆  GetValueType()

GvValueID GetValueType ( void  )

Gets the value type of the port.

返回
The value type.

◆  SetVisible()

void SetVisible ( Bool   v )

Hides or shows the port.

参数
[in] v true if the port should be visible and false if it should be hidden.

◆  GetVisible()

Bool GetVisible ( void  )

Checks if the port is hidden or visible.

返回
true if the port is visible and false if it is hidden.

◆  SetValid()

void SetValid ( GvRun r ,
Bool   v  
)

Reports this port as valid or invalid during a run.

参数
[in] r The run helper. The caller owns the pointed run helper.
[in] v true if the port is valid, otherwise false .

◆  GetValid()

Bool GetValid ( GvRun r )

Checks if the port is valid during a run.

参数
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the port is valid, otherwise false .

◆  SetCalculated()

void SetCalculated ( GvRun r )

Reports that this port has been calculated in this run.

参数
[in] r The run helper. The caller owns the pointed run helper.

◆  Calculate()

GvPort * Calculate ( GvNode bn ,
GvRun r ,
GvCalc c  
)

Calculates the port.

注意
Calculate() should normally not be used. Use GvValue::Calculate() instead.
参数
[in] bn The node that the ports belongs to. The caller owns the pointed node.
[in] r The run helper. The caller owns the pointed run helper.
[in] c The calculation helper. The caller owns the pointed calculation helper.
返回
The calculated port.

◆  SetRecalculate()

Bool SetRecalculate ( GvRun r ,
Bool   force_set = false  
)

Marks all outgoing port connections for recalculation. This will also call GvOperatorData::SetRecalculate() .

参数
[in] r The run helper. The caller owns the pointed run helper.
[in] force_set Forces all nodes to be recalculated, even if they seem to be valid.
返回
true if successful, otherwise false .

◆  GetBool()

Bool GetBool ( Bool b ,
GvRun r  
)

Retrieves a boolean value from the port.

参数
[out] b Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetInteger()

Bool GetInteger ( Int32 i ,
GvRun r  
)

Retrieves an integer value from the port.

参数
[out] i Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetFloat()

Bool GetFloat ( Float f ,
GvRun r  
)

Retrieves a float value from the port.

参数
[out] f Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetVector()

Bool GetVector ( 向量 v ,
GvRun r  
)

Retrieves a vector value from the port.

参数
[out] v Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetNormal()

Bool GetNormal ( 向量 n ,
GvRun r  
)

Retrieves a normal vector value from the port.

参数
[out] n Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetMatrix()

Bool GetMatrix ( 矩阵 m ,
GvRun r  
)

Retrieves a matrix value from the port.

参数
[out] m Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetTime()

Bool GetTime ( BaseTime t ,
GvRun r  
)

Retrieves a time value from the port.

参数
[out] t Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetString()

Bool GetString ( String s ,
GvRun r  
)

Retrieves a string value from the port.

参数
[out] s Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetObject()

Bool GetObject ( BaseList2D *&  o ,
GvRun r  
)

Retrieves an object value from the port.

参数
[out] o Assigned the port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetData()

Bool GetData ( void *  d ,
GvValueID   type ,
GvRun r  
)

Retrieves the data from the port.

参数
[out] d Assigned the port value. The port owns the pointed data.
Points to GV data. The layout of the pointed data is determined by type .
[in] type Determines the type of d .
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  GetDataInstance()

Bool GetDataInstance ( const void *&  d ,
GvValueID   type ,
GvRun r  
)

Retrieves the data pointer from the port.

参数
[out] d Assigned a pointer to the port data. The port owns the pointed data.
Points to GV data. The layout of the pointed data is determined by type .
[in] type Determines the type of d .
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was retrieved, otherwise false .

◆  SetBool()

Bool SetBool ( Bool   b ,
GvRun r  
)

Sets a boolean value in the port.

参数
[in] b The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetInteger()

Bool SetInteger ( Int32   i ,
GvRun r  
)

Sets an integer value in the port.

参数
[in] i The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetFloat()

Bool SetFloat ( Float   f ,
GvRun r  
)

Sets a float value in the port.

参数
[in] f The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetVector()

Bool SetVector ( const 向量 v ,
GvRun r  
)

Sets a vector value in the port.

参数
[in] v The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetMatrix()

Bool SetMatrix ( const 矩阵 m ,
GvRun r  
)

Sets a matrix value in the port.

参数
[in] m The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetNormal()

Bool SetNormal ( const 向量 n ,
GvRun r  
)

Sets a normal vector value in the port.

参数
[in] n The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetTime()

Bool SetTime ( const BaseTime t ,
GvRun r  
)

Sets a time value in the port.

参数
[in] t The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetString()

Bool SetString ( const maxon::String s ,
GvRun r  
)

Sets a string value in the port.

参数
[in] s The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetObject()

Bool SetObject ( const BaseList2D o ,
GvRun r  
)

Sets an object value in the port.

参数
[in] o The new port value.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  SetData()

Bool SetData ( const void *  d ,
GvValueID   type ,
GvRun r  
)

Sets the data in the port.

参数
[in] d The new port value. The port owns the pointed data.
Points to GV data. The layout of the pointed data is determined by type .
[in] type Determines the type of d .
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the value was set, otherwise false .

◆  GetName()

const String GetName ( GvNode node )

Gets the name of the port.

参数
[in] node The node the ports belongs to. The caller owns the pointed node.
返回
The port name.

◆  SetName()

void SetName ( const maxon::String name )

Sets the name of the port.

参数
[in] name The new port name.

◆  CopyPortData()

Bool CopyPortData ( GvPort source ,
GvRun r  
)

Copies the data from the source port.

参数
[in] source The source port. The caller owns the pointed port.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the data was copied, otherwise false .

◆  CopyRawData()

Bool CopyRawData ( void *  source ,
GvRun r  
)

Copies the raw void* data from source .

参数
[in] source The source data. The caller owns the pointed data.
[in] r The run helper. The caller owns the pointed run helper.
返回
true if the raw data was copied, otherwise false .

◆  CalculateRawData()

Bool CalculateRawData ( void *  data ,
void *  dest ,
GvRun r ,
GvValueFlags   calculation ,
Float   parm1 = 0.0_f  
)

Convenience function to do calculation with unknown data.
Uses the port's value handler to call GV_VALUE_HANDLER::Calculate (userdata, value_id, portdata, data , dest , 0, calculation , parm1 ), where portdata is the data of the port.
For example, the result operator does:

if (!v1->GetPort()->CalculateRawData( nullptr , &result, r, GV_CALC_STR )) return false ;
参数
[in] data The second data. This port data is used as first data. The caller owns the pointed data.
[out] dest The destination. The caller owns the pointed data.
Points to GV data. The layout of the pointed data is determined by value_id .
[in] r The run helper. The caller owns the pointed run helper.
[in] calculation The calculation to perform: GvValueFlags
[in] parm1 An additional parameter.
返回
true if the result is GV_CALC_ERR_NONE , otherwise false . If there is an error GvRun::SetError() is called.

◆  CalculateRawRawData()

Bool CalculateRawRawData ( void *  data1 ,
void *  data2 ,
void *  dest ,
GvRun r ,
GvValueFlags   calculation ,
Float   parm1 = 0.0_f  
)

Convenience function to do calculation with unknown data.
Uses the port's value handler to call GV_VALUE_HANDLER::Calculate (userdata, value_id, data1 , data2 , dest , 0, calculation , parm1 ).

参数
[in] data1 The first data. The caller owns the pointed data.
Points to GV data. The layout of the pointed data is determined by value_id .
[in] data2 The second data. The caller owns the pointed data.
Points to GV data. The layout of the pointed data is determined by value_id .
[out] dest The destination. The caller owns the pointed data.
Points to GV data. The layout of the pointed data is determined by value_id .
[in] r The run helper. The caller owns the pointed run helper.
[in] calculation The calculation to perform: GvValueFlags
[in] parm1 An additional parameter.
返回
true if the result is GV_CALC_ERR_NONE , otherwise false . If there is an error GvRun::SetError() is called.

◆  CalculatePortData()

Bool CalculatePortData ( GvPort data ,
void *  dest ,
GvRun r ,
GvValueFlags   calculation ,
Float   parm1 = 0.0_f  
)

Convenience function to do calculation with unknown data.
Uses the port's value handler to call GV_VALUE_HANDLER::Calculate (userdata, value_id, portdata1, portdata2, dest , 0, calculation , parm1 ), where portdata1 is the data of the port and portdata2 is the data of the data port.

参数
[in] data The port with the second data. This port data is used as first data. The caller owns the pointed port.
[out] dest The destination. The caller owns the pointed data.
Points to GV data. The layout of the pointed data is determined by value_id .
[in] r The run helper. The caller owns the pointed run helper.
[in] calculation The calculation to perform: GvValueFlags
[in] parm1 An additional parameter.
返回
true if the result is GV_CALC_ERR_NONE , otherwise false . If there is an error GvRun::SetError() is called.

◆  CalculateRawDataRev()

Bool CalculateRawDataRev ( void *  data ,
void *  dest ,
GvRun r ,
GvValueFlags   calculation ,
Float   parm1 = 0.0_f  
)

Convenience function to do calculation with unknown data.
Uses the port's value handler to call GV_VALUE_HANDLER::Calculate (userdata, value_id, data, portdata, dest , 0, calculation , parm1 ), where portdata is the data of the port.

参数
[in] data The first data. This port data is used as second data. The caller owns the pointed data.
[out] dest The destination. The caller owns the pointed data.
Points to GV data. The layout of the pointed data is determined by value_id .
[in] r The run helper. The caller owns the pointed run helper.
[in] calculation The calculation to perform: GvValueFlags
[in] parm1 An additional parameter.
返回
true if the result is GV_CALC_ERR_NONE , otherwise false . If there is an error GvRun::SetError() is called.

◆  GetTag()

Bool GetTag ( BaseList2D *&  t ,
GvRun r ,
Int32 index = nullptr  
)

Retrieves an indexed tag value from the port.

参数
[out] t Assigned the retrieved tag if successful.
[in] r The run helper. The caller owns the pointed run helper.
[out] index Assigned the index of the data, if not nullptr . Used by iterators to specify the index of the retrieved data.
返回
true if the tag was retrieved, otherwise false .

◆  SetTag()

Bool SetTag ( const BaseList2D *const  t ,
GvRun r ,
Int32   index = 0  
)

Sets an indexed tag value in the port.

参数
[in] t The tag to set. The caller owns the pointed tag.
[in] r The run helper. The caller owns the pointed run helper.
[in] index The data index. Used by iterators.
返回
true if the tag was set, otherwise false .

◆  GetMaterial()

Bool GetMaterial ( BaseList2D *&  m ,
GvRun r ,
Int32 index = nullptr  
)

Retrieves an indexed material value from the port.

参数
[out] m Assigned the retrieved material if successful.
[in] r The run helper. The caller owns the pointed run helper.
[out] index Assigned the index of the data, if not nullptr . Used by iterators to specify the index of the retrieved data.
返回
true if the material was retrieved, otherwise false .

◆  SetMaterial()

Bool SetMaterial ( const BaseList2D *const  m ,
GvRun r ,
Int32   index = 0  
)

Sets an indexed material value in the port.

参数
[in] m The material to set. The caller owns the pointed material.
[in] r The run helper. The caller owns the pointed run helper.
[in] index The data index. Used by iterators.
返回
true if the material was set, otherwise false .

◆  GetInstance()

Bool GetInstance ( BaseList2D *&  i ,
GvRun r ,
Int32 index = nullptr  
)

Retrieves an indexed instance value from the port.

参数
[out] i Assigned the retrieved instance if successful.
[in] r The run helper. The caller owns the pointed run helper.
[out] index Assigned the index of the data, if not nullptr . Used by iterators to specify the index of the retrieved data.
返回
true if the instance was retrieved, otherwise false .

◆  SetInstance()

Bool SetInstance ( const BaseList2D *const  i ,
GvRun r ,
Int32   index = 0  
)

Sets an indexed instance value in the port.

参数
[in] i The instance to set. The caller owns the pointed instance.
[in] r The run helper. The caller owns the pointed run helper.
[in] index The data index. Used by iterators.
返回
true if the instance was set, otherwise false .

◆  GetObjectWithIndex()

Bool GetObjectWithIndex ( BaseList2D *&  o ,
GvRun r ,
Int32 index = nullptr  
)

Retrieves an indexed object value from the port.

参数
[out] o Assigned the retrieved object if successful.
[in] r The run helper. The caller owns the pointed run helper.
[out] index Assigned the index of the data, if not nullptr . Used by iterators to specify the index of the retrieved data.
返回
true if the object was retrieved, otherwise false .

◆  SetObjectWithIndex()

Bool SetObjectWithIndex ( const BaseList2D *const  o ,
GvRun r ,
Int32   index = 0  
)

Sets an indexed object value in the port.

参数
[in] o The object to set. The caller owns the pointed object.
[in] r The run helper. The caller owns the pointed run helper.
[in] index The data index. Used by iterators.
返回
true if the object was set, otherwise false .

◆  GetOutgoing()

GvDestination * GetOutgoing ( Int32   index )

Retrieves information about the outgoing destinations.

参数
[in] index The destination index: 0 <= index < GetNrOfConnections() -( IsIncomingConnected() ? 1 : 0 )
返回
The destination information, or nullptr . Cinema 4D owns the pointed GvDestination .

◆  GetUserData()

GeData * GetUserData ( )

Internal .

由于
R17.032

◆  SetUserData()

void SetUserData ( const GeData data )

Internal .

由于
R17.032
GV_CALC_STR
@ GV_CALC_STR
Print: *((String*)dest) = String(source1[cpu_id])
定义: c4d_graphview_enum.h:69