EBGeometry  1.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DCEL::EdgeT< T, Meta > Class Template Reference

Edge class. More...

#include <EBGeometry_DCEL_Edge.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.
 

Public Member Functions

 EdgeT ()
 Default constructor. Sets all pointers to zero and vectors to zero vectors.
 
 EdgeT (const Edge &a_otherEdge)
 Copy constructor. Copies all information from the other half-edge. More...
 
 EdgeT (const VertexPtr &a_vertex)
 Partial constructor. Calls the default constructor but sets the starting vertex. More...
 
virtual ~EdgeT ()
 Destructor (does nothing)
 
size_t size () const noexcept
 Get size (in bytes) of this object.
 
void define (const VertexPtr &a_vertex, const EdgePtr &a_pairEdge, const EdgePtr &a_nextEdge) noexcept
 Define function. Sets the starting vertex, edges, and normal vectors. More...
 
void reconcile () noexcept
 Reconcile internal logic. More...
 
void flip () noexcept
 Flip surface normal.
 
void setVertex (const VertexPtr &a_vertex) noexcept
 Set the starting vertex. More...
 
void setPairEdge (const EdgePtr &a_pairEdge) noexcept
 Set the pair edge. More...
 
void setNextEdge (const EdgePtr &a_nextEdge) noexcept
 Set the next edge. More...
 
void setFace (const FacePtr &a_face) noexcept
 Set the pointer to this half-edge's face.
 
VertexPtrgetVertex () noexcept
 Get modifiable starting vertex. More...
 
const VertexPtrgetVertex () const noexcept
 Get immutable starting vertex. More...
 
VertexPtrgetOtherVertex () noexcept
 Get modifiable end vertex. More...
 
const VertexPtrgetOtherVertex () const noexcept
 Get immutable end vertex. More...
 
EdgePtrgetPairEdge () noexcept
 Get modifiable pair edge. More...
 
const EdgePtrgetPairEdge () const noexcept
 Get immutable pair edge. More...
 
EdgePtrgetNextEdge () noexcept
 Get modifiable next edge. More...
 
const EdgePtrgetNextEdge () const noexcept
 Get immutable next edge. More...
 
Vec3T< T > computeNormal () const noexcept
 Compute the normal vector.
 
const Vec3T< T > & getNormal () const noexcept
 Get the normal vector.
 
FacePtrgetFace () noexcept
 Get modifiable half-edge face.
 
const FacePtrgetFace () const noexcept
 Get immutable half-edge face.
 
Meta & getMetaData () noexcept
 Get meta-data. More...
 
const Meta & getMetaData () const noexcept
 Get meta-data. More...
 
signedDistance (const Vec3 &a_x0) const noexcept
 Get the signed distance to this half edge. More...
 
unsignedDistance2 (const Vec3 &a_x0) const noexcept
 Get the signed distance to this half edge. More...
 

Protected Member Functions

projectPointToEdge (const Vec3 &a_x0) const noexcept
 Returns the "projection" of a point to an edge. More...
 
Vec3T< T > getX2X1 () const noexcept
 Get the vector pointing along this edge.
 

Protected Attributes

Vec3 m_normal
 Normal vector.
 
VertexPtr m_vertex
 Starting vertex.
 
EdgePtr m_pairEdge
 Pair edge.
 
EdgePtr m_nextEdge
 Next edge.
 
FacePtr m_face
 Enclosing polygon face.
 
Meta m_metaData
 Meta-data attached to this edge.
 

Detailed Description

template<class T, class Meta>
class DCEL::EdgeT< T, Meta >

Edge class.

Class which represents a half-edge in a double-edge connected list (DCEL).

This class is used in DCEL functionality which stores polygonal surfaces in a mesh. The information contain in an EdgeT object contains the necessary object for logically circulating the inside of a polygon face. This means that a polygon face has a double-connected list of half-edges which circulate the interior of the face. The EdgeT object is such a half-edge; it represents the outgoing half-edge from a vertex, located such that it can be logically represented as a half edge on the "inside" of a polygon face. It contains pointers to the polygon face, vertex, and next half edge It also contains a pointer to the "pair" half edge, i.e. the corresponding half-edge on the other face that shares this edge. Since this class is used with DCEL functionality and signed distance fields, this class also has a signed distance function and thus a "normal vector".

Note
The normal vector is outgoing, i.e. a point x is "outside" if the dot product between n and (x - x0) is positive.

Constructor & Destructor Documentation

◆ EdgeT() [1/2]

template<class T , class Meta >
DCEL::EdgeT< T, Meta >::EdgeT ( const Edge a_otherEdge)

Copy constructor. Copies all information from the other half-edge.

Parameters
[in]a_otherEdgeOther edge

◆ EdgeT() [2/2]

template<class T , class Meta >
DCEL::EdgeT< T, Meta >::EdgeT ( const VertexPtr a_vertex)

Partial constructor. Calls the default constructor but sets the starting vertex.

Parameters
[in]a_vertexStarting vertex.

Member Function Documentation

◆ define()

template<class T , class Meta >
void DCEL::EdgeT< T, Meta >::define ( const VertexPtr a_vertex,
const EdgePtr a_pairEdge,
const EdgePtr a_nextEdge 
)
inlinenoexcept

Define function. Sets the starting vertex, edges, and normal vectors.

Parameters
[in]a_vertexStarting vertex
[in]a_pairEdgePair half-edge
[in]a_nextEdgeNext half-edge

◆ getMetaData() [1/2]

template<class T , class Meta >
const Meta& DCEL::EdgeT< T, Meta >::getMetaData ( ) const
inlinenoexcept

Get meta-data.

Returns
m_metaData

◆ getMetaData() [2/2]

template<class T , class Meta >
Meta& DCEL::EdgeT< T, Meta >::getMetaData ( )
inlinenoexcept

Get meta-data.

Returns
m_metaData

◆ getNextEdge() [1/2]

template<class T , class Meta >
const EdgePtr& DCEL::EdgeT< T, Meta >::getNextEdge ( ) const
inlinenoexcept

Get immutable next edge.

Returns
Returns the next edge

◆ getNextEdge() [2/2]

template<class T , class Meta >
EdgePtr& DCEL::EdgeT< T, Meta >::getNextEdge ( )
inlinenoexcept

Get modifiable next edge.

Returns
Returns the next edge

◆ getOtherVertex() [1/2]

template<class T , class Meta >
const VertexPtr& DCEL::EdgeT< T, Meta >::getOtherVertex ( ) const
inlinenoexcept

Get immutable end vertex.

Returns
Returns the next half-edge's starting vertex

◆ getOtherVertex() [2/2]

template<class T , class Meta >
VertexPtr& DCEL::EdgeT< T, Meta >::getOtherVertex ( )
inlinenoexcept

Get modifiable end vertex.

Returns
Returns the next half-edge's starting vertex

◆ getPairEdge() [1/2]

template<class T , class Meta >
const EdgePtr& DCEL::EdgeT< T, Meta >::getPairEdge ( ) const
inlinenoexcept

Get immutable pair edge.

Returns
Returns the pair edge

◆ getPairEdge() [2/2]

template<class T , class Meta >
EdgePtr& DCEL::EdgeT< T, Meta >::getPairEdge ( )
inlinenoexcept

Get modifiable pair edge.

Returns
Returns the pair edge

◆ getVertex() [1/2]

template<class T , class Meta >
const VertexPtr& DCEL::EdgeT< T, Meta >::getVertex ( ) const
inlinenoexcept

Get immutable starting vertex.

Returns
Returns m_vertex

◆ getVertex() [2/2]

template<class T , class Meta >
VertexPtr& DCEL::EdgeT< T, Meta >::getVertex ( )
inlinenoexcept

Get modifiable starting vertex.

Returns
Returns m_vertex

◆ projectPointToEdge()

template<class T , class Meta >
T DCEL::EdgeT< T, Meta >::projectPointToEdge ( const Vec3 a_x0) const
inlineprotectednoexcept

Returns the "projection" of a point to an edge.

This function parametrizes the edge as x(t) = x0 + (x1-x0)*t and returns where on the this edge the point a_x0 projects. If projects onto the edge if t = [0,1] and to one of the start/end vertices otherwise.

◆ reconcile()

template<class T , class Meta >
void DCEL::EdgeT< T, Meta >::reconcile ( )
inlinenoexcept

Reconcile internal logic.

Computes normal.

◆ setNextEdge()

template<class T , class Meta >
void DCEL::EdgeT< T, Meta >::setNextEdge ( const EdgePtr a_nextEdge)
inlinenoexcept

Set the next edge.

Parameters
[in]a_nextEdgeNext edge

◆ setPairEdge()

template<class T , class Meta >
void DCEL::EdgeT< T, Meta >::setPairEdge ( const EdgePtr a_pairEdge)
inlinenoexcept

Set the pair edge.

Parameters
[in]a_pairEdgePair edge

◆ setVertex()

template<class T , class Meta >
void DCEL::EdgeT< T, Meta >::setVertex ( const VertexPtr a_vertex)
inlinenoexcept

Set the starting vertex.

Parameters
[in]a_vertexStarting vertex

◆ signedDistance()

template<class T , class Meta >
T DCEL::EdgeT< T, Meta >::signedDistance ( const Vec3 a_x0) const
inlinenoexcept

Get the signed distance to this half edge.

This routine will check if the input point projects to the edge or one of the vertices. If it projectes to one of the vertices we compute the signed distance to the corresponding vertex. Otherwise we compute the projection to the edge and compute the sign from the normal vector.

◆ unsignedDistance2()

template<class T , class Meta >
T DCEL::EdgeT< T, Meta >::unsignedDistance2 ( const Vec3 a_x0) const
inlinenoexcept

Get the signed distance to this half edge.

This routine will check if the input point projects to the edge or one of the vertices. If it projectes to one of the vertices we compute the squared distance to the corresponding vertex. Otherwise we compute the squared distance of the projection to the edge. This is faster than signedDistance()


The documentation for this class was generated from the following files: