|
| MeshT () noexcept |
| Default constructor. Leaves unobject in an unusable state.
|
|
| MeshT (const Mesh &a_otherMesh)=delete |
| Disallowed copy construction. More...
|
|
| MeshT (std::vector< FacePtr > &a_faces, std::vector< EdgePtr > &a_edges, std::vector< VertexPtr > &a_vertices) noexcept |
| Full constructor. This provides the faces, edges, and vertices to the mesh. More...
|
|
virtual | ~MeshT () noexcept |
| Destructor (does nothing)
|
|
void | define (std::vector< FacePtr > &a_faces, std::vector< EdgePtr > &a_edges, std::vector< VertexPtr > &a_vertices) noexcept |
| Define function. Puts Mesh in usable state. More...
|
|
void | sanityCheck () const noexcept |
| Perform a sanity check. More...
|
|
void | setSearchAlgorithm (const SearchAlgorithm a_algorithm) noexcept |
| Search algorithm for direct signed distance computations. More...
|
|
void | setInsideOutsideAlgorithm (typename Polygon2D< T >::InsideOutsideAlgorithm a_algorithm) noexcept |
| Set the inside/outside algorithm to use when computing the signed distance to polygon faces. More...
|
|
void | reconcile (const DCEL::VertexNormalWeight a_weight=DCEL::VertexNormalWeight::Angle) noexcept |
| Reconcile function which computes the internal parameters in vertices, edges, and faces for use with signed distance functionality. More...
|
|
void | flip () noexcept |
| Flip the mesh, making all the normals change direction. More...
|
|
std::vector< VertexPtr > & | getVertices () noexcept |
| Get modifiable vertices in this mesh.
|
|
const std::vector< VertexPtr > & | getVertices () const noexcept |
| Get immutable vertices in this mesh.
|
|
std::vector< Vec3T< T > > | getAllVertexCoordinates () const noexcept |
| Return all vertex coordinates in the mesh.
|
|
std::vector< EdgePtr > & | getEdges () noexcept |
| Get modifiable half-edges in this mesh.
|
|
const std::vector< EdgePtr > & | getEdges () const noexcept |
| Get immutable half-edges in this mesh.
|
|
std::vector< FacePtr > & | getFaces () noexcept |
| Get modifiable faces in this mesh.
|
|
const std::vector< FacePtr > & | getFaces () const noexcept |
| Get immutable faces in this mesh.
|
|
T | signedDistance (const Vec3 &a_x0) const noexcept |
| Compute the signed distance from a point to this mesh. More...
|
|
T | signedDistance (const Vec3 &a_x0, SearchAlgorithm a_algorithm) const noexcept |
| Compute the signed distance from a point to this mesh. More...
|
|
T | unsignedDistance2 (const Vec3 &a_x0) const noexcept |
| Compute the unsigned square distance from a point to this mesh. More...
|
|
template<class T, class Meta>
class DCEL::MeshT< T, Meta >
Mesh class.
Mesh class which stores a full DCEL mesh (with signed distance functions)
This encapsulates a full DCEL mesh, and also includes DIRECT signed distance functions. The mesh consists of a set of vertices, half-edges, and polygon faces who each have references to other vertices, half-edges, and polygon faces. The signed distance functions DIRECT, which means that they go through ALL of the polygon faces and compute the signed distance to them. This is extremely inefficient, which is why this class is almost always embedded into a bounding volume hierarchy.
- Note
- This class is not for the light of heart – it will almost always be instantiated through a file parser which reads vertices and edges from file and builds the mesh from that. Do not try to build a MeshT object yourself, use file parsers!
template<class T , class Meta >
Full constructor. This provides the faces, edges, and vertices to the mesh.
Calls define(a_faces, a_edges, a_vertices)
- Parameters
-
[in] | a_faces | Polygon faces |
[in] | a_edges | Half-edges |
[in] | a_vertices | Vertices |
- Note
- The constructor arguments should provide a complete DCEL mesh description. This is usually done through a file parser which reads a mesh file format and creates the DCEL mesh structure
template<class T , class Meta >
Reconcile function which computes the internal parameters in vertices, edges, and faces for use with signed distance functionality.
- Parameters
-
[in] | a_weight | Vertex angle weighting function. Either VertexNormalWeight::None for unweighted vertex normals or VertexNormalWeight::Angle for the pseudonormal |
This will reconcile faces, edges, and vertices, e.g. computing the area and normal vector for faces
template<class T , class Meta >
Compute the signed distance from a point to this mesh.
- Parameters
-
[in] | a_x0 | 3D point in space. |
This function will iterate through ALL faces in the mesh and return the value with the smallest magnitude. This is horrendously slow, which is why this function is almost never called. Rather, MeshT<T, Meta> can be embedded in a bounding volume hierarchy for faster access.
- Note
- This will call the other version with the object's search algorithm.
template<class T , class Meta >
Compute the signed distance from a point to this mesh.
- Parameters
-
[in] | a_x0 | 3D point in space. |
[in] | a_algorithm | Search algorithm |
This function will iterate through ALL faces in the mesh and return the value with the smallest magnitude. This is horrendously slow, which is why this function is almost never called. Rather, MeshT<T, Meta> can be embedded in a bounding volume hierarchy for faster access.
template<class T , class Meta >
Compute the unsigned square distance from a point to this mesh.
- Parameters
-
[in] | a_x0 | 3D point in space. |
This function will iterate through ALL faces in the mesh and return the value with the smallest magnitude. This is horrendously slow, which is why this function is almost never called. Rather, MeshT<T, Meta> can be embedded in a bounding volume hierarchy for faster access.
- Note
- This will call the other version with the object's search algorithm.