EBGeometry
1.0
|
Face class. More...
#include <EBGeometry_DCEL_Face.hpp>
Public Types | |
using | Vec3 = Vec3T< T > |
Alias for vector type. | |
using | Vertex = VertexT< T, Meta > |
Alias for vertex type. | |
using | Edge = EdgeT< T, Meta > |
Alias for edge type. | |
using | Face = FaceT< T, Meta > |
Alias for face type. | |
using | VertexPtr = std::shared_ptr< Vertex > |
Alias for vertex pointer type. | |
using | EdgePtr = std::shared_ptr< Edge > |
Alias for edge pointer type. | |
using | FacePtr = std::shared_ptr< Face > |
Alias for face pointer type. | |
using | EdgeIterator = EdgeIteratorT< T, Meta > |
Alias for edge iterator. | |
Public Member Functions | |
FaceT () | |
Default constructor. Sets the half-edge to zero and the inside/outside algorithm to crossing number algorithm. | |
FaceT (const EdgePtr &a_edge) | |
Partial constructor. Calls default constructor but associates a half-edge. More... | |
FaceT (const Face &a_otherFace) | |
Partial constructor. More... | |
virtual | ~FaceT () |
Destructor (does nothing) | |
void | define (const Vec3 &a_normal, const EdgePtr &a_edge) noexcept |
Define function which sets the normal vector and half-edge. More... | |
void | reconcile () noexcept |
Reconcile face. This will compute the normal vector, area, centroid, and the 2D embedding of the polygon. More... | |
void | flip () noexcept |
Flip the normal vector. | |
void | setHalfEdge (const EdgePtr &a_halfEdge) noexcept |
Set the half edge. More... | |
void | setInsideOutsideAlgorithm (typename Polygon2D< T >::InsideOutsideAlgorithm &a_algorithm) noexcept |
Set the inside/outside algorithm when determining if a point projects to the inside or outside of the polygon. More... | |
EdgePtr & | getHalfEdge () noexcept |
Get modifiable half-edge. | |
const EdgePtr & | getHalfEdge () const noexcept |
Get immutable half-edge. | |
Vec3T< T > & | getCentroid () noexcept |
Get modifiable centroid. | |
const Vec3T< T > & | getCentroid () const noexcept |
Get immutable centroid. | |
T & | getCentroid (const size_t a_dir) noexcept |
Get modifiable centroid position in specified coordinate direction. More... | |
const T & | getCentroid (const size_t a_dir) const noexcept |
Get immutable centroid position in specified coordinate direction. More... | |
Vec3T< T > & | getNormal () noexcept |
Get modifiable normal vector. | |
const Vec3T< T > & | getNormal () const noexcept |
Get immutable normal vector. | |
Meta & | getMetaData () noexcept |
Get meta-data. More... | |
const Meta & | getMetaData () const noexcept |
Get meta-data. More... | |
T | computeArea () noexcept |
Compute the area of this polygon. | |
T | signedDistance (const Vec3 &a_x0) const noexcept |
Compute the signed distance to a point. More... | |
T | unsignedDistance2 (const Vec3 &a_x0) const noexcept |
Compute the unsigned squared distance to a point. More... | |
std::vector< Vec3T< T > > | getAllVertexCoordinates () const noexcept |
Return the coordinates of all the vertices on this polygon. More... | |
std::vector< VertexPtr > | gatherVertices () const noexcept |
Return all the vertices on this polygon. More... | |
Vec3T< T > | getSmallestCoordinate () const noexcept |
Get the lower-left-most coordinate of this polygon face. | |
Vec3T< T > | getHighestCoordinate () const noexcept |
Get the upper-right-most coordinate of this polygon face. | |
Protected Member Functions | |
void | computeCentroid () noexcept |
Compute the centroid position of this polygon. | |
void | computeNormal () noexcept |
Compute the normal position of this polygon. | |
void | computePolygon2D () noexcept |
Compute the 2D embedding of this polygon. | |
void | normalizeNormalVector () noexcept |
Normalize the normal vector, ensuring it has a length of 1. | |
T | getArea () noexcept |
Get the area of this polygon face. | |
T | getArea () const noexcept |
Get the area of this polygon face. | |
void | computeAndStoreEdges () noexcept |
Compute and store all the half-edges around this polygon face. | |
Vec3T< T > | projectPointIntoFacePlane (const Vec3 &a_p) const noexcept |
Compute the projection of a point onto the polygon face plane. More... | |
bool | isPointInsideFace (const Vec3 &a_p) const noexcept |
Check if a point projects to inside or outside the polygon face. More... | |
Protected Attributes | |
EdgePtr | m_halfEdge |
This polygon's half-edge. A valid face will always have != nullptr. | |
Vec3 | m_normal |
Polygon face normal vector. | |
Vec3 | m_centroid |
Polygon face centroid position. | |
Meta | m_metaData |
Meta-data attached to this face. | |
std::shared_ptr< Polygon2D< T > > | m_poly2 |
2D embedding of this polygon. This is the 2D view of the current object projected along its normal vector cardinal. | |
Polygon2D< T >::InsideOutsideAlgorithm | m_poly2Algorithm |
Algorithm for inside/outside tests. | |
Face class.
Class which represents a polygon face in a double-edge connected list (DCEL).
This class is a polygon face in a DCEL mesh. It contains pointer storage to one of the half-edges that circulate the inside of the polygon face, as well as having a normal vector, a centroid, and an area. This class supports signed distance computations. These computations require algorithms that compute e.g. the winding number of the polygon, or the number of times a ray cast passes through it. Thus, one of its central features is that it can be embedded in 2D by projecting it along the cardinal direction of its normal vector. To be fully consistent with a DCEL structure the class stores a reference to one of its half edges, but for performance reasons it also stores references to the other half edges.
DCEL::FaceT< T, Meta >::FaceT | ( | const EdgePtr & | a_edge | ) |
Partial constructor. Calls default constructor but associates a half-edge.
[in] | a_edge | Half-edge |
DCEL::FaceT< T, Meta >::FaceT | ( | const Face & | a_otherFace | ) |
Partial constructor.
Calls default constructor but sets the normal vector and half-edge equal to the other face's (rest is undefined)
|
inlinenoexcept |
Define function which sets the normal vector and half-edge.
[in] | a_normal | Normal vector |
[in] | a_edge | Half edge |
|
inlinenoexcept |
Return all the vertices on this polygon.
This builds a list of all the vertices and returns it.
|
inlinenoexcept |
Return the coordinates of all the vertices on this polygon.
This builds a list of all the vertex coordinates and returns it.
|
inlinenoexcept |
Get immutable centroid position in specified coordinate direction.
[in] | a_dir | Coordinate direction |
|
inlinenoexcept |
Get modifiable centroid position in specified coordinate direction.
[in] | a_dir | Coordinate direction |
|
inlinenoexcept |
Get meta-data.
|
inlinenoexcept |
Get meta-data.
|
inlineprotectednoexcept |
Check if a point projects to inside or outside the polygon face.
[in] | a_p | Point in space |
|
inlineprotectednoexcept |
Compute the projection of a point onto the polygon face plane.
[in] | a_p | Point in space |
|
inlinenoexcept |
Reconcile face. This will compute the normal vector, area, centroid, and the 2D embedding of the polygon.
|
inlinenoexcept |
Set the half edge.
[in] | a_halfEdge | Half edge |
|
inlinenoexcept |
Set the inside/outside algorithm when determining if a point projects to the inside or outside of the polygon.
[in] | a_algorithm | Desired algorithm |
|
inlinenoexcept |
Compute the signed distance to a point.
[in] | a_x0 | Point in space |
This algorithm operates by checking if the input point projects to the inside of the polygon. If it does then the distance is just the projected distance onto the polygon plane and the sign is well-defined. Otherwise, we check the distance to the edges of the polygon.
|
inlinenoexcept |
Compute the unsigned squared distance to a point.
[in] | a_x0 | Point in space |
This algorithm operates by checking if the input point projects to the inside of the polygon. If it does then the distance is just the projected distance onto the polygon plane. Otherwise, we check the distance to the edges of the polygon.