Overview
A StixAsmShapeIndex is an index that simplifies work with the geometric side of STEP assemblies — shapes and their placement in space. The stix_asm_shape_index() function returns the shape index object for a given file. The index is built by calling stix_asm_tag() after reading the file into memory.
The index is a list of entries with information about each use of a shape representation in the assembly trees. For any shape use, we know its path up through the shape tree, what product use it corresponds to, and the original STEP representation and relationship objects.
The shape uses are grouped by product use, not by shape subtree. In the product index, a subassembly is a contiguous block of product uses, with a continuous block of shape uses in the shape index.
getAsmDepth()
unsigned getAsmDepth (unsigned i);
The getAsmDepth() function returns the number of levels in the shape tree above a given shape usage. A root shape has a depth of zero, its children have a depth of one, and so on.
getAsmGlobalXform()
const double * getAsmGlobalXform(unsigned i);
The getAsmGlobalXform() function returns a pointer to a double[16] with the transform matrix to place the shape within the global space. The pointer only remains valid as long as the index is not changed, so use or copy the matrix immediately.
When the shape index is built, this transform is computed by recursively placing coordinate systems in the shape tree to get the final location and orientation. Use stix_asm_relation_xform() if you want just the local transform for an individual shape relation.
getAsmParentUse()
unsigned getAsmParentUse(unsigned i);
The getAsmParentUse() function returns the parent shape use for a given shape use. The function returns ROSE_NOTFOUND if the shape use has no parent.
getAsmProductUse()
unsigned getAsmProductUse(unsigned i);
The getAsmProductUse() function returns the product use in the StixAsmProductIndex that a given shape usage corresponds to. The product and shape trees are connected by this link. You can trace from geometry to the product that it depicts, and distinguish between multiple appearances of that product in an assembly.
getAsmRel()
RoseObject * getAsmRel(unsigned i);
The getAsmRel() function returns the STEP relationship object for a given shape use. Depending on how the shape tree was constructed, this may be a shape_representation_relationship or a mapped_item. This function will return null if the shape usage is the root of a tree.
getAsmRep()
stp_representation * getAsmRep(unsigned i);
The getAsmRep() function returns the STEP representation object for a given shape use.
size()
unsigned size();
The size() function returns the number of shape uses in the index.