51 template <
typename SizeT>
54 seed ^= value + 0x9e3779b9 + (seed << 6) + (seed >> 2);
59 struct hash<
std::array<T, 3>>
77 inline std::size_t
operator()(
const std::array<T, 3>& k)
const
79 size_t seed = std::hash<T>()(k[0]);
97 template <
typename ptr_type>
123 template <
typename numeric_type =
float>
145 void SetVert(
int index, numeric_type x, numeric_type y, numeric_type z);
165 void VectorsToBuffers(
const std::vector<std::array<numeric_type, 3>>& vertices);
218 const std::vector<std::array<numeric_type, 3>>& vertices,
220 std::string
name =
""
266 const std::vector<numeric_type>& in_vertices,
267 const std::vector<int>& in_indexes,
269 std::string
name =
""
312 void AddVerts(
const std::vector<std::array<numeric_type, 3>>&
verts);
495 void PerformRotation(numeric_type rx, numeric_type ry, numeric_type rz);
809 std::array<numeric_type, 3>
operator[](
int i)
const;
void array_hash_combine_impl(SizeT &seed, SizeT value)
Combine the hash of value into seed.
Manipulate and load geometry from disk.
unsigned int * faces
[xyz] * 3(triangle) * num_faces
double * facevarying_vertex_colors
[xyz] * 3(triangle) * num_faces
double * facevarying_binormals
[xyz] * 3(triangle) * num_faces
double * facevarying_tangents
[xyz] * 3(triangle) * num_faces
double * facevarying_uvs
[xyz] * 3(triangle) * num_faces
unsigned int * material_ids
triangle x num_faces
double * facevarying_normals
[xyz] * num_vertices
std::size_t operator()(const std::array< T, 3 > &k) const
Calculate a hash for k.
A simple type to hold the size and data pointer of an array.
int size
Number of elements in data
std::vector< ptr_type > CopyArray() const
Pointer to some array.
A collection of vertices and indices representing geometry.
void AddVerts(const std::vector< std::array< numeric_type, 3 > > &verts)
Add more vertices to this mesh.
MeshInfo(const std::vector< std::array< numeric_type, 3 > > &vertices, int id, std::string name="")
Construct a new MeshInfo object from an unindexed vector of vertices, an ID, and a name.
Eigen::Matrix3X< int > indices
3 by X matrix of indices for triangles.
int GetMeshID() const
Get the ID of this mesh.
bool operator==(const MeshInfo &M2) const
Compare the vertices of two MeshInfo objects.
void PerformRotation(numeric_type rx, numeric_type ry, numeric_type rz)
Rotate this mesh by x, y, z rotations in degrees (pitch, yaw, roll).
std::array< numeric_type, 3 > operator[](int i) const
Get vertex at a specific index in the mesh.
void SetMeshID(int new_id)
Change the ID of this mesh.
std::vector< std::array< numeric_type, 3 > > GetUnindexedVertices() const
Retrieve an unindexed array of this mesh's vertices.
MeshInfo(const std::vector< numeric_type > &in_vertices, const std::vector< int > &in_indexes, int id, std::string name="")
Construct a new MeshInfo object from an indexed vector of vertices.
void SetVert(int index, numeric_type x, numeric_type y, numeric_type z)
Change the position of the vertex at index.
int meshid
Identifier for this mesh.
void ConvertToOBJCoordinates()
Convert a mesh from Z-Up to Y-Up.
int NumTris() const
Calculate the total number of triangles in this mesh.
std::string name
A human-readable title.
int NumVerts() const
Determine how many vertices are in this mesh.
MeshInfo()
Construct an empty instance of MeshInfo.
void VectorsToBuffers(const std::vector< std::array< numeric_type, 3 > > &vertices)
Index vertices then insert them into verts and indices.
const array_and_size< int > GetIndexPointer() const
Get a pointer to the index array of this mesh.
const array_and_size< numeric_type > GetVertexPointer() const
Get a pointer to the vertex array of this mesh.
VertMatrix verts
3 by X matrix of vertices
Eigen::Matrix3X< numeric_type > VertMatrix
void ConvertToRhinoCoordinates()
Convert a mesh from Y-Up to Z-Up.
std::vector< numeric_type > GetIndexedVertices() const
A copy of every vertex in this array.
std::vector< int > getRawIndices() const
Retrieve a copy of this mesh's index buffer as a 1D array.