78 : m_origin(origin), m_end(end), m_length(length)
81 gsWarn <<
"Halfedge: Origin and end must be indices > 0 and length should be positiv or 0. One of the values is not correct:"
82 << std::endl <<
"origin: " << origin << std::endl <<
"end: " << end << std::endl
97 size_t getEnd()
const {
return m_end; }
111 {
return (m_end == nextHalfedge.
m_origin); }
119 {
return (m_origin == previousHalfedge.
m_end); }
127 {
return (m_origin == halfedge.
m_end && m_end == halfedge.
m_origin); }
170 bool isEmpty()
const {
return m_chainedHalfedges.empty(); }
183 bool isClosed()
const;
193 size_t getNumberOfVertices()
const;
212 std::vector<T> getHalfedgeLengths()
const;
222 const Halfedge &getFirstHalfedge()
const;
232 const Halfedge &getLastHalfedge()
const;
248 const std::list<size_t> getVertexIndices()
const;
272 T getShortestDistanceBetween(
size_t i,
size_t j, T precision)
const;
297 T getDistanceBetween(
size_t i,
size_t j)
const;
314 bool isVertexContained(
const size_t &vertexIndex)
const;
325 bool isAppendableAsPrev(
const Halfedge &previousHalfedge)
const;
336 bool isAppendableAsNext(
const Halfedge &nextHalfedge)
const;
346 void appendPrevHalfedge(
const Halfedge &prevHalfedge);
357 void appendNextHalfedge(
const Halfedge &nextHalfedge,
bool ignoreWarning =
false);
410 for(
typename std::vector<Chain>::const_iterator it=m_boundary.begin(); it!=m_boundary.end(); ++it)
411 result += it->getNumberOfVertices();
425 for(
typename std::vector<Chain>::const_iterator it=m_boundary.begin(); it!=m_boundary.end(); ++it)
426 result += it->getLength();
439 std::vector<T> result;
440 for(
typename std::vector<Chain>::const_iterator it=m_boundary.begin(); it!=m_boundary.end(); ++it)
442 const std::vector<T> lengthsOneComp = it->getHalfedgeLengths();
443 result.insert(result.end(), lengthsOneComp.begin(), lengthsOneComp.end());
457 std::list<size_t> result;
458 for(
typename std::vector<Chain>::const_iterator it=m_boundary.begin(); it!=m_boundary.end(); ++it)
460 const std::list<size_t>& indicesOneComp = it->getVertexIndices();
461 result.insert(result.end(), indicesOneComp.begin(), indicesOneComp.end());
479 for(
typename std::vector<Chain>::const_iterator it=m_boundary.begin(); it!=m_boundary.end(); ++it)
481 T dist = it->getShortestDistanceBetween(i, j, precision);
502 for(
typename std::vector<Chain>::const_iterator it=m_boundary.begin(); it!=m_boundary.end(); ++it)
504 T dist = it->getDistanceBetween(i, j);
520 for(
typename std::vector<Chain>::const_iterator it=m_boundary.begin(); it!=m_boundary.end(); ++it)
521 if(it->isVertexContained(internVertexIndex))
536 const std::list<Halfedge> findNonTwinHalfedges(
const std::vector<Halfedge> &allHalfedges);
563 size_t getNumberOfVertices()
const;
571 size_t getNumberOfTriangles()
const;
579 size_t getNumberOfInnerVertices()
const;
587 size_t getNumberOfBoundaryVertices()
const;
596 const typename gsMesh<T>::gsVertexHandle &getVertex(
const size_t vertexIndex)
const;
614 size_t getGlobalVertexIndex(const size_t localVertexIndex, const size_t triangleIndex) const;
622 T getBoundaryLength() const;
634 std::vector<T> getCornerLengths(/*const*/ std::vector<index_t> &corners)
const;
644 const std::vector<T> getBoundaryChordLengths()
const;
655 T getShortestBoundaryDistanceBetween(
size_t i,
size_t j)
const;
666 T getHalfedgeLength(
const size_t originVertexIndex,
const size_t endVertexIndex)
const;
680 const std::queue<Halfedge>
681 getOppositeHalfedges(
const size_t vertexIndex,
const bool innerVertex = 1)
const;
698 short_t isTriangleVertex(
size_t vertexIndex,
size_t triangleIndex)
const;
703 return m_boundary.getVertexIndices();
709 return findVertex(vertex->
x(), vertex->
y(), vertex->
z());
713 size_t findVertex(T x, T y, T z,
bool sorted =
false, real_t tol = 1e-6)
const;
718 return this->m_vertex[globIndex];
721 size_t unsorted(
const size_t index)
const
723 return m_inverseSorting[index];
735 bool isBoundaryVertex(
const size_t internVertexIndex)
const;
763 getInternHalfedge(
const typename gsMesh<T>::gsFaceHandle &triangle,
size_t numberOfHalfedge)
const;
792#ifndef GISMO_BUILD_LIB
793#include GISMO_HPP_HEADER(gsHalfEdgeMesh.hpp)
Class that maintains boundary of triangle mesh.
Definition gsHalfEdgeMesh.h:379
T getDistanceBetween(const size_t &i, const size_t &j) const
Get distance between vertices.
Definition gsHalfEdgeMesh.h:500
size_t getNumberOfVertices() const
Get number of vertices.
Definition gsHalfEdgeMesh.h:407
T getShortestDistanceBetween(const size_t &i, const size_t &j, T precision) const
Get distance between vertices.
Definition gsHalfEdgeMesh.h:477
Boundary()
Empty Constructor.
Definition gsHalfEdgeMesh.h:383
bool isVertexContained(const size_t &internVertexIndex) const
Tells if vertex is contained in boundary chain.
Definition gsHalfEdgeMesh.h:518
const std::vector< T > getHalfedgeLengths() const
Get halfedge lengths.
Definition gsHalfEdgeMesh.h:437
std::vector< Chain > m_boundary
boundary chains
Definition gsHalfEdgeMesh.h:538
const std::list< size_t > getVertexIndices() const
Get list of vertex indices in the chain.
Definition gsHalfEdgeMesh.h:455
Boundary(const std::vector< Halfedge > &halfedges)
Constructor.
T getLength() const
Get length.
Definition gsHalfEdgeMesh.h:422
Class that maintains chain of halfedges.
Definition gsHalfEdgeMesh.h:157
std::list< Halfedge > m_chainedHalfedges
list of halfedges
Definition gsHalfEdgeMesh.h:360
bool isEmpty() const
Tells whether chain is empty or not.
Definition gsHalfEdgeMesh.h:170
Class that maintains directed halfedges in any dimension.
Definition gsHalfEdgeMesh.h:65
bool isNext(const Halfedge &previousHalfedge) const
Tells if halfedge can be added at beginning.
Definition gsHalfEdgeMesh.h:118
size_t m_end
index of end vertex
Definition gsHalfEdgeMesh.h:131
bool isPrev(const Halfedge &nextHalfedge) const
Tells if halfedge can be added at end.
Definition gsHalfEdgeMesh.h:110
T m_length
length of halfedge
Definition gsHalfEdgeMesh.h:132
size_t m_origin
index of origin vertex
Definition gsHalfEdgeMesh.h:130
Halfedge(const size_t origin=0, const size_t end=0, const T length=0)
This constructor sets the origin- and * end-point indices as well as length to preferred values.
Definition gsHalfEdgeMesh.h:75
size_t getEnd() const
Get end vertex index.
Definition gsHalfEdgeMesh.h:97
bool isTwin(const Halfedge &halfedge) const
Tells if halfedge is twin.
Definition gsHalfEdgeMesh.h:126
T getLength() const
Get length of halfedge.
Definition gsHalfEdgeMesh.h:103
size_t getOrigin() const
Get origin vertex index.
Definition gsHalfEdgeMesh.h:91
gsHalfEdgeMesh is a gsMesh implementation that handles Halfedges
Definition gsHalfEdgeMesh.h:47
size_t getInternVertexIndex(const typename gsMesh< T >::gsVertexHandle &vertex) const
Get intern index of the vertex stored in disordered vertex vector The index i of the intern vector of...
size_t findVertex(const typename gsMesh< T >::gsVertexHandle &vertex) const
Finds the vertex that has the same coordinates (up to a tolerance) as vertex.
Definition gsHalfEdgeMesh.h:707
std::vector< Halfedge > m_halfedges
vector of halfedges
Definition gsHalfEdgeMesh.h:779
Boundary m_boundary
boundary of the mesh
Definition gsHalfEdgeMesh.h:780
gsHalfEdgeMesh(size_t nv=0)
Default constructor.
Definition gsHalfEdgeMesh.h:544
const gsMesh< T >::gsVertexHandle & getVertexUnsorted(const size_t globIndex) const
Returns the handle to the vertex with index globIndex.
Definition gsHalfEdgeMesh.h:716
std::vector< index_t > m_sorting
vector that stores the internVertexIndices s. t. m_sorting[vertexIndex-1] = internVertexIndex
Definition gsHalfEdgeMesh.h:784
size_t m_n
number of inner vertices in the mesh
Definition gsHalfEdgeMesh.h:781
std::vector< index_t > m_inverseSorting
vector of indices s. t. m_inverseSorting[internVertexIndex] = vertexIndex
Definition gsHalfEdgeMesh.h:783
std::list< size_t > getBoundaryVertexIndices() const
Returns the vertex indices of the boundary.
Definition gsHalfEdgeMesh.h:701
Class Representing a triangle mesh with 3D vertices.
Definition gsMesh.h:32
gsVertex class that represents a 3D vertex for a gsMesh.
Definition gsVertex.h:27
T x() const
Definition gsVertex.h:120
T z() const
Definition gsVertex.h:124
T y() const
Definition gsVertex.h:122
#define short_t
Definition gsConfig.h:35
#define gsWarn
Definition gsDebug.h:50
Provides declaration of the Mesh class.
The G+Smo namespace, containing all definitions for the library.