Defines polygonal (faceted or tessellated) representation of part. More...
#include <cadex/ModelData_PolyRepresentation.hxx>
Classes | |
class | Provider |
Provides polygonal representation. More... | |
Public Types | |
typedef cadex::internal::ModelData_PolyRepresentationImpl | ImplType |
![]() | |
typedef cadex::internal::ModelData_RepresentationImpl | ImplType |
![]() | |
typedef int | IdType |
Defines a type identifier. | |
Public Member Functions | |
ModelData_PolyRepresentation () | |
Constructor. | |
ModelData_PolyRepresentation (initialized) | |
ModelData_PolyRepresentation (ImplType *theImpl) | |
ModelData_PolyRepresentation (const ModelData_BRepRepresentation &theRef, const ModelAlgo_BRepMesherParameters &theParameters=ModelAlgo_BRepMesherParameters(), bool theComputeImmediately=false) | |
ModelData_PolyRepresentation (const ModelData_PolyShape &theNode) | |
void | Add (const ModelData_PolyShape &theShape) |
Adds a polygonal shape to the representation. | |
const ModelData_PolyShapeList & | Get () const |
Returns poly shapes comprising the representation. | |
void | AddProvider (const std::shared_ptr< Provider > &theProvider) |
Adds a provider for polygonal data. | |
void | Clear () |
Discards associated data. | |
![]() | |
ModelData_Representation () | |
Constructor. | |
void | Accept (ModelData_Part::RepresentationVisitor &theVisitor) const |
Accepts a representation visitor. | |
![]() | |
ModelData_BaseObject () | |
Constructor. | |
IdType | TypeId () const |
Returns an object type id. | |
template<typename T > | |
bool | IsOfType () const |
Returns true if the object has a type T. | |
void | SetName (const Base_UTF16String &theName) |
Sets an object name. | |
Base_UTF16String | Name () const |
void | SetUuid (const Base_Uuid &theUuid) |
Base_Uuid | Uuid () const |
void | Nullify () |
Resets reference to implementation object. | |
bool | IsNull () const |
Returns true if the object is nullified. | |
operator bool () const | |
Casts the object to the bool type. | |
internal::ModelData_BaseObjectImpl * | Impl () const |
Return a handle to backend (reserved for internal use). | |
Static Public Member Functions | |
static IdType | GetTypeId () |
Additional Inherited Members | |
![]() | |
ModelData_Representation (internal::ModelData_BaseObjectImpl *theImpl) | |
Constructor (reserved for internal use). | |
![]() | |
ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl) | |
Constructor (reserved for internal use). | |
ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl, const Base_UTF16String &theName) | |
Constructor (reserved for internal use). | |
template<typename T > | |
T * | GetOrCreateImpl () |
Reserved for internal use. | |
Defines polygonal (faceted or tessellated) representation of part.
Polygonal representation contains an approximated (facetted or tessellated) description of a part (ModelData_Part). A part may have none, one or multiple polygonal representations. In the latter case, they are to considered to define multiple level of details (or LOD's) of the part.
Polygonal representation contains ModelData_PolyShapeList, which is a list of vertex sets (ModelData_PolyVertexSet), returned by the Get() method. The polygonal representation may contain one or multiple vertex sets, for instance having distinct appearance settings (although for a part having a single representation it is much more common to attach an appearance to the part itself). An example of explicit appearance attached to each vertex set is given below. In this case a part contains one polygonal representation which in its turn contains several triangle sets each holding its own color (green or orange):
The following example demonstrates how to iterate over root vertex sets:
The following picture demonstrates each supported types:
![]()
Triangle set | ModelData_IndexedTriangleSet - a set of triangles |
![]()
Polyline set | ModelData_PolyLineSet - a set of polylines |
![]()
Point set | ModelData_PolyPointSet - a set of points |
A polygonal representation is initially created with an empty list of vertex sets. Adding vertex sets is done with the help of ModelData_PolyRepresentation::Add() or provided in the constructor, for instance:
Each subclass of ModelData_PolyVertexSet provides API to construct the respective object bottom-up.
A polygonal representation can be created from a B-Rep representation with the help of visulization or computational meshers. Refer to Meshing for further details.
ModelAlgo_BRepMesher is used underneath to create a polygonal representation. It may also be used explicitly, for instance, to create polygonal representations for all parts which have B-Rep representations and do not have polygonal representations:
cadex::ModelData_PolyRepresentation::ModelData_PolyRepresentation | ( | ) |
Constructor.
If theToInitialize is false then creates a null object (see IsNull()).
const ModelData_PolyShapeList & cadex::ModelData_PolyRepresentation::Get | ( | ) | const |
Returns poly shapes comprising the representation.
If the object IsNull() then behavior is undefined.