ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Member Functions
prtx::Mesh Class Reference

#include <Mesh.h>

Inheritance diagram for prtx::Mesh:
[legend]

Public Member Functions

const BoundingBoxgetBoundingBox () const
 
uint32_t getFaceCount () const
 
int32_t getFaceEncirclingFace (uint32_t faceId) const
 
uint32_t getFaceHolesCount (uint32_t faceId) const
 
const IndexVectorgetFaceHolesCounts () const
 
const uint32_t * getFaceHolesIndices (uint32_t faceId) const
 
uint32_t getFaceMaterialIndex (uint32_t faceId) const
 
const IndexVectorgetFaceMaterialIndices () const
 
uint32_t getFaceTextureRegionIndex (uint32_t faceId, uint32_t uvSet) const
 
const IndexVectorgetFaceTextureRegionIndices (uint32_t uvSet) const
 
uint32_t getFaceUVCount (uint32_t faceId, uint32_t uvSet) const
 
const IndexVectorgetFaceUVCounts (uint32_t uvSet) const
 
const uint32_t * getFaceUVIndices (uint32_t faceId, uint32_t uvSet) const
 
uint32_t getFaceVertexCount (uint32_t faceId) const
 
const IndexVectorgetFaceVertexCounts () const
 
const uint32_t * getFaceVertexIndices (uint32_t faceId) const
 
uint32_t getFaceVertexNormalCount (uint32_t faceId) const
 
const IndexVectorgetFaceVertexNormalCounts () const
 
const uint32_t * getFaceVertexNormalIndices (uint32_t faceId) const
 
uint32_t getHolesCount () const
 
const MaterialPtrVectorgetMaterials () const
 
const std::wstring & getName () const
 
const DoubleVectorgetTextureRegions (uint32_t uvSet) const
 
size_t getUsedMem () const
 
const DoubleVectorgetUVCoords (uint32_t uvSet) const
 
uint32_t getUVSetsCount () const
 
const DoubleVectorgetVertexCoords () const
 
const DoubleVectorgetVertexNormalsCoords () const
 
- Public Member Functions inherited from prtx::Content
 Content (const Content &)=delete
 
Contentoperator= (const Content &)=delete
 

Detailed Description

Read-only description of a polygonal mesh. A Mesh consists of vertex coordinates, normal coordinates, texture coordinates (uv coordinates), materials and polygons (faces). Faces are described as a set of indices into the former.

Faces (polygons) can be textured with an arbitrary number of uv sets and can have normals at their vertices. Each face can have a different Material assigned. Faces with holes are supported. Holes are encoded as faces, and the relationship outer encircling face - inner hole face is encoded on top of that.

Mesh conditions:

See also
MeshBuilder

Member Function Documentation

◆ getBoundingBox()

const BoundingBox& prtx::Mesh::getBoundingBox ( ) const
Returns
the axis-aligned BoundingBox of the mesh.

◆ getFaceCount()

uint32_t prtx::Mesh::getFaceCount ( ) const
Returns
number of faces.

◆ getFaceEncirclingFace()

int32_t prtx::Mesh::getFaceEncirclingFace ( uint32_t  faceId) const

Gets the index of the encircling face for a hole.

Parameters
faceIdIndex of face (hole).
Returns
index of encircling face or -1 if faceId is not a hole.

◆ getFaceHolesCount()

uint32_t prtx::Mesh::getFaceHolesCount ( uint32_t  faceId) const
Parameters
faceIdIndex of face.
Returns
the number of holes in the selected face.

◆ getFaceHolesCounts()

const IndexVector& prtx::Mesh::getFaceHolesCounts ( ) const
Returns
vector with the number of holes for each face. Size of vector is the number of faces.

◆ getFaceHolesIndices()

const uint32_t* prtx::Mesh::getFaceHolesIndices ( uint32_t  faceId) const
Parameters
faceIdIndex of face.
Returns
pointer to array with all face indices of the holes for the selected face. Size of array is getFaceHolesCount(faceId). Returns nullptr if the mesh does not contain any holes or if faceId does not reference a hole.

◆ getFaceMaterialIndex()

uint32_t prtx::Mesh::getFaceMaterialIndex ( uint32_t  faceId) const
Parameters
faceIdIndex of face.
Returns
the material index of the selected face.

◆ getFaceMaterialIndices()

const IndexVector& prtx::Mesh::getFaceMaterialIndices ( ) const

Gets the material indices for all faces.

Returns
vector with the index into the materials for each face. Size of vector is the number of faces.

◆ getFaceTextureRegionIndex()

uint32_t prtx::Mesh::getFaceTextureRegionIndex ( uint32_t  faceId,
uint32_t  uvSet 
) const

Gets the region index for the selected face and the selected uv set. Region indices point into the region coordinates of that set; i.e. region i has coordinates [i*4, i*4+1, i*4+2, i*4+3]. The region with index 0 is always (0,0,1,1). Actual sub-regions can therefore be identified by indices > 0.

Parameters
faceIdIndex of face.
uvSetIndex of uv set.
Returns
the region index of the selected face and uv set.
Exceptions
std::range_errorwill be thrown if the uvSet does not exist in this mesh.

◆ getFaceTextureRegionIndices()

const IndexVector& prtx::Mesh::getFaceTextureRegionIndices ( uint32_t  uvSet) const

Gets the texture region coordinate indices for the selected uv set. Region indices point into the region coordinates of that set; i.e. region i has coordinates [i*4, i*4+1, i*4+2, i*4+3]. The region with index 0 is always (0,0,1,1). Actual sub-regions can therefore be identified by indices > 0.

Parameters
uvSetIndex of uv set.
Returns
vector with the index into the texture regions for each face. Size of vector is the number of faces.
Exceptions
std::range_errorwill be thrown if the uvSet does not exist in this mesh.

◆ getFaceUVCount()

uint32_t prtx::Mesh::getFaceUVCount ( uint32_t  faceId,
uint32_t  uvSet 
) const

A face can optionally have several layers of uv coordinates. The number of uv coordinates for a face and for a specific uv set is either 0 or equal to the number of vertices.

Parameters
faceIdIndex of face.
uvSetIndex of uv set.
Returns
the number of uvs for the selected face for the selected uv set.
Exceptions
std::range_errorwill be thrown if the uvSet does not exist in this mesh.

◆ getFaceUVCounts()

const IndexVector& prtx::Mesh::getFaceUVCounts ( uint32_t  uvSet) const

A face can optionally have several layers of uv coordinates. The number of uv coordinates for a face and for a specific uv set is either 0 or equal to the number of vertices.

Parameters
uvSetIndex of uv set.
Returns
the number of uvs for each face for the selected uv set.
Exceptions
std::range_errorwill be thrown if the uvSet does not exist in this mesh.

◆ getFaceUVIndices()

const uint32_t* prtx::Mesh::getFaceUVIndices ( uint32_t  faceId,
uint32_t  uvSet 
) const

Gets the uv coordinate indices for the selected face and the selected uv set. Uv indices point into the uv coordinates of that set; i.e. uvs i has coordinates [i*2, i*2+1].

Parameters
faceIdIndex of face.
uvSetIndex of uv set.
Returns
pointer to array with all uv indices of the selected face and uv set. Size of array is getFaceUVCount(faceId, uvSet). Returns nullptr if this face does not contain any UVs for uvSet.
Exceptions
std::range_errorwill be thrown if the uvSet does not exist in this Mesh.

◆ getFaceVertexCount()

uint32_t prtx::Mesh::getFaceVertexCount ( uint32_t  faceId) const

Gets the number of vertices of the selected face.

Parameters
faceIdIndex of face.
Returns
number of vertices of face faceId

◆ getFaceVertexCounts()

const IndexVector& prtx::Mesh::getFaceVertexCounts ( ) const

Gets the number of vertices in each face. Size of the vector is the number of faces.

Returns
a vector with the number of vertices for each face.

◆ getFaceVertexIndices()

const uint32_t* prtx::Mesh::getFaceVertexIndices ( uint32_t  faceId) const

Gets the vertex indices for the selected face. Vertex indices point into the vertex coordinates; i.e. vertex i has coordinates [i*3, i*3+1, i*3+2].

Parameters
faceIdIndex of face.
Returns
pointer to array with vertex indices; size of array is getFaceVertexCount(faceId). Does not return nullptr.

◆ getFaceVertexNormalCount()

uint32_t prtx::Mesh::getFaceVertexNormalCount ( uint32_t  faceId) const

A face can optionally have vertex normals. The number of vertex normals for a face is either 0 or equal to the number of vertices.

Parameters
faceIdIndex of face.
Returns
the number of vertex normals for the selected face.

◆ getFaceVertexNormalCounts()

const IndexVector& prtx::Mesh::getFaceVertexNormalCounts ( ) const

A face can optionally have vertex normals. The number of vertex normals for a face is either 0 or equal to the number of vertices. Gets the number of vertex normals in each face. Size of the vector is the number of faces.

Returns
a vector with the number of vertex normals for each face.

◆ getFaceVertexNormalIndices()

const uint32_t* prtx::Mesh::getFaceVertexNormalIndices ( uint32_t  faceId) const

Gets the vertex normal indices for the selected face. Vertex normal indices point into the vertex normal coordinates; i.e. normal i has coordinates [i*3, i*3+1, i*3+2].

Parameters
faceIdIndex of face.
Returns
pointer to array with all vertex normal indices of the selected face. Size of array is getFaceVertexNormalCount(faceId). Returns nullptr if this face does not contain any vertex normal indices.

◆ getHolesCount()

uint32_t prtx::Mesh::getHolesCount ( ) const
Returns
number of holes.

◆ getMaterials()

const MaterialPtrVector& prtx::Mesh::getMaterials ( ) const
Returns
vector with all materials.

◆ getName()

const std::wstring& prtx::Mesh::getName ( ) const
Returns
the name of the mesh. Might be empty.

◆ getTextureRegions()

const DoubleVector& prtx::Mesh::getTextureRegions ( uint32_t  uvSet) const

Gets all texture regions of a specific uv set as a series of (u_min,v_min,u_max,v_max) quadruples. The region with index 0 is always (0,0,1,1). Actual sub-regions can therefore be identified by indices > 0. Size of the vector is 4 * number of regions.

Parameters
uvSetIndex of uv set.
Returns
all regions as a series of (u_min,v_min,u_max,v_max) quadruples.
Exceptions
std::range_errorwill be thrown if the uvSet does not exist in this mesh.

◆ getUsedMem()

size_t prtx::Mesh::getUsedMem ( ) const

Returns an estimation of the memory allocated by this prtx::Mesh instance (in bytes).

◆ getUVCoords()

const DoubleVector& prtx::Mesh::getUVCoords ( uint32_t  uvSet) const

Gets all uv coordinates (texture coordinates) of a specific uv set as a series of (u,v) pairs. Size of the vector is 2 * number of uvs.

Parameters
uvSetIndex of uv set.
Returns
all uvs as a series of (u,v) pairs.
Exceptions
std::range_errorwill be thrown if the uvSet does not exist in this mesh.

◆ getUVSetsCount()

uint32_t prtx::Mesh::getUVSetsCount ( ) const
Returns
Number of uv sets.

◆ getVertexCoords()

const DoubleVector& prtx::Mesh::getVertexCoords ( ) const

Gets all vertex coordinates as a series of (x,y,z) triplets. Size of the vector is 3 * number of vertices.

Returns
all vertex coordinates as a series of (x,y,z) triplets.

◆ getVertexNormalsCoords()

const DoubleVector& prtx::Mesh::getVertexNormalsCoords ( ) const

Gets all vertex normal coordinates as a series of (x,y,z) triplets. Size of the vector is 3 * number of normals.

Returns
all vertex normals as a series of (x,y,z) triplets.

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