ug4
vertex util

contains methods to manipulate vertices More...

Functions

template<class TVrtIter , class TAPosition >
UG_API TAPosition::ValueType ug::CalculateBarycenter (TVrtIter vrtsBegin, TVrtIter vrtsEnd, Grid::VertexAttachmentAccessor< TAPosition > &aaPos)
 calculates the barycenter of a set of vertices More...
 
template<class TAAPosVRT >
UG_API void ug::CalculateBoundaryVertexNormal2D (typename TAAPosVRT::ValueType &nOut, Grid &grid, Vertex *vrt, TAAPosVRT &aaPos)
 calculates the normal of a boundary vertex using associated faces More...
 
template<class TAAPosVRT >
UG_API void ug::CalculateBoundaryVertexNormal3D (vector3 &nOut, Grid &grid, Vertex *vrt, TAAPosVRT &aaPos)
 calculates the normal of a boundary vertex using associated volumes More...
 
template<class TVrtIter , class TAPosition >
UG_API void ug::CalculateBoundingBox (typename TAPosition::ValueType &vMinOut, typename TAPosition::ValueType &vMaxOut, TVrtIter vrtsBegin, TVrtIter vrtsEnd, Grid::AttachmentAccessor< Vertex, TAPosition > &aaPos)
 calculates the BoundingBox More...
 
template<class TVrtIter , class TAPosition >
UG_API TAPosition::ValueType ug::CalculateCenter (TVrtIter vrtsBegin, TVrtIter vrtsEnd, Grid::AttachmentAccessor< Vertex, TAPosition > &aaPos)
 calculates the center of a set of vertices. More...
 
template<class TAAPosVRT >
UG_API void ug::CalculateVertexNormal (vector3 &nOut, Grid &grid, Vertex *vrt, TAAPosVRT &aaPos)
 calculates the normal of a vertex using associated faces More...
 
bool ug::CollectSurfaceNeighborsSorted (std::vector< Vertex * > &vNeighborsOut, Grid &grid, Vertex *v)
 Collects neighbor-vertices in either clockwise or counter clockwise order. More...
 
template<class TVrtContainer1 , class TVrtContainer2 >
UG_API bool ug::CompareVertexContainer (const TVrtContainer1 &con1, const TVrtContainer2 &con2)
 compares vertices in a container More...
 
template<class vector_t , class TAAPos >
UG_API bool ug::ContainsPoint (const Vertex *v, const vector_t &p, TAAPos aaPos)
 Returns true if the given point lies on the given vertex. More...
 
Vertexug::FindVertexByCoordiante (vector3 &coord, VertexIterator iterBegin, VertexIterator iterEnd, Grid::VertexAttachmentAccessor< APosition > &aaPos)
 returns the vertex that is the closest to the given coordinate More...
 
template<size_t dim>
int ug::FindVertexByCoordinate (const MathVector< dim > &coord, size_t ncoords, const MathVector< dim > vCoords[])
 returns (non-unique?) index of closest vertex More...
 
Edgeug::GetConnectedEdge (Grid &g, Vertex *vrt, Face *tri)
 returns the edge in the triangle tri, which does not contain vrt. More...
 
Vertexug::GetConnectedVertex (Edge *e, Vertex *v)
 returns the vertex that is connected to v via e. More...
 
Vertexug::GetConnectedVertex (EdgeVertices *e, Face *f)
 returns the index of the first vertex that is contained in f and is not contained in e. More...
 
int ug::GetConnectedVertexIndex (Face *f, const EdgeDescriptor &ed)
 returns the index of the first vertex that is contained in the specified face and is not contained in the given edge. More...
 
int ug::GetConnectedVertexIndex (Face *f, const EdgeVertices *e)
 
Vertexug::GetSharedVertex (IVertexGroup *vrts0, IVertexGroup *vrts1)
 returns the first vertex of vrts0 that is also contained in vrts1 (or NULL if no such vertex exists) More...
 
size_t ug::GetSharedVertices (std::vector< Vertex * > &vrtsOut, IVertexGroup *vrts0, IVertexGroup *vrts1)
 fills a vector with the vertices that are both contained in vrts0 and vrts1. More...
 
Vertexug::GetVertex (Vertex *v, size_t i)
 returns the i'th vertex of a vertex More...
 
int ug::GetVertexIndex (EdgeVertices *e, Vertex *v)
 returns the index at which vertex v is found in the given edge More...
 
int ug::GetVertexIndex (FaceVertices *f, Vertex *v)
 returns the index at which vertex v is found in the given face More...
 
int ug::GetVertexIndex (VolumeVertices *vol, Vertex *v)
 returns the index at which vertex v is found in the given volume More...
 
bool ug::IsBoundaryVertex1D (Grid &grid, Vertex *v, Grid::edge_traits::callback cbConsiderEdge=ConsiderAll())
 returns whether a vertex lies on the boundary of a polygonal chain. More...
 
bool ug::IsBoundaryVertex2D (Grid &grid, Vertex *v)
 returns whether a vertex lies on the boundary of a 2D grid. More...
 
bool ug::IsBoundaryVertex3D (Grid &grid, Vertex *v)
 returns true if a vertex lies on the boundary of a 3D grid. More...
 
bool ug::IsRegularSurfaceVertex (Grid &grid, Vertex *v)
 returns true if the vertex lies inside a regular surface More...
 
bool ug::LiesOnBoundary (Grid &grid, Vertex *v)
 returns true, if the vertex lies on a 1d, 2d or 3d boundary More...
 
void ug::MarkFixedCreaseVertices (Grid &grid, SubsetHandler &sh, int creaseSI, int fixedSI)
 
template<class TVrtIterator >
UG_API Vertexug::MergeMultipleVertices (Grid &grid, TVrtIterator vrtsBegin, TVrtIterator vrtsEnd)
 Merges all vertices between the given iterators into a single vertex. More...
 
void ug::MergeVertices (Grid &grid, Vertex *v1, Vertex *v2)
 merges two vertices and restructures the adjacent elements. More...
 
template<class TIterator , class TAAPos >
void ug::MoveVertices (TIterator vrtsBegin, TIterator vrtsEnd, TAAPos aaPos, const typename TAAPos::ValueType &offset)
 moves vertices by the specified offset More...
 
int ug::NumAssociatedEdges (Grid &grid, Vertex *v)
 returns the number of associated edges of the given vertex More...
 
int ug::NumAssociatedFaces (Grid &grid, Vertex *v)
 returns the number of associated faces of the given vertex More...
 
size_t ug::NumSharedVertices (IVertexGroup *vrts0, IVertexGroup *vrts1)
 Returns the number of shared vertices between vrts0 and vrts1. More...
 
template<class TAAPos >
UG_API void ug::TransformVertex (Vertex *vrt, matrix33 &m, TAAPos &aaPos)
 transforms a vertex by a given matrix More...
 
template<class TIterator , class TAAPos >
UG_API void ug::TransformVertices (TIterator vrtsBegin, TIterator vrtsEnd, matrix33 &m, TAAPos &aaPos)
 transforms all given vertices by a given matrix More...
 
template<class TAAPos >
UG_API number ug::VertexDistance (Vertex *v0, Vertex *v1, TAAPos &aaPos)
 Returns the distance between two vertices. More...
 
template<class TAAPos >
UG_API number ug::VertexDistanceSq (Vertex *v0, Vertex *v1, TAAPos &aaPos)
 Returns the squared distance between two vertices. More...
 
bool ug::CalculateVertexNormals (Grid &grid, APosition &aPos, ANormal &aNorm)
 calculates the normals of all vertices in grid and stores them in aNorm. More...
 
bool ug::CalculateVertexNormals (Grid &grid, Grid::AttachmentAccessor< Vertex, APosition > &aaPos, Grid::AttachmentAccessor< Vertex, ANormal > &aaNorm)
 calculates the normals of all vertices in grid and stores them in aNorm. More...
 
template<int dim, class TVrtIterator >
UG_API void ug::RemoveDoubles (Grid &grid, const TVrtIterator &iterBegin, const TVrtIterator &iterEnd, Attachment< MathVector< dim > > &aPos, number threshold)
 merges all vertices that are closer to each other than the specified threshold. More...
 
template<int dim, class TVrtIterator , class TAAPos >
UG_API void ug::RemoveDoubles (Grid &grid, const TVrtIterator &iterBegin, const TVrtIterator &iterEnd, TAAPos aaPos, number threshold)
 merges all vertices that are closer to each other than the specified threshold. More...
 
template<class TVertexPositionAttachmentAccessor >
UG_API TVertexPositionAttachmentAccessor::ValueType ug::CalculateCenter (const Vertex *v, TVertexPositionAttachmentAccessor &aaPosVRT)
 returns the position of the vertex. More...
 
template<class TAAPosVRT , class TAAWeightVRT >
UG_API TAAPosVRT::ValueType ug::CalculateCenter (const Vertex *v, TAAPosVRT &aaPos, TAAWeightVRT &aaWeight)
 returns the position of the vertex. More...
 

Detailed Description

contains methods to manipulate vertices

Function Documentation

◆ CalculateBarycenter()

template<class TVrtIter , class TAPosition >
UG_API TAPosition::ValueType ug::CalculateBarycenter ( TVrtIter  vrtsBegin,
TVrtIter  vrtsEnd,
Grid::VertexAttachmentAccessor< TAPosition > &  aaPos 
)

calculates the barycenter of a set of vertices

References ug::VecAdd(), ug::VecScale(), and ug::VecSet().

◆ CalculateBoundaryVertexNormal2D()

template<class TAAPosVRT >
UG_API void ug::CalculateBoundaryVertexNormal2D ( typename TAAPosVRT::ValueType &  nOut,
Grid grid,
Vertex vrt,
TAAPosVRT &  aaPos 
)

calculates the normal of a boundary vertex using associated faces

TAAPosVRT has to be an attachment accessor for the vector2 or vector3 type that works on the vertices in grid.

Note that this method makes only sense if called for a boundary vertex, which is connected to some volume elements.

The returned normal is normalized and will point outwards of the area defined by the associated volumes.

Note that this method assumes, that all faces do lie in the x-y-plane.

References ug::CollectAssociated(), ug::Face::edge_desc(), ug::EdgeContains(), ug::Grid::get_edge(), ug::IsBoundaryEdge2D(), ug::Face::num_sides(), ug::VecNormalize(), ug::VecSet(), and ug::EdgeVertices::vertex().

Referenced by ug::ExpandFractures2d().

◆ CalculateBoundaryVertexNormal3D()

template<class TAAPosVRT >
UG_API void ug::CalculateBoundaryVertexNormal3D ( vector3 nOut,
Grid grid,
Vertex vrt,
TAAPosVRT &  aaPos 
)

calculates the normal of a boundary vertex using associated volumes

TAAPosVRT has to be an attachment accessor for the vector3 type that works on the vertices in grid.

Note that this method makes only sense if called for a boundary vertex, which is connected to some volume elements.

The returned normal is normalized and will point outwards of the area defined by the associated volumes.

References ug::CalculateNormal(), ug::CollectAssociated(), ug::Volume::face_desc(), ug::FaceContains(), ug::Grid::get_face(), ug::IsBoundaryFace3D(), ug::Volume::num_sides(), ug::VecAdd(), ug::VecNormalize(), and ug::VecSet().

Referenced by ug::ExpandFractures3d().

◆ CalculateBoundingBox()

template<class TVrtIter , class TAPosition >
UG_API void ug::CalculateBoundingBox ( typename TAPosition::ValueType &  vMinOut,
typename TAPosition::ValueType &  vMaxOut,
TVrtIter  vrtsBegin,
TVrtIter  vrtsEnd,
Grid::AttachmentAccessor< Vertex, TAPosition > &  aaPos 
)

calculates the BoundingBox

References dim.

◆ CalculateCenter() [1/3]

template<class TAAPosVRT , class TAAWeightVRT >
UG_API TAAPosVRT::ValueType ug::CalculateCenter ( const Vertex v,
TAAPosVRT &  aaPos,
TAAWeightVRT &  aaWeight 
)

returns the position of the vertex.

Main purpose is to allow the use of vertices in template-methods that call CalculateCenter

◆ CalculateCenter() [2/3]

template<class TVertexPositionAttachmentAccessor >
UG_API TVertexPositionAttachmentAccessor::ValueType ug::CalculateCenter ( const Vertex v,
TVertexPositionAttachmentAccessor &  aaPosVRT 
)
inline

returns the position of the vertex.

Main purpose is to allow the use of vertices in template-methods that call CalculateCenter

◆ CalculateCenter() [3/3]

template<class TVrtIter , class TAPosition >
UG_API TAPosition::ValueType ug::CalculateCenter ( TVrtIter  vrtsBegin,
TVrtIter  vrtsEnd,
Grid::AttachmentAccessor< Vertex, TAPosition > &  aaPos 
)

calculates the center of a set of vertices.

The difference to CalculateBarycenter is that this method returns the center of the bounding box which contains the given set of vertices.

References ug::CalculateBoundingBox(), and ug::VecScaleAdd().

◆ CalculateVertexNormal()

template<class TAAPosVRT >
UG_API void ug::CalculateVertexNormal ( vector3 nOut,
Grid grid,
Vertex vrt,
TAAPosVRT &  aaPos 
)

calculates the normal of a vertex using associated faces

TAAPosVRT has to be an attachment accessor for the vector3 type that works on the vertices in grid.

References ug::Grid::associated_faces_begin(), ug::Grid::associated_faces_end(), ug::CalculateNormal(), ug::VecAdd(), and ug::VecNormalize().

Referenced by ug::SlopeSmooth(), ug::SnapMarkerPointToGridVertex(), ug::Triangulate(), ug::TrySplit(), and ug::WeightedNormalSmooth().

◆ CalculateVertexNormals() [1/2]

UG_API bool ug::CalculateVertexNormals ( Grid grid,
APosition aPos,
ANormal aNorm 
)

calculates the normals of all vertices in grid and stores them in aNorm.

aPos has to be attached to grid. If some attachments were not attached correctly, the method returns false.

References ug::Grid::attach_to(), and ug::Grid::has_attachment().

◆ CalculateVertexNormals() [2/2]

UG_API bool ug::CalculateVertexNormals ( Grid grid,
Grid::AttachmentAccessor< Vertex, APosition > &  aaPos,
Grid::AttachmentAccessor< Vertex, ANormal > &  aaNorm 
)

calculates the normals of all vertices in grid and stores them in aNorm.

aPos has to be attached to grid. If some attachments were not attached correctly, the method returns false.

References ug::Grid::begin(), ug::CalculateNormal(), ug::Grid::end(), ug::FaceVertices::num_vertices(), ug::VecAdd(), ug::VecNormalize(), and ug::FaceVertices::vertex().

Referenced by ug::AdjustEdgeLength().

◆ CollectSurfaceNeighborsSorted()

UG_API bool ug::CollectSurfaceNeighborsSorted ( std::vector< Vertex * > &  vNeighborsOut,
Grid grid,
Vertex v 
)

◆ CompareVertexContainer()

template<class TVrtContainer1 , class TVrtContainer2 >
UG_API bool ug::CompareVertexContainer ( const TVrtContainer1 &  con1,
const TVrtContainer2 &  con2 
)

compares vertices in a container

If you want to compare Edge, Face, Volume, EdgeDescriptor, FaceDescriptor or VolumeDescriptor with other Edge, ... then please use CompareVertices instead.

TVrtContainer has to feature the following methods (or compatible ones): int size(): has to return the numbe of vertices in the container. Vertex* operator[](int index): has to return the i-th vertex.

Good types would be: EdgeVertices, FaceVertices, VolumeVertices, Edge, Face, Volume, ..., std::vector<Vertex*>, ...

returns true if con1 and con2 contain the same vertices.

◆ ContainsPoint()

template<class vector_t , class TAAPos >
UG_API bool ug::ContainsPoint ( const Vertex v,
const vector_t &  p,
TAAPos  aaPos 
)

Returns true if the given point lies on the given vertex.

The method simply checks, whether coordinates are identical. This method is of no particular use, except for completeness regarding the use of ConatinsPoint in template-programming.

References p.

◆ FindVertexByCoordiante()

Vertex* ug::FindVertexByCoordiante ( vector3 coord,
VertexIterator  iterBegin,
VertexIterator  iterEnd,
Grid::VertexAttachmentAccessor< APosition > &  aaPos 
)

returns the vertex that is the closest to the given coordinate

returns NULL if no vertex was found (if iterBegin == iterEnd).

References ug::VecDistanceSq().

◆ FindVertexByCoordinate()

template<size_t dim>
int ug::FindVertexByCoordinate ( const MathVector< dim > &  coord,
size_t  ncoords,
const MathVector< dim vCoords[] 
)

returns (non-unique?) index of closest vertex

returns -1 iff ncoords == 0

References ug::VecDistance(), and ug::VecDistanceSq().

◆ GetConnectedEdge()

UG_API Edge * ug::GetConnectedEdge ( Grid g,
Vertex vrt,
Face tri 
)

returns the edge in the triangle tri, which does not contain vrt.

Make sure that tri is a triangle!

References ug::Face::edge_desc(), ug::EdgeContains(), ug::Grid::get_edge(), and ug::Face::num_edges().

Referenced by ug::SlopeSmooth(), ug::TryCollapse(), and ug::WeightedFaceSmooth().

◆ GetConnectedVertex() [1/2]

◆ GetConnectedVertex() [2/2]

UG_API Vertex * ug::GetConnectedVertex ( EdgeVertices e,
Face f 
)

returns the index of the first vertex that is contained in f and is not contained in e.

References ug::FaceVertices::num_vertices(), ug::EdgeVertices::vertex(), and ug::FaceVertices::vertex().

Referenced by ug::CollectSurfaceNeighborsSorted().

◆ GetConnectedVertexIndex() [1/2]

UG_API int ug::GetConnectedVertexIndex ( Face f,
const EdgeDescriptor ed 
)

returns the index of the first vertex that is contained in the specified face and is not contained in the given edge.

References ug::GetConnectedVertexIndex().

Referenced by ug::ReplaceByQuadrilaterals_EdgeBased().

◆ GetConnectedVertexIndex() [2/2]

UG_API int ug::GetConnectedVertexIndex ( Face f,
const EdgeVertices e 
)

◆ GetSharedVertex()

UG_API Vertex * ug::GetSharedVertex ( IVertexGroup vrts0,
IVertexGroup vrts1 
)

returns the first vertex of vrts0 that is also contained in vrts1 (or NULL if no such vertex exists)

References ug::IVertexGroup::size(), and ug::IVertexGroup::vertices().

Referenced by ug::CollapseEdge().

◆ GetSharedVertices()

size_t ug::GetSharedVertices ( std::vector< Vertex * > &  vrtsOut,
IVertexGroup vrts0,
IVertexGroup vrts1 
)

fills a vector with the vertices that are both contained in vrts0 and vrts1.

Returns
The number of shared vertices

References ug::IVertexGroup::size(), and ug::IVertexGroup::vertices().

◆ GetVertex()

◆ GetVertexIndex() [1/3]

◆ GetVertexIndex() [2/3]

UG_API int ug::GetVertexIndex ( FaceVertices f,
Vertex v 
)

returns the index at which vertex v is found in the given face

returns -1 if the vertex was not found.

References ug::FaceVertices::num_vertices(), and ug::FaceVertices::vertex().

◆ GetVertexIndex() [3/3]

UG_API int ug::GetVertexIndex ( VolumeVertices vol,
Vertex v 
)

returns the index at which vertex v is found in the given volume

returns -1 if the vertex was not found.

References ug::VolumeVertices::num_vertices(), and ug::VolumeVertices::vertex().

Referenced by ug::CollectSurfaceNeighborsSorted().

◆ IsBoundaryVertex1D()

UG_API bool ug::IsBoundaryVertex1D ( Grid grid,
Vertex v,
Grid::edge_traits::callback  cbConsiderEdge = ConsiderAll() 
)

returns whether a vertex lies on the boundary of a polygonal chain.

The polygonal chain may be part of a bigger grid containing faces and volume elements. To distinguish which edges should be part of the polygonal chain, you may specify a callback to identify them.

References ug::Grid::associated_edges_begin(), ug::Grid::associated_edges_end(), ug::Grid::enable_options(), LOG, ug::Grid::option_is_enabled(), and ug::VRTOPT_STORE_ASSOCIATED_EDGES.

Referenced by ug::GetFirstSectionOfPolyChain(), and ug::LiesOnBoundary().

◆ IsBoundaryVertex2D()

UG_API bool ug::IsBoundaryVertex2D ( Grid grid,
Vertex v 
)

returns whether a vertex lies on the boundary of a 2D grid.

A vertex is regarded as a 2d boundary vertex if it lies on a 2d boundary edge. if EDGEOPT_STORE_ASSOCIATED_FACES and VRTOPT_STORE_ASSOCIATED_EDGES are enabled, the algorithm will be faster.

References ug::Grid::associated_edges_begin(), ug::Grid::associated_edges_end(), ug::Grid::enable_options(), ug::FACEOPT_AUTOGENERATE_EDGES, ug::IsBoundaryEdge2D(), LOG, ug::Grid::option_is_enabled(), and ug::VRTOPT_STORE_ASSOCIATED_EDGES.

Referenced by ug::ExpandFractures2d(), ug::ExportGridToUG_2D(), ug::LiesOnBoundary(), ug::ProjectToLimitPLoop(), and ug::ProjectToLimitSubdivBoundary().

◆ IsBoundaryVertex3D()

UG_API bool ug::IsBoundaryVertex3D ( Grid grid,
Vertex v 
)

returns true if a vertex lies on the boundary of a 3D grid.

A vertex is regarded as a 3d boundary vertex if it lies on a 3d boundary face. if FACEOPT_STORE_ASSOCIATED_VOLUMES and VRTOPT_STORE_ASSOCIATED_FACES are enabled, the algorithm will be faster.

References ug::Grid::associated_faces_begin(), ug::Grid::associated_faces_end(), ug::Grid::enable_options(), ug::IsVolumeBoundaryFace(), LOG, ug::Grid::option_is_enabled(), ug::VOLOPT_AUTOGENERATE_FACES, and ug::VRTOPT_STORE_ASSOCIATED_FACES.

Referenced by ug::DistributeExpansionMarks3D(), ug::ExpandFractures3d(), and ug::LiesOnBoundary().

◆ IsRegularSurfaceVertex()

UG_API bool ug::IsRegularSurfaceVertex ( Grid grid,
Vertex v 
)

returns true if the vertex lies inside a regular surface

This algorithm indirectly uses Grid::mark.

The vertex is regarded as a regular surface vertex, if all associated edges are connected to exactly 2 faces.

References ug::Grid::associated_edges_begin(), ug::Grid::associated_edges_end(), and ug::NumAssociatedFaces().

◆ LiesOnBoundary()

UG_API bool ug::LiesOnBoundary ( Grid grid,
Vertex v 
)

returns true, if the vertex lies on a 1d, 2d or 3d boundary

References ug::IsBoundaryVertex1D(), ug::IsBoundaryVertex2D(), ug::IsBoundaryVertex3D(), and ug::Grid::num().

◆ MarkFixedCreaseVertices()

◆ MergeMultipleVertices()

template<class TVrtIterator >
UG_API Vertex* ug::MergeMultipleVertices ( Grid grid,
TVrtIterator  vrtsBegin,
TVrtIterator  vrtsEnd 
)

Merges all vertices between the given iterators into a single vertex.

Note that connected elements may be removed or replaced during this process. The method returns the remaining vertex in the given list (*vrtsBegin).

References ug::MergeVertices().

◆ MergeVertices()

UG_API void ug::MergeVertices ( Grid grid,
Vertex v1,
Vertex v2 
)

◆ MoveVertices()

template<class TIterator , class TAAPos >
void ug::MoveVertices ( TIterator  vrtsBegin,
TIterator  vrtsEnd,
TAAPos  aaPos,
const typename TAAPos::ValueType &  offset 
)
inline

moves vertices by the specified offset

◆ NumAssociatedEdges()

UG_API int ug::NumAssociatedEdges ( Grid grid,
Vertex v 
)

returns the number of associated edges of the given vertex

References ug::Grid::associated_elements(), and ug::PointerConstArray< TPtr >::size().

Referenced by ug::PerformTetrahedralization().

◆ NumAssociatedFaces()

UG_API int ug::NumAssociatedFaces ( Grid grid,
Vertex v 
)

returns the number of associated faces of the given vertex

References ug::Grid::associated_elements(), and ug::PointerConstArray< TPtr >::size().

Referenced by ug::IsRegularSurfaceVertex().

◆ NumSharedVertices()

size_t ug::NumSharedVertices ( IVertexGroup vrts0,
IVertexGroup vrts1 
)

Returns the number of shared vertices between vrts0 and vrts1.

References ug::IVertexGroup::size(), and ug::IVertexGroup::vertices().

◆ RemoveDoubles() [1/2]

template<int dim, class TVrtIterator >
UG_API void ug::RemoveDoubles ( Grid grid,
const TVrtIterator &  iterBegin,
const TVrtIterator &  iterEnd,
Attachment< MathVector< dim > > &  aPos,
number  threshold 
)

merges all vertices that are closer to each other than the specified threshold.

The current implementation sadly enforces some restrictions to the container from which iterBegin and iterEnd stem. Only Grid, MultiGrid, Selector, MGSelector, SubsetHandler, MGSubsetHandler and similar containers are allowed. This is due to an implementation detail in the algorithm that should be removed in future revisins.

Todo:
remove container restrictions as described above.

References ug::Grid::has_vertex_attachment().

◆ RemoveDoubles() [2/2]

template<int dim, class TVrtIterator , class TAAPos >
UG_API void ug::RemoveDoubles ( Grid grid,
const TVrtIterator &  iterBegin,
const TVrtIterator &  iterEnd,
TAAPos  aaPos,
number  threshold 
)

merges all vertices that are closer to each other than the specified threshold.

The current implementation sadly enforces some restrictions to the container from which iterBegin and iterEnd stem. Only Grid, MultiGrid, Selector, MGSelector, SubsetHandler, MGSubsetHandler and similar containers are allowed. This is due to an implementation detail in the algorithm that should be removed in future revisins.

Todo:
remove container restrictions as described above.

References ug::Grid::attach_to_vertices(), ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::create_from_grid(), ug::Grid::detach_from_vertices(), ug::KDTreeStatic< TPositionAttachment, numDimensions, TVector >::get_neighbourhood(), ug::KDSD_LARGEST, ug::MergeVertices(), ug::Grid::num_vertices(), and ug::VecDistanceSq().

◆ TransformVertex()

template<class TAAPos >
UG_API void ug::TransformVertex ( Vertex vrt,
matrix33 m,
TAAPos &  aaPos 
)
inline

transforms a vertex by a given matrix

References ug::MatVecMult().

Referenced by ug::TransformVertices().

◆ TransformVertices()

template<class TIterator , class TAAPos >
UG_API void ug::TransformVertices ( TIterator  vrtsBegin,
TIterator  vrtsEnd,
matrix33 m,
TAAPos &  aaPos 
)
inline

transforms all given vertices by a given matrix

References ug::TransformVertex().

◆ VertexDistance()

template<class TAAPos >
UG_API number ug::VertexDistance ( Vertex v0,
Vertex v1,
TAAPos &  aaPos 
)

Returns the distance between two vertices.

References ug::VecDistance().

Referenced by ug::is_anisotropic().

◆ VertexDistanceSq()

template<class TAAPos >
UG_API number ug::VertexDistanceSq ( Vertex v0,
Vertex v1,
TAAPos &  aaPos 
)

Returns the squared distance between two vertices.

References ug::VecDistanceSq().

Referenced by ug::MinimizeEdgeLength_SwapsOnly().