Exchange Toolkit
Typedefs | Functions
Product Traversal

Easily obtain child nodes in the Exchange data model based on object type. More...

Typedefs

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.
 

Functions

static InstancePathArray ts3d::getLeafInstances (A3DEntity *owner, A3DEEntityType const &leaf_type)
 Returns an array of instance paths, each with a leaf entity type corresponding to leaf_type. More...
 
static EntitySet ts3d::getUniqueLeafEntities (A3DEntity *owner, A3DEEntityType const &leaf_type)
 Returns a set of A3DEntity pointers that are unique leaf entities of type leaf_type of the provided owner. More...
 
static EntitySet ts3d::getUniqueLeafEntities (A3DEntity *owner, A3DEEntityType const &leaf_type, InstancePathMap &instance_path_map)
 Returns a set of A3DEntity pointers that are unique leaf entities and all the instance paths referencing each child. More...
 
static InstancePath ts3d::getOwningInstance (InstancePath const &instance_path, A3DEEntityType const &owner_type)
 Easily obtain a subset of an InstancePath with a final node of a specific type. More...
 
static EntityArray ts3d::getChildren (A3DEntity *parent, A3DEEntityType const &child_type)
 Gets all immediate children (if any) of a specified type from a parent object. More...
 

Detailed Description

Easily obtain child nodes in the Exchange data model based on object type.

See also
Product Traversal

Function Documentation

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
parentObject that will be queried to obtain children
child_typeThe types of the child objects desired
Returns
An ordered collection of child objects of type child_type
ts3d::InstancePathArray ts3d::getLeafInstances ( A3DEntity *  owner,
A3DEEntityType const &  leaf_type 
)
static

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
ownerThe top level object to begin traversal.
leaf_typeThe 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.
ts3d::InstancePath ts3d::getOwningInstance ( InstancePath const &  instance_path,
A3DEEntityType const &  owner_type 
)
inlinestatic

Easily obtain a subset of an InstancePath with a final node of a specific type.

Parameters
instance_pathThe instance path to obtain the parent for
owner_typeThe 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
ownerA pointer to a top level object which will be traversed.
leaf_typeThe type of child object that should be searched for.
Returns
A set of all unique leaf entities of type leaf_type.
ts3d::EntitySet ts3d::getUniqueLeafEntities ( A3DEntity *  owner,
A3DEEntityType const &  leaf_type,
InstancePathMap instance_path_map 
)
inlinestatic

Returns a set of A3DEntity pointers that are unique leaf entities and all the instance paths referencing each child.

Parameters
ownerA pointer to a top level object which will be traversed.
leaf_typeThe type of child object that should be searched for.
instance_path_mapA 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.