Overview

The StixMeshBuilder is a RoseMeshBuilder subtype that handles specific details for faceting STEP data and controls access to mesh data while it being created by a faceter.

The builder requires a STEP representation and a representation_item within it to be faceted, usually a shell given by a manifold_solid_brep, a shell_based_surface_model or a geometric_set. The representation_item could also be single face. The representation provides context information such as angle units and uncertainty.

The make static function determines if the instance is an appropiate type to mesh, and creates the mesh . If for some reason you do not need the mesh to include all the faces, you can call the constructor directly and add the faces with the addFace function.

Constructor

StixMeshBuilder(
        stp_representation * rep,
        stp_representation_item * it,
        StixMeshOptions * opts = 0,
        RoseMeshThreadMonitor * ctl = 0
	);

StixMeshBuilder(
        stp_representation * rep,
        stp_representation_item * it,
        RoseMeshThreadMonitor * ctl
	);

The constructor will create the StixMeshBuilder. Note that it is generally perferrable to use the make function instead, since that will return NULL it the representation_item passed in cannot be faceted.

addFace()

int addFace(stp_face * face);
int addFace(stp_curve_bounded_surface * surf);
int addFace(stp_tessellated_face * face);
int addFace(stp_tessellated_surface_set * ss);

The addFace() function adds a face to the shell to be rendered. The make static functions call this function, but if you created a builder using the constructor, then the faces will need to be added before the rendering can be started. This can be used, for example, if you want to render a single face, or a subset of the faces in a shell.

This function returns a boolean value indicating if it was able to add the face. A false return value indicates a problem processing the edge curve, most likely due to bad quality data.

All of the faces of the shell must be added before the rendering is begun.

canMake()

static int canMake(
        stp_representation * rep,
        stp_representation_item * it
	);

The canMake() static function determines if a STEP geometry item can be processed by the builder.

detachMesh()

StixMesh * detachMesh();    

The detachMesh() function prevents the destructor from deleting the mesh. By default, the mesh the builder creates is deleted when the builder itself is. Once the mesh is detached, it must be deleted to avoid memory leaks. This function returns the mesh.

findEdgeInfoStp()

const RoseMeshEdgeInfo * findEdgeInfoStp(
	stp_representation_item * curve
	);

The findEdgeInfoStp() function searches for the index of the given STEP edge instance and calls RoseMeshBuilder::getEdgeInfo() to return a pointer to an internal structure describing a edge curve on the mesh. This returns null if the edge was not found.

getDefaultColor()

unsigned getDefaultColor();

The getDefaultColor() function returns the default color for the shell as computed from the STEP presentation information

getFaceBuilderFromStp()

RoseMeshFaceBuilder * getFaceBuilderFromStp(
	stp_representation_item * face
	);

The getFaceBuilderFromStp() function searches for the index of the STEP face and then calls RoseMeshBuilder::getFaceBuilder() to return the builder object associated with that particular face.

getFaceFacets()

void getFaceFacets(
	unsigned * start,
	unsigned * count,
	stp_representation_item * face
	) const;

The getFaceFacets() function reports the facets that belong to a given STEP face. The facets of a face are contiguous in the mesh, so they are identified by a start index and a length.

This function provides its own synchronization, and should be used rather than directly accessing the mesh if there is any chance that faceting threads working on the mesh.

getFaceIndexFromStp()

unsigned getFaceIndexFromStp(
	stp_representation_item * face
	) const;

The getFaceIndexFromStp() function searches the builder for the face index that matches the given STEP instance. The function returns ROSE_NOTFOUND if no match was found.

getRepresentation()

stp_representation * getRepresentation()

The getRepresentation() function returns the STEP representation of the mesh.

getStepEdge()

stp_representation_item * getStepEdge(
	unsigned i
	);

The getStepEdge() function returns the STEP representation_item associated with a given edge of the mesh.

getStpFace()

stp_representation_item * getStpFace(
	unsigned i
	) const;

The getStpFace() function function returns the STEP representation_item associated with a given face of the mesh.

getStpMesh()

const StixMesh * getStpMesh();

The getStpMesh() function returns the mesh. This may be modified by worker threads if the faceting process is not yet completed, so any access to the data in the facet set before the builder has finished faceting must be contained within a beginCS()/endCS() pair.

getStepSolid()

stp_representation_item * getStepSolid()

The getStepSolid() function returns the STEP instance at the root of the mesh. This is usually a manifold_solid_brep, shell_based_surface_model, or geometric_set, but it may be other types as well.

isShell()

static int isShell(
        stp_representation * rep,
        stp_representation_item * it
	);

The isShell static function determines if the given representation and its item are a shell that can be faceted. This can be used to iterate over the items of a representation to find the items that can be faceted.

make()

static StixMeshBuilder * make(
        stp_representation * rep,
        stp_representation_item * it,
        RoseMeshOptions * opts = 0,
        RoseMeshThreadMonitor * ctl = 0
	);

static StixMeshBuilder * make(
        stp_representation * rep,
        stp_representation_item * it,
        RoseMeshThreadMonitor * ctl
	);

The make static function creates a StixMeshBuilder for a given representation and representation_item. If the faceter can not do anything with the given item, this function return null, otherwise it returns a builder configured to faceted the given shell.

renderPrep()

int renderPrep();

The renderPrep() function prepares the mesh for rendering after all the faces have been added. It is not possible to add additional faces after calling this method. If the tolerance is not set it will be computed at this time. The function returns nonzero on success or zero if there was an error.

renderStpFace()

int renderStpFace(
	stp_representation_item * face
	);

The renderStpFace() function renders a single face of the mesh. Since the faceting process is compute intensive, this function may be called from a worker thread to perform the faceting. This function should be called once for each face in the mesh, and multiple faces of the same mesh may be rendered at the same time. This function returns a boolean value indicating wether the faceter was able to facet the face.