#include <sc_store.h>

Public Member Functions

 MeshElement ()
 
 MeshElement (MeshElement const &)=default
 
 MeshElement (MeshElement &&that)
 
bool operator!= (MeshElement const &that) const
 
MeshElementoperator= (MeshElement const &)=default
 
MeshElementoperator= (MeshElement &&that)
 
bool operator== (MeshElement const &that) const
 

Public Attributes

std::vector< uint32_t > indices
 

Detailed Description

The MeshElement class is used to define a Mesh.

These elements define a mesh's faces, polylines and points using indices that refer into its BaseMesh pointers.

The encoding scheme for the mesh element's indices are given by:

  • For face elements - A sequence of grouped indices from the base mesh. Every sequence of three index groups defines a triangle in the mesh. A grouped index is a single point, vertex normal, UV, and/or RGBA32 index from the base mesh, denoting a point and its local properties. For each property that is defined (i.e., non-null) in the base mesh, the grouped index must contain an index into that property. The order in which the indices appear are given by the following ordering: point, normal, UV, and then RGBA32. Only complete triangles are allowed in the encoding.
  • For polyline elements - A sequence of point indices from the base mesh. The order in which the points are denoted describe the polygonal line in the mesh. Using (~(uint32_t)0) in a polyline index list is a special token used to break a polyline into a new polyline.
  • For point elements - A sequence of point indices from the base mesh. Each index defines a geometry point in the mesh.

Note: A point element is not to be confused with a base mesh's point array. The base mesh point array is solely used to index into in order to define actual mesh element geometry.

Constructor & Destructor Documentation

◆ MeshElement() [1/3]

SC::Store::MeshElement::MeshElement ( )

◆ MeshElement() [2/3]

SC::Store::MeshElement::MeshElement ( MeshElement const &  )
default

◆ MeshElement() [3/3]

SC::Store::MeshElement::MeshElement ( MeshElement &&  that)

Member Function Documentation

◆ operator!=()

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

◆ operator=() [1/2]

MeshElement& SC::Store::MeshElement::operator= ( MeshElement const &  )
default

◆ operator=() [2/2]

MeshElement& SC::Store::MeshElement::operator= ( MeshElement &&  that)

◆ operator==()

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

Member Data Documentation

◆ indices

std::vector<uint32_t> SC::Store::MeshElement::indices

These indices must match the flags provided to the Mesh. By default Faces use normals, UVs and rgba32s and lines and points use rgba32s.

If normals only exist 'PNPNPN' defines a triangle else 'PPP' for points only or 'PUPUPU' for UVs or 'PNUPNU' for normals and UVs or 'PRPR' for points and rgba32s or 'PNRPNR' etc.

A polyline or points is drawn on base mesh points 'P' or 'PR'.