#include <sc_store.h>

Inheritance diagram for SC::Store::Mesh:
SC::Store::BaseMesh

Public Types

enum  Bits : uint32_t {
  None = 0x00000000, ClockwiseWinding = 0x00000001, CounterClockwiseWinding = 0x00000002, TwoSided = 0x00000004,
  FaceNormals = 0x00000010, FaceUVs = 0x00000020, FaceRGBA32s = 0x00000040, LineNormals = 0x00000100,
  LineUVs = 0x00000200, LineRGBA32s = 0x00000400, PointNormals = 0x00001000, PointUVs = 0x00002000,
  PointRGBA32s = 0x00004000, Manifold = 0x00010000, RandomizedPoints = 0x00020000, Default
}
 

Public Member Functions

 Mesh ()=default
 
 Mesh (const Mesh &other)=delete
 
 Mesh (Mesh &&other)=default
 
bool operator!= (Mesh const &that) const
 
Meshoperator= (const Mesh &other)=delete
 
Meshoperator= (Mesh &&other)=default
 
bool operator== (Mesh const &that) const
 
 ~Mesh ()=default
 

Public Attributes

std::vector< MeshElementface_elements
 These define the mesh's faces. More...
 
std::vector< uint8_t > face_elements_bits
 Optional bits for filtering selections on the mesh element. More...
 
Bits flags = Bits::Default
 Bits that specify this mesh's details. More...
 
MaterialMapKey mesh_face_element_material_map
 
MaterialKey mesh_face_material
 Optional material that applies to the Mesh faces. More...
 
MaterialMapKey mesh_line_element_material_map
 
MaterialKey mesh_line_material
 Optional material that applies to the Mesh lines. More...
 
MaterialMapKey mesh_point_element_material_map
 
MaterialKey mesh_point_material
 Optional material that applies to the Mesh points. More...
 
uint32_t normal_count
 The number of Normal elements in the normals array. More...
 
Normal const * normals
 An array of normals. More...
 
uint32_t point_count
 The number of Point elements in the points array. More...
 
std::vector< MeshElementpoint_elements
 These define the mesh's points. More...
 
std::vector< uint8_t > point_elements_bits
 Optional bits for filtering selections on the mesh element. More...
 
Point const * points
 An array of points. More...
 
std::vector< MeshElementpolyline_elements
 These define the mesh's lines. More...
 
std::vector< uint8_t > polyline_elements_bits
 Optional bits for filtering selections on the mesh element. More...
 
uint32_t rgba32_count
 The number of RGBA32 elements in the rgba32s array. More...
 
RGBA32 const * rgba32s
 An array of RGBA32 color values. More...
 
uint32_t uv_count
 The number of UV elements in the uvs array. More...
 
UV const * uvs
 An array of UV points. More...
 

Detailed Description

The Mesh class is used to define a MeshKey.

It contains any number of face elements, polyline elements, and point elements.

It may specify a MaterialKey for its faces, polylines and points. These MaterialKeys are the default material used for an instance that does not provide specific instance-level materials.

A mesh element index may be given an optional MaterialKey by providing a MaterialMapKey. This MaterialMapKey is the default for any instance of this mesh.

A Mesh is movable but not copyable.

Member Enumeration Documentation

◆ Bits

enum SC::Store::Mesh::Bits : uint32_t
Enumerator
None 
ClockwiseWinding 

Set a winding if known.

CounterClockwiseWinding 
TwoSided 

If set, the mesh will not be back-face culled.

FaceNormals 

Set if normals are present in the BaseMesh.

FaceUVs 

Set if UVs are present in the BaseMesh.

FaceRGBA32s 

Set if RGBA32s are present in the BaseMesh.

LineNormals 

Set if normals are present in the BaseMesh.

LineUVs 

Set if UVs are present in the BaseMesh.

LineRGBA32s 

Set if RGBA32s are present in the BaseMesh.

PointNormals 

Set if normals are present in the BaseMesh.

PointUVs 

Set if UVs are present in the BaseMesh.

PointRGBA32s 

Set if PointRGBA32s are present in the BaseMesh.

Manifold 

Set if mesh faces define a manifold body. This allows cutting plane capping for the mesh.

RandomizedPoints 

Set if mesh points are randomized. This allows vertex decimation for the mesh.

Default 

Constructor & Destructor Documentation

◆ ~Mesh()

SC::Store::Mesh::~Mesh ( )
default

◆ Mesh() [1/3]

SC::Store::Mesh::Mesh ( )
default

◆ Mesh() [2/3]

SC::Store::Mesh::Mesh ( const Mesh other)
delete

◆ Mesh() [3/3]

SC::Store::Mesh::Mesh ( Mesh &&  other)
default

Member Function Documentation

◆ operator!=()

bool SC::Store::Mesh::operator!= ( Mesh const &  that) const

◆ operator=() [1/2]

Mesh& SC::Store::Mesh::operator= ( const Mesh other)
delete

◆ operator=() [2/2]

Mesh& SC::Store::Mesh::operator= ( Mesh &&  other)
default

◆ operator==()

bool SC::Store::Mesh::operator== ( Mesh const &  that) const

Member Data Documentation

◆ face_elements

std::vector<MeshElement> SC::Store::Mesh::face_elements

These define the mesh's faces.

◆ face_elements_bits

std::vector<uint8_t> SC::Store::Mesh::face_elements_bits

Optional bits for filtering selections on the mesh element.

The default bit value is 0. The provided values will cycle for all mesh elements. If the vector of bits is length 1, then the single value will apply for all mesh elements of the type. If more bits are provided than mesh elements it will throw an exception.

◆ flags

Bits SC::Store::Mesh::flags = Bits::Default

Bits that specify this mesh's details.

◆ mesh_face_element_material_map

MaterialMapKey SC::Store::Mesh::mesh_face_element_material_map

Optional material map that applies to faces in the MeshElement at the matching indices.

◆ mesh_face_material

MaterialKey SC::Store::Mesh::mesh_face_material

Optional material that applies to the Mesh faces.

◆ mesh_line_element_material_map

MaterialMapKey SC::Store::Mesh::mesh_line_element_material_map

Optional material map that applies to lines in the MeshElement at the matching indices.

◆ mesh_line_material

MaterialKey SC::Store::Mesh::mesh_line_material

Optional material that applies to the Mesh lines.

◆ mesh_point_element_material_map

MaterialMapKey SC::Store::Mesh::mesh_point_element_material_map

Optional material map that applies to points in the MeshElement at the matching indices.

◆ mesh_point_material

MaterialKey SC::Store::Mesh::mesh_point_material

Optional material that applies to the Mesh points.

◆ normal_count

uint32_t SC::Store::BaseMesh::normal_count
inherited

The number of Normal elements in the normals array.

A normals array with the elements { 0.0f, -1.0f, 0.0f }, { 0.0f, 0.0f, 1.0f } would have a normal_count of 2.

◆ normals

Normal const* SC::Store::BaseMesh::normals
inherited

An array of normals.

Each normal is constructed with a three-element float array. For example:

SC::Store::Normal normals[] = {
{ 0.0f, -1.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f },
};

◆ point_count

uint32_t SC::Store::BaseMesh::point_count
inherited

The number of Point elements in the points array.

A points array with the elements { 0.0f, 0.0f, 1.0f }, { 1.0f, 0.0f, 1.0f } would have a point_count of 2.

◆ point_elements

std::vector<MeshElement> SC::Store::Mesh::point_elements

These define the mesh's points.

◆ point_elements_bits

std::vector<uint8_t> SC::Store::Mesh::point_elements_bits

Optional bits for filtering selections on the mesh element.

◆ points

Point const* SC::Store::BaseMesh::points
inherited

An array of points.

Each point is constructed with a three-element float array. For example:

SC::Store::Point points[] = {
{ 0.0f, 0.0f, 1.0f },
{ 1.0f, 0.0f, 1.0f },
};

◆ polyline_elements

std::vector<MeshElement> SC::Store::Mesh::polyline_elements

These define the mesh's lines.

◆ polyline_elements_bits

std::vector<uint8_t> SC::Store::Mesh::polyline_elements_bits

Optional bits for filtering selections on the mesh element.

◆ rgba32_count

uint32_t SC::Store::BaseMesh::rgba32_count
inherited

The number of RGBA32 elements in the rgba32s array.

An rgba32s array with the elements { RGBA32(255, 0, 0, 255), RGBA32(255, 0, 0, 128) } would have an rgba32_count of 2.

◆ rgba32s

RGBA32 const* SC::Store::BaseMesh::rgba32s
inherited

An array of RGBA32 color values.

Each RGBA32 object is constructed with a four-element array of 8-bit integers (0–255). For example:

SC::Store::RGBA32 rgba[] = {
RGBA32(255, 0, 0, 255),
RGBA32(255, 0, 0, 128),
};

◆ uv_count

uint32_t SC::Store::BaseMesh::uv_count
inherited

The number of UV elements in the uvs array.

A uvs array with the elements { 0.0f, 0.0f }, { 1.0f, 0.0f } would have a uv_count of 2.

◆ uvs

UV const* SC::Store::BaseMesh::uvs
inherited

An array of UV points.

Each UV is constructed with a two-element float array. For example:

SC::Store::UV uvs[] = {
{ 0.0f, -1.0f },
{ 0.0f, 0.0f },
};