ArcGIS Procedural Runtime
3.2.10650
|
#include <Mesh.h>
Public Member Functions | |
uint32_t | addFace (const IndexVector &vertexIndices, const IndexVector &holeFacesIndices, uint32_t materialIndex, const IndexVector &normalIndices, const std::vector< IndexVector > &uvIndices) |
uint32_t | addFace (const uint32_t *vertexIndices, size_t vertexIndicesCount, const uint32_t *holeFaceIndices, size_t holeFacesIndicesCount, uint32_t materialIndex, const uint32_t *normalIndices, size_t normalIndicesCount, const std::vector< const uint32_t *> &uvIndices, const std::vector< size_t > &uvIndicesCounts) |
uint32_t | addFace () |
void | addFaceHoleIndex (uint32_t faceId, uint32_t index) |
void | addFaceNormalIndex (uint32_t faceId, uint32_t index) |
void | addFaceUVIndex (uint32_t faceId, uint32_t uvSet, uint32_t i) |
void | addFaceVertexIndex (uint32_t faceId, uint32_t index) |
uint32_t | addMaterial (const MaterialPtr &material) |
void | addMaterials (const MaterialPtrVector &materials) |
uint32_t | addNormalCoords (const double coords[3]) |
void | addNormalCoords (const double *coords, size_t count) |
void | addNormalCoords (const DoubleVector &coords) |
uint32_t | addTextureRegionCoords (uint32_t uvSet, const double coords[4]) |
void | addTextureRegionCoords (uint32_t uvSet, const double *coords, size_t count) |
void | addTextureRegionCoords (uint32_t uvSet, const DoubleVector &coords) |
uint32_t | addUVCoords (uint32_t uvSet, const double coords[2]) |
void | addUVCoords (uint32_t uvSet, const double *coords, size_t count) |
void | addUVCoords (uint32_t uvSet, const DoubleVector &coords) |
uint32_t | addVertexCoords (const double coords[3]) |
void | addVertexCoords (const double *coords, size_t count) |
void | addVertexCoords (const DoubleVector &coords) |
virtual MeshPtr | createShared (std::wstring *warnings=0) const |
virtual MeshPtr | createSharedAndReset (std::wstring *warnings=0) |
bool | isEmpty () const |
MeshBuilder () | |
MeshBuilder (const MeshBuilder &mb) | |
MeshBuilder (const MeshBuilder &mb, const DoubleVector &trafoMatrix) | |
MeshBuilder (const Mesh &mesh) | |
MeshBuilder (const Mesh &mesh, const DoubleVector &trafoMatrix) | |
MeshBuilder & | operator= (const MeshBuilder &right) |
void | reset () |
void | resetMaterials () |
void | setFaceMaterialIndex (uint32_t faceId, uint32_t index) |
void | setFaceNormalIndices (uint32_t faceId, const IndexVector &indices) |
void | setFaceTextureRegionIndex (uint32_t faceId, uint32_t uvSet, uint32_t index) |
void | setFaceUVIndices (uint32_t faceId, uint32_t uvSet, const IndexVector &indices) |
void | setFaceVertexIndices (uint32_t faceId, const IndexVector &indices) |
void | setName (const std::wstring &name) |
Public Member Functions inherited from prtx::SharedPtrBuilder< Mesh > | |
SharedPtrBuilder & | operator= (const SharedPtrBuilder &)=delete |
SharedPtrBuilder (const SharedPtrBuilder &)=delete | |
A builder to construct meshes. Components (vertex coordinates, normal coordinates, uv coordinates, materials and faces) can be added and get a unique index assigned. The MeshBuilder allows for random access on the faces: faces can be added first and their content defined afterwards.
prtx::MeshBuilder::MeshBuilder | ( | ) |
Constructor. Creates an empty builder.
prtx::MeshBuilder::MeshBuilder | ( | const MeshBuilder & | mb, |
const DoubleVector & | trafoMatrix | ||
) |
Constructor which initializes the builder to a copy of the passed builder where existing vertices and normals are transformed.
mb | The builder to copy and transform. |
trafoMatrix | Matrix to transform the builder with. 4x4 harmonic transformation matrix, column major (OpenGL). |
prtx::MeshBuilder::MeshBuilder | ( | const Mesh & | mesh | ) |
Constructor which initializes the builder to a copy of the passed mesh.
mesh | The mesh to initialize the builder with. |
prtx::MeshBuilder::MeshBuilder | ( | const Mesh & | mesh, |
const DoubleVector & | trafoMatrix | ||
) |
Constructor which initializes the builder to a transformed copy of the passed mesh.
mesh | The mesh to transform and initialize the builder with. |
trafoMatrix | Matrix to transform mesh with. 4x4 harmonic transformation matrix, column major (OpenGL). |
uint32_t prtx::MeshBuilder::addFace | ( | const IndexVector & | vertexIndices, |
const IndexVector & | holeFacesIndices, | ||
uint32_t | materialIndex, | ||
const IndexVector & | normalIndices, | ||
const std::vector< IndexVector > & | uvIndices | ||
) |
Adds a face with the passed indices.
vertexIndices | Vector with vertex indices of face. |
holeFacesIndices | Vector with face indices of holes inside this face. |
materialIndex | Material index for this face. |
normalIndices | Vector with vertex normal indices of face. Might be empty. |
uvIndices | Vector with a vector of uv indices for face. Vectors might be empty. |
uint32_t prtx::MeshBuilder::addFace | ( | const uint32_t * | vertexIndices, |
size_t | vertexIndicesCount, | ||
const uint32_t * | holeFaceIndices, | ||
size_t | holeFacesIndicesCount, | ||
uint32_t | materialIndex, | ||
const uint32_t * | normalIndices, | ||
size_t | normalIndicesCount, | ||
const std::vector< const uint32_t *> & | uvIndices, | ||
const std::vector< size_t > & | uvIndicesCounts | ||
) |
Adds a face with the passed indices.
vertexIndices | Pointer to array of vertex indices. |
vertexIndicesCount | Number of vertex indices in array. |
holeFacesIndices | Pointer to array with face indices of holes inside this face. |
holeFacesIndicesCount | Number of indices in array. Might be empty (count 0). |
materialIndex | Material index for this face. |
normalIndices | Pointer to normal indices of face. Might be empty (count 0). |
normalIndicesCount | Number of normal indices in array. |
uvIndices | Vector with pointers to uv indices for face. Vector might be empty, and individual arrays might be empty. |
uvIndicesCounts | Vector with sizes for the uv index arrays. Same size as uvIndices. Arrays might be empty (count 0). |
uint32_t prtx::MeshBuilder::addFace | ( | ) |
Adds an empty face. Use trhe returned index to setup face details.
void prtx::MeshBuilder::addFaceHoleIndex | ( | uint32_t | faceId, |
uint32_t | index | ||
) |
Adds a hole face index to the selected face.
faceId | Index of face. |
index | Face index of hole to add. |
void prtx::MeshBuilder::addFaceNormalIndex | ( | uint32_t | faceId, |
uint32_t | index | ||
) |
Adds a normal index to the selected face.
faceId | Index of face. |
index | Normal index to add. |
void prtx::MeshBuilder::addFaceUVIndex | ( | uint32_t | faceId, |
uint32_t | uvSet, | ||
uint32_t | i | ||
) |
Adds a uv index to the selected face and the selected uv set.
faceId | Index of face. |
uvSet | Index of uv set. |
index | UV index to add. |
void prtx::MeshBuilder::addFaceVertexIndex | ( | uint32_t | faceId, |
uint32_t | index | ||
) |
Adds a vertex index to the selected face.
faceId | Index of face. |
index | Vertex index to add. |
uint32_t prtx::MeshBuilder::addMaterial | ( | const MaterialPtr & | material | ) |
void prtx::MeshBuilder::addMaterials | ( | const MaterialPtrVector & | materials | ) |
Adds a vector of materials to the material array.
materials | Materials to add. |
uint32_t prtx::MeshBuilder::addNormalCoords | ( | const double | coords[3] | ) |
Adds a normal (i.e. a coordinate triplet) to the normal coordinates array.
coords | (x, y, z) coordinate triplet to add. |
void prtx::MeshBuilder::addNormalCoords | ( | const double * | coords, |
size_t | count | ||
) |
Adds a number of normals (i.e. a number of coordinate triplets) to the normal coordinates array.
coords | Pointer to an array of (x, y, z) coordinate triplets to add. |
count | Number of coordinates (i.e. normalCount * 3) to add. |
void prtx::MeshBuilder::addNormalCoords | ( | const DoubleVector & | coords | ) |
Adds a number of normals (i.e. a number of coordinate triplets) to the normal coordinates array.
coords | Pointer to a vector of (x, y, z) coordinate triplets to add. |
uint32_t prtx::MeshBuilder::addTextureRegionCoords | ( | uint32_t | uvSet, |
const double | coords[4] | ||
) |
Adds a texture region quadruple to the selected texture region array.
uvSet | Index of uv set. |
coords | (u, v) coordinate tuple to add. |
Note: texture regions are only supported by the EncodePreparator, not yet by decoders and CGA itself.
void prtx::MeshBuilder::addTextureRegionCoords | ( | uint32_t | uvSet, |
const double * | coords, | ||
size_t | count | ||
) |
Adds a number of texture region quadruples to the selected texture region array.
uvSet | Index of uv set. |
coords | Pointer to an array of (u_min, v_min, u_max, v_max) coordinate tuples to add. |
count | Number of coordinates (i.e. textureRegionCount * 4) to add. |
Note: texture regions are only supported by the EncodePreparator, not yet by decoders and CGA itself.
void prtx::MeshBuilder::addTextureRegionCoords | ( | uint32_t | uvSet, |
const DoubleVector & | coords | ||
) |
Adds a number of texture region quadruples to the texture region array.
uvSet | Index of uv set. |
coords | Pointer to a vector of (u_min, v_min, u_max, v_max) coordinate quadruples to add. |
Note: texture regions are only supported by the EncodePreparator, not yet by decoders and CGA itself.
uint32_t prtx::MeshBuilder::addUVCoords | ( | uint32_t | uvSet, |
const double | coords[2] | ||
) |
Adds a uv tuple (i.e. a coordinate tuple) to the selected uv coordinates array.
uvSet | Index of uv set. |
coords | (u, v) coordinate tuple to add. |
void prtx::MeshBuilder::addUVCoords | ( | uint32_t | uvSet, |
const double * | coords, | ||
size_t | count | ||
) |
Adds a number of uv tuples (i.e. a number of coordinate tuples) to the selected uv coordinates array.
uvSet | Index of uv set. |
coords | Pointer to an array of (u, v) coordinate tuples to add. |
count | Number of coordinates (i.e. uvTupleCount * 2) to add. |
void prtx::MeshBuilder::addUVCoords | ( | uint32_t | uvSet, |
const DoubleVector & | coords | ||
) |
Adds a number of uv tuples (i.e. a number of coordinate tuples) to the selected uv coordinates array.
uvSet | Index of uv set. |
coords | Pointer to a vector of (u, v) coordinate tuples to add. |
uint32_t prtx::MeshBuilder::addVertexCoords | ( | const double | coords[3] | ) |
Adds a vertex (i.e. a coordinate triplet) to the vertex coordinates array.
coords | (x, y, z) coordinate triplet to add. |
void prtx::MeshBuilder::addVertexCoords | ( | const double * | coords, |
size_t | count | ||
) |
Adds a number of vertices (i.e. a number of coordinate triplets) to the vertex coordinates array.
coords | Pointer to an array of (x, y, z) coordinate triplets to add. |
count | Number of coordinates (i.e. vertexCount * 3) to add. |
void prtx::MeshBuilder::addVertexCoords | ( | const DoubleVector & | coords | ) |
Adds a number of vertices (i.e. a number of coordinate triplets) to the vertex coordinates array.
coords | Pointer to a vector of (x, y, z) coordinate triplets to add. |
|
virtual |
Creates an instance of type C based on the current builder state. Does not modify the builder state.
[out] | warnings | If warnings != 0, a builder implementation may emit warnings about the creation process. |
Implements prtx::SharedPtrBuilder< Mesh >.
|
virtual |
Creates and instance of type C based on the current builder state. Resets the builder state at the end.
[out] | warnings | If warnings != 0, a builder implementation may emit warnings about the creation process. |
Implements prtx::SharedPtrBuilder< Mesh >.
bool prtx::MeshBuilder::isEmpty | ( | ) | const |
void prtx::MeshBuilder::reset | ( | ) |
Resets the builder.
void prtx::MeshBuilder::resetMaterials | ( | ) |
Removes all previously added materials.
void prtx::MeshBuilder::setFaceMaterialIndex | ( | uint32_t | faceId, |
uint32_t | index | ||
) |
Sets the material index of the selected face.
faceId | Index of face. |
index | Material index to set. |
void prtx::MeshBuilder::setFaceNormalIndices | ( | uint32_t | faceId, |
const IndexVector & | indices | ||
) |
Sets the normal indices of the selected face.
faceId | Index of face. |
indices | Normal indices to set. |
void prtx::MeshBuilder::setFaceTextureRegionIndex | ( | uint32_t | faceId, |
uint32_t | uvSet, | ||
uint32_t | index | ||
) |
Sets the texture region index in the selected uv set of the selected face.
faceId | Index of face. |
uvSet | Index of uv set. |
index | texture region index to set. |
void prtx::MeshBuilder::setFaceUVIndices | ( | uint32_t | faceId, |
uint32_t | uvSet, | ||
const IndexVector & | indices | ||
) |
Sets the uv indices of the selected face and the selected uv set.
faceId | Index of face. |
uvSet | Index of uv set. |
indices | UV indices to set. |
void prtx::MeshBuilder::setFaceVertexIndices | ( | uint32_t | faceId, |
const IndexVector & | indices | ||
) |
Sets the vertex indices of the selected face.
faceId | Index of face. |
indices | Vertex indices to set. |
void prtx::MeshBuilder::setName | ( | const std::wstring & | name | ) |
Set the name of the Mesh.
name | name to set. |