Overview

The following functions help to traverse and STEP assemblies, which are used by just about every kind of STEP data. There are many ways to work with assemblies, so this library provides a few functions as entry points and the rest in manager classes used to annotate products, shape reps and relationship objects with back pointers and other computed information. These are defined by the stix_asm.h header file.

stix_tag_asms()

void stix_tag_asms (RoseDesign * d);

The stix_tag_asms function looks at all of the product definitions, shapes, and relationships in the file, recognizes assemblies, annotates them with backpointers, and determines the correct parent-child direction for relationships.

You must call this function before using any of the other functions or managers described on this page.

stix_find_root_products()

void stix_find_root_products(
	StpAsmProductDefVec * roots,
	RoseDesign * design
	);

The stix_find_root_products() function fills a list with all of the root-level product definitions.

This function does not return products associated with orphan shapes, even though they are technically root level objects. If you want to see those, traverse all of the product definitions and look for ones that have no parent NAUO links.

stix_find_root_shapes()

void stix_find_root_shapes(
	StpAsmShapeRepVec * shapes, 
	RoseDesign * design
	);

The stix_find_root_shapes() function fills a list with all of the root shapes in the design.

stix_find_shapes_wo_product()

void stix_find_shapes_wo_product(
	StpAsmShapeRepVec * shapes,
	RoseDesign * design
	);

The stix_find_shapes_wo_product() function fills a list with all of the shape_reps with no owning product_definition. These should not exist, but there are some files which include such data. This function does use a ROSE traversal.

stix_get_related_pdef()

stp_product_definition * stix_get_related_pdef(
	stp_product_definition_relationship * rel
	);

The stix_get_related_pdef() function returns the related product definition from a product definition relationship. The function returns null if the value is not a product_definition.

The type of the related and relating attributes were changed when moving from AP203/214 to AP242. They now hold a select type that can take other types of values. Use this function and stix_get_relating_pdef() to migrate older code and to get values without worrying about the select type.

stix_get_relating_pdef()

stp_product_definition * stix_get_relating_pdef(
	stp_product_definition_relationship * rel
	);

The stix_get_relating_pdef() function returns the relating product definition from a product definition relationship. The function returns null if the value is not a product_definition.

The type of the related and relating attributes were changed when moving from AP203/214 to AP242. They now hold a select type that can take other types of values. Use this function and stix_get_related_pdef() to migrate older code and to get values without worrying about the select type.

stix_get_reprel_1/2()

stp_representation * stix_get_reprel_1(
	stp_representation_relationship * rel
	);

stp_representation * stix_get_reprel_2(
	stp_representation_relationship * rel
	);

The stix_get_reprel_1() and stix_get_reprel_2() functions return the representation value of the rep_1 and rep_2 attributes of a representation relationship. The functions return null if the value is not a representation.

The type of these attributes were changed when moving from AP242e1, AP214, and AP203 to AP242 second edition. They now hold a select type that can take other types of values. Use these functions to migrate older code and to get values without worrying about the select type.

stix_put_related_pdef()

void stix_put_related_pdef(
	stp_product_definition_relationship * rel,
	stp_product_definition * pd
	);

The stix_put_related_pdef() function sets the related product definition of a product definition relationship to a given product definition.

The type of the related and relating attributes were changed when moving from AP203/214 to AP242. They now hold a select type that can take other types of values. Use this function and stix_put_relating_pdef() to migrate older code and to set values without worrying about the select type.

stix_put_relating_pdef()

void stix_put_relating_pdef(
	stp_product_definition_relationship * rel,
	stp_product_definition * pd
	);

The stix_put_relating_pdef() function sets the relating product definition of a product definition relationship to a given product definition.

The type of the related and relating attributes were changed when moving from AP203/214 to AP242. They now hold a select type that can take other types of values. Use this function and stix_put_related_pdef() to migrate older code and to set values without worrying about the select type.

stix_put_reprel_1/2()

void stix_put_reprel_1(
	stp_representation_relationship * rel,
	stp_representation * rep
	);

void stix_put_reprel_2(
	stp_representation_relationship * rel,
	stp_representation * rep
	);

The stix_put_reprel_1() and stix_put_reprel_2() functions set the rep_1 and rep_2 attributes of a representation relationship to a given representation. The type of these attributes were changed when moving from AP242e1, AP214, and AP203 to AP242 second edition. They now hold a select type that can take other types of values.

Use these functions to migrate older code and to set values without worrying about the select type.

StixMgrAsmProduct class

class StixMgrAsmProduct

The StixMgrAsmProduct class is a subtype of RoseManager that is attached to a product_definition. This holds pointers to the NAUOs that this product participates in.

    /* Back pointer to next_assembly_usage_occurrence instance that
     * reference this product as a parent.  To get the child products,
     * get the NAUO, and follow the related_product_defintition
     * attribute.
     */
    StpAsmNauoVec child_nauos;

    /* Back pointer to the next_assembly_usage_occurrence that
     * reference this product as a child
     */
    StpAsmNauoVec parent_nauos;

    
    /* True if a owned shape_rep (in shapes below) is a child of
     * another shape rep, but there is no NAUO relating the products.
     * If it were not for those shapes, this would be a root product.
     */
    RoseBoolean has_orphan_shapes;  

    /*
     * The shape reps that belong to this product
     */
    StpAsmShapeRepVec shapes;

    /* True if this product has a parent.  This can by true even of no
     * NAUO references it, since we do have some data where there is a
     * mapped_item between two shape_reps, but no NAUO relating the
     * products.
     */
    RoseBoolean has_parent;    

StixMgrAsmShapeRep class

class StixMgrAsmShapeRep

The StixMgrAsmProduct class is a subtype of RoseManager that is attached to a shape_representation.

    StpAsmProductDefVec owning_roots;
    
    /* The parent and child rep_relationships */
    StpAsmShapeRepRelVec child_rels;
    StpAsmShapeRepRelVec parent_rels;
 
    /* The parent and child mapped items.  Child is not really
     * necessary -- you could search the items set for mapped_item
     * instances, but this will simplify the process.
     */
    StpAsmMappedItemVec child_mapped_items;
    StpAsmMappedItemVec parent_mapped_items;


    /* Back pointers to product_defs and linking shape_def_reps that
     * point to the shape_rep.  These vectors parallel each other and
     * we could probably remove one of them.
     */
    StpAsmProductDefVec products;
    StpAsmShapeDefRepVec shape_def_reps;
    
    stp_axis2_placement_3d * root_placement;

StixMgrAsmRelation class

class StixMgrAsmRelation

The StixMgrAsmRelation class is a subtype of RoseManager that records the relation between two representation_items. Normally these are the axis placements in the parent and child that are used to place the component. Depending on how the assembly was constructed, this manager is attached to either a shape_reprepresentation_relationship or a mapped_item.

    stp_next_assembly_usage_occurrence * owner;

    StpAsmProductDefVec owning_roots;
    
    /* The source and target placements. */
    stp_representation_item * origin;
    stp_representation_item * target;

    /* For a shape_rep_relationship, we assume that the component is
     * rep_1 and and assembly as a whole is rep_2.  If this is not
     * true, then the reversed variable is true.  In either case, the
     * origin and target rep_items above are always consistent.
     */    
    RoseBoolean reversed; 

    stp_representation * child;