C3D Toolkit  Kernel - 118069, Vision - 2.16.7.1844
IMeshProvider Class Referenceabstract

An abstract container for polygonal object data. More...

#include <mesh_provider.h>

Public Member Functions

virtual ~IMeshProvider ()=default
 Destructor.
 
virtual bool IsReady () const =0
 Returns true if the object is ready to be used.
 
virtual size_t GetPointsCount () const =0
 Get the number of points.
 
virtual size_t GetNormalsCount () const =0
 Get the number of normals.
 
virtual void GetPoint (size_t index, MbCartPoint3D &point) const =0
 Get the point with given index.
 
virtual void GetNormal (size_t index, MbVector3D &normal) const =0
 Get the normal with given index.
 
virtual size_t GetVerticesCount () const
 Get the number of normals.
 
virtual size_t GetFacetsCount () const =0
 Get the number of facets.
 
virtual size_t GetVertexPointIndex (size_t index) const =0
 Get point index for the vertex with the given index.
 
virtual size_t GetFacetVerticesCount (size_t index) const =0
 Get the number of vertices for the face with the given index.
 
virtual size_t GetFacetVertexIndex (size_t index, size_t number) const =0
 Get the vertex index for the vertex on the facet with the given index with the given position number.
 
virtual bool HasFacetNormals () const
 Returns true if facets normals exist.
 
virtual size_t GetFacetNormalIndex (size_t index) const
 Get normal index for the facet with the given index.
 
virtual bool HasFacetVertexNormals () const
 Returns true if vertices normals exist.
 
virtual size_t GetFacetVertexNormalIndex (size_t index, size_t number) const =0
 Get the vertex normal index for the vertex on the facet with the given index with the given position number.
 
virtual size_t GetFacetGroupsCount () const
 Get the number of facet groups.
 
virtual size_t GetFacetGroup (size_t) const
 Get the facet group index for the facet with the given index.
 
virtual bool HasFacetGroupAttributes () const
 Returns true if facets groups attributes exist.
 
virtual void GetFacetGroupAttributes (size_t, std::unique_ptr< MbAttributeContainer > &) const
 Get facets group attributes.
 
virtual void SetMeshAttributes (bool bNormalsAveraging, MbPolymeshTopo &polymesh) const
 Set mesh topology attributes. More...
 
virtual void SetSegmAttributes (MbPolymeshTopo &polymesh) const
 Set attributes mesh segmentation attributes. More...
 
virtual void SetPolymeshAttributes (MbPolymesh &) const
 Set the polygonal object attributes.
 

Static Public Member Functions

static IMeshProvider * Create (const MbMesh &mesh)
 Create an object by MbMesh. More...
 

Protected Member Functions

 IMeshProvider ()=default
 Constructor.
 
void InitFacetVertexNormals (MbPolymeshTopo &polymesh) const
 Set mesh normal vectors without averaging.
 
void InitFacetVertexNormalsWithAveraging (MbPolymeshTopo &polymesh) const
 Set mesh normal vectors with averaging.
 

Detailed Description

An abstract container for polygonal object data.

An abstract container for polygonal object data.

Warning
Under development.

Member Function Documentation

◆ Create()

static IMeshProvider* IMeshProvider::Create ( const MbMesh &  mesh)
static

Create an object by MbMesh.

Parameters
[in]mesh- A polygonal geometric object.
Returns
Returns pointer to created object.

◆ SetMeshAttributes()

virtual void IMeshProvider::SetMeshAttributes ( bool  bNormalsAveraging,
MbPolymeshTopo &  polymesh 
) const
virtual

Set mesh topology attributes.

It's assumed that the polymesh object contains MbHalfedgeAttrSizetEdge attribute with edge mapping to the vertex facet position number and MbHalfedgeAttrBoolFacet attribute with bool marks if facets were inverted during topology creation. Among all attributes this function sets up only normals through MbHalfedgeAttrNormalsVertex attribute. To add more attributes an inherited class should be created.

Parameters
[in]bNormalsAveraging- A flag for normal vectors averaging for merged vertices.
[in,out]polymesh- A polygonal geometric object.

◆ SetSegmAttributes()

virtual void IMeshProvider::SetSegmAttributes ( MbPolymeshTopo &  polymesh) const
virtual

Set attributes mesh segmentation attributes.

This function saves original C3D attributes from original facet groups. To add more attributes an inherited class should be created.


The documentation for this class was generated from the following file: