-
首页
-
C4D R23.110 C++ SDK
#include <c4d_graphview.h>
详细描述
There are three kinds of port IDs:
-
Main: The type of the port, for example
GV_FORMULA_INPUT
in
GVformula
.
-
Sub: A unique ID for each instance of multiple ports with the same Main ID. Assigned when the port is created.
-
User: A place to store an ID for custom management.
Cinema 4D
ignores this value.
Cannot be instantiated. Call
GvNode::AddPort()
to create a port.
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)
|
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)
|
构造函数 & 析构函数文档编制
◆
GvPort()
◆
~GvPort()
成员函数文档编制
◆
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()
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()
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()
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()
Gets the main ID of the port.
-
返回
-
The main ID.
◆
GetSubID()
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()
Gets the user ID of the port.
-
返回
-
The user ID.
◆
GetValueType()
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()
Checks if the port is hidden or visible.
-
返回
-
true
if the port is visible and
false
if it is hidden.
◆
SetValid()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
Gets the name of the port.
-
参数
-
[in]
|
node
|
The node the ports belongs to. The caller owns the pointed node.
|
-
返回
-
The port name.
◆
SetName()
Sets the name of the port.
-
参数
-
[in]
|
name
|
The new port name.
|
◆
CopyPortData()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
Retrieves information about the outgoing destinations.
-
参数
-
-
返回
-
The destination information, or
nullptr
.
Cinema 4D
owns the pointed
GvDestination
.
◆
GetUserData()
Internal
.
-
由于
-
R17.032
◆
SetUserData()
void SetUserData
|
(
|
const
GeData
&
|
data
|
)
|
|
Internal
.
-
由于
-
R17.032
@ GV_CALC_STR
Print: *((String*)dest) = String(source1[cpu_id])
定义:
c4d_graphview_enum.h:69