Overview

The RoseMeshFace class identifies a block of facets in a RoseMesh. The facets are stored sequentially in the mesh, identified by the first facet and a count. These are typically created to identify the portion of the mesh that originated from a STEP or IFC brep face.

The face class has public constructors, but faces are typically created by the mesher during the rendering process, or using the RoseMesh::createFace() function. Faces are owned by, and are copied or deleted with the facet set that they apply to.

getColor()

unsigned getColor() const;

The getColor() function returns the color for a face as a 24-bit packed RGB value. The ROSE_MESH_NULL_COLOR macro indicates no color value. The setColor() function changes this value.

In STEP, IFC, or OpenGL color is often represented by floating point red, green, or blue components value from 0 to 1. Given an instance with red=1, green=.5 and blue=.25, this would be repredented as 0xff8040. The 0xff is red, the 0x80 is green, and the 0x40 is blue.

getFacetCount()

unsigned getFacetCount() const;

The getFacetCount() function returns the number of facets in the face.

getFirstFacet()

unsigned getFirstFacet() const;

The getFirstFacet() function returns the index in the mesh of the starting facet for the face. This returns ROSE_MESH_NULL_IDX when the face has not yet been assigned to a block of facets.

getObject()

RoseObject * getObject() const;

The getObject() function returns the source data object that describes the face. If the mesh was created from STEP or IFC data, this will likely be a brep face representation item. It may be null if the mesh was created from some other source.

getProps()

const RosePropertyList * getProps(
        RosePropertyType t
	) const;

RosePropertyList * getProps(
        RosePropertyType t
	);

The getProps() function returns the list of properties attached to a face. You can search, add, or remove properties using separate functions. Each property declares a static find() function that returns an instance cast to the proper type, as well as a similar make() function that creates property if one is not present.

RoseMeshFace * f;

// return if present, null otherwise
FooProp * p = FooProp::find(f->getProps());

// return if present, create and return otherwise
FooProp * p = FooProp::make(f->getProps());

// Using functions on the property list and manually casting 
FooProp * p = (FooProp*) f->getProps()->find(FooProp::type());
if (!p) {
    p = new FooProp;
    f->getProps()->add(p);
}

setColor()

void setColor( unsigned c );

The setColor() function assigns the color for a face as a 24-bit packed RGB value. The ROSE_MESH_NULL_COLOR macro indicates no color value. See getColor() for more discussion.

setFacetCount()

void setFacetCount( unsigned f );

The setFacetCount() function sets the number of facets in the face. This value is returned by getFacetCount().

setFirstFacet()

void setFirstFacet( unsigned f );

The setFirstFacet() function sets the first facet in the face. This value is returned by getFirstFacet().

setObject()

void setObject(RoseObject * o);

The setObject() function sets the source data object that describes the face. If the mesh was created from STEP or IFC data, this will likely be a representation item.