A portgroup is a group of Port
objects on an
Operator. The port group is a logical grouping of multiple port
connections that are normally scoped by an
X3DObject. A single portgroup can contain both InputPort
and OutputPort
objects.
- Note:
- The PortGroup object should not be confused with the Group
object.
You can determine the number of port groups defined by an
operator using the Operator::GetNumPortGroups
function and determine the number of ports in a PortGroup using the
Operator::GetNumPortsInGroup
function.
For built-in Operators the port groups contain all ports that
will be connected to parts of the selected or picked object. For
example, when the Twist operator is applied to a selected object,
the operator has ports that read from the object's local
KinematicState and
Geometry and write to the result object's geometry.
However, for typical Self-Installed Custom Operators, all
outputs and inputs can be in a single
PortGroup because the individual targets for each port are
specifically provided at the time of calls to
CustomOperator::AddInputPort or the AddCustomOp command. In
fact, the concept of
PortGroup can be completely ignored for most custom operators.
However any dynamic input inside an advanced operators should be in
its own
PortGroup to permit usage of Operator::ConnectToGroup.
Multiple objects can connect to the same port group, for
example, the loft operator may read from many curves to generate
the resulting mesh. Each of these input curves are connected to the
same port group and each connection is called a port group
instance. You can determine the number of objects connected to a
port group by using Operator::GetNumInstancesInGroup
or PortGroup::GetInstanceCount.
Use SIObject::GetParent
to get the
Operator for this
PortGroup and SIObject::GetName
to get the name of this port group.
From the port you can determine which port group a port belongs
to using the Port::GetGroupName
or Port::GetGroupIndex
functions. You can determine which port group instance a port
belongs to using the Port::GetGroupInstance
function.
- See also:
-
Operator,
OperatorContext,
SIObject,
InputPort, OutputPort
- Since:
- 4.0
Public Member Functions
|
|
PortGroup
() |
|
~PortGroup
() |
|
PortGroup
(const CRef
&in_ref) |
|
PortGroup
(const PortGroup &in_obj) |
bool |
IsA
(siClassID
in_ClassID) const |
siClassID |
GetClassID
() const |
PortGroup & |
operator=
(const PortGroup &in_obj) |
PortGroup & |
operator=
(const CRef
&in_ref) |
bool |
IsOptional
(LONG in_port=-1) const |
LONG |
GetIndex
() const |
LONG |
GetMin
() const |
LONG |
GetMax
() const |
LONG |
GetFlags
() const |
CString |
GetPickPrompt
() const |
CString |
GetFilter
() const |
CRefArray |
GetPorts
() const |
LONG |
GetInstanceCount
() const |
bool |
SupportsBranchGroup
(LONG in_port=-1) const |
CRef |
AddInputPort
(const CRef
&target, const CString &name=CString(), LONG insertat=-1,
LONG flags=0, CStatus *pst=0) |
CRef |
AddOutputPort
(const CRef
&target, const CString &name=CString(), LONG insertat=-1,
LONG flags=0, CStatus *pst=0) |
CRefArray |
AddIOPort
(const CRef
&target, const CString &name=CString(), LONG insertat=-1,
LONG flags=0, CStatus *pst=0) |