Overview

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

The builder requires a IFC 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

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

IFCMeshBuilder(
        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(IfcFace * face);
int addFace(IfcTriangulatedFaceSet * face);
int addFace(
	IfcIndexedPolygonalFace * face,
	unsigned base_coord,
	ListOfInteger * pnidx
	);

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(
	IfcRepresentation * rep,
	IfcRepresentationItem * it
	);

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

detachMesh()

IFCMesh * 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.

findEdgeInfoIfc()

const RoseMeshEdgeInfo * findEdgeInfoIfc(
	IfcRepresentationItem * curve
	);

The findEdgeInfoIfc() function searches for the index of the given IFC 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 IFC presentation information

getIfcEdge()

IfcRepresentationItem * getIfcEdge(
        unsigned i
	) const;

The getIfcEdge() function returns the IFC edge instance, which will be an edge curve or boundary curve.

getIfcFace()

IfcRepresentationItem * getIfcFace(
        unsigned i
	) const;

The getIfcFace() function gets the IFC face instance for a given mesh face by index.

getIfcMesh()

const IFCMesh * getIfcMesh();

The getIfcMesh() 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.

getRep()

IfcRepresentation * getRep() const;

The getRep() function returns the IFC representation that the mesh was built from. This holds the representation context that describes units and uncertainty.

getRepItem()

IfcRepresentationItem * getRepItem() const;

The getRepItem() function returns the IFC representation item that represents this mesh as a whole. This will be a a type that a mesh can be built from.

make()

static IFCMeshBuilder * make(
	IfcRepresentation * rep,
	IfcRepresentationItem * it,
        RoseMeshOptions * opts = 0,
        RoseMeshThreadMonitor * ctl = 0
	);

The make static function creates a IFCMeshBuilder 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.