Overview

STEP geometry may have associated colors and styles, as well as layers and groups. Models may also have polyline drawings for notes or presentation-only tolerances (human, not computer interpretable) and extra construction geometry like planes. Collectively, this presentation information is handled by the functions below.

All definitions are in the stix_present.h header file.

stix_present_color()

unsigned stix_present_color(
	stp_representation_item * item
        );

The stix_present_color() function gets the color of a representation item. The color comes from associated presentation information, so you must call stix_present_tag() before using this function.

The color is returned as a 24-bit RGB value of the form 0x00RRGGBB. If an item does not have any color information, the function return ROSE_MESH_NULL_COLOR.

unsigned rgb = stix_present_color(it);
unsigned red   = (rgb & 0xff0000) >> 16;
unsigned green = (rgb & 0x00ff00) >> 8;
unsigned blue  = (rgb & 0x0000ff);

printf (r=%x g=%x b=%x\n, red, green, blue);

stix_present_constructive_geometry()

StixConstructiveGeomVec * stix_present_constructive_geometry(
        stp_representation * shape
        );

The stix_present_constructive_geometry() function returns the constructive geometry associated with with a STEP shape. You must call stix_present_tag() before using this function. This function return null if the shape has no associated construcive geometry.

The returns value is an instance of type StixConstructiveGeomVec. This is a subtype of rose_vector containing elements of type stp_constructive_geometry_representation.

stix_present_draughting_info()

StixDraughtingInfoVec * stix_present_draughting_info(
        RoseObject * identified_item
        );

struct StixDraughtingInfo {
        stp_geometric_item_specific_usage * gisu;
        stp_draughting_model_item_association * dmia;
};

The stix_present_draughting_info() function returns the draughting information associated with a given STEP object. You must call stix_present_tag() before using this function. If there is no draughting information assiciated with the shape, this function return null.

The identified_item parameter is an object that is reference by the geometric_item_specific_usage object in the draughting model. This will often be a face to which an annotation applies.

stix_present_draughting_models()

StixRepresentationVec * stix_present_draughting_models(
        stp_shape_representation * shape
        );

The stix_present_draughting_models() function returns the draughting models associated with with a STEP shape. You must call stix_present_tag() before using this function. If there is no draughting model assiciated with the shape, this function return null.

The returns value is an instance of type StixRepresentationVec. This is a subtype of rose_vector containing elements of type stp_representation.

stix_present_styled_items()

StixStyledItemVec * stix_present_styled_items(
	stp_representation_item * it
	);

The stix_present_styled_items() function returns a rose_vector subtype containing styled items that refer to a given representation item.

stix_present_tag()

void stix_present_tag(
        RoseDesign * des
        );

The stix_present_tag() function builds indexes on a STEP data set so that stix_present_color() and similar functions can find presentation information related to STEP geometry.

stix_style_get_rep()

stp_representation * stix_style_get_rep(
        stp_styled_item * si
        );

The stix_style_get_rep() function returns the "item" field of a styled item as a representation pointer if the field contains a value of that type, or null otherwise. Originally, styled_item could only refer to a representation_item, but this was extended in AP242 by the addition of a SELECT type that can contain other types.

stix_style_get_repitem()

stp_representation_item * stix_style_get_repitem( 
        stp_styled_item * si
        );

The stix_style_get_repitem() function returns the "item" field of a styled item as a representation_item pointer. If the value of that field is not a representation_item, the function returns null. This function simplifies work with styled items because newer schema versions change the "item" field to a SELECT type that can contain one of several different types of values.

stix_style_put_rep()

void stix_style_put_rep( 
        stp_styled_item * si,
        stp_representation * rep
        );

The stix_style_put_rep() function sets the "item" field of a styled item to a representation. This function simplifies work with styled items because newer schema versions change the "item" field to a SELECT type that can contain one of several different types of values.

stix_style_put_repitem()

void stix_style_put_repitem( 
        stp_styled_item * si,
        stp_representation_item * ri
        );

The stix_style_put_repitem() function sets the "item" field of a styled item to a representation_item. This function simplifies work with styled items because newer schema versions change the "item" field to a SELECT type that can contain one of several different types of values.