Easily obtain child nodes in the Exchange data model based on object type.
More...
|
using | ts3d::InstancePath = EntityArray |
| The InstancePath type is used to identify a particular path through the hierarchy of Exchange objects to reach a particular entity. The path to an entity is important because it provides additional context for how attributes and behaviors of the leaf nodes should be presented. EntityArray is an alias for a standard container of A3DEntity* values.
|
|
using | ts3d::InstancePathArray = std::vector< InstancePath > |
| Used as a collection of InstancePath objects. When you ask for all leaf nodes of a particular leaf node type, the result is stored in an InstancePathArray. See getLeafInstances.
|
|
using | ts3d::InstancePathMap = std::unordered_map< A3DEntity *, InstancePathArray > |
| Used for looking up instance path for a given unique child.
|
|
Easily obtain child nodes in the Exchange data model based on object type.
- See also
- Product Traversal
ts3d::EntityArray ts3d::getChildren |
( |
A3DEntity * |
parent, |
|
|
A3DEEntityType const & |
child_type |
|
) |
| |
|
inlinestatic |
Gets all immediate children (if any) of a specified type from a parent object.
- Parameters
-
parent | Object that will be queried to obtain children |
child_type | The types of the child objects desired |
- Returns
- An ordered collection of child objects of type
child_type
Returns an array of instance paths, each with a leaf entity type corresponding to leaf_type
.
The top level object provided by the parameter owner
is traversed (recursively as needed) to obtain all leaf instances. Each instance path in the returned instance path array will be unique, however there may be multiple paths that lead to the same object. This occurs when a part is shared by multiple assemblies. If your workflow requires unique leaf entities (such as parts) and an array of instances paths that lead to each child, use the function getUniqueLeafEntities() instead.
- Parameters
-
owner | The top level object to begin traversal. |
leaf_type | The type of child node to look for. |
- Returns
- A collection of instance path objects which define a specific path. through the object hierarchy, beginning with the specified
owner
. The final object in each array will be of type leaf_type
.
Easily obtain a subset of an InstancePath with a final node of a specific type.
- Parameters
-
instance_path | The instance path to obtain the parent for |
owner_type | The type of owner to search for |
- Returns
- An instance path whose last object is of type
owner_type
. Or empty if to owning type is found.
ts3d::EntitySet ts3d::getUniqueLeafEntities |
( |
A3DEntity * |
owner, |
|
|
A3DEEntityType const & |
leaf_type |
|
) |
| |
|
inlinestatic |
Returns a set of A3DEntity
pointers that are unique leaf entities of type leaf_type of the provided owner.
- Parameters
-
owner | A pointer to a top level object which will be traversed. |
leaf_type | The type of child object that should be searched for. |
- Returns
- A set of all unique leaf entities of type
leaf_type
.
Returns a set of A3DEntity
pointers that are unique leaf entities and all the instance paths referencing each child.
- Parameters
-
owner | A pointer to a top level object which will be traversed. |
leaf_type | The type of child object that should be searched for. |
instance_path_map | A map containing the collection for all paths referencing each unique child occurrence. |
- Returns
- A set of all unique leaf entities of type
leaf_type
. The values from this set should be used to obtain the referencing paths from the instance_path_map
.