33 #ifndef __H__LIB_GRID__VERTEX_UTIL__
34 #define __H__LIB_GRID__VERTEX_UTIL__
112 std::vector<Vertex*>& vrtsOut,
114 IVertexGroup* vrts1);
142 Grid& grid, Vertex* v);
146 template <
class TAAPos>
152 template <
class TAAPos>
165 Grid::VertexAttachmentAccessor<APosition>& aaPos);
169 template <
size_t dim>
170 int FindVertexByCoordinate(
const MathVector<dim>& coord,
size_t ncoords,
const MathVector<dim> vCoords[]);
178 template <
class TAAPosVRT>
197 template <
class TAAPosVRT>
200 Grid& grid, Vertex* vrt,
215 template <
class TAAPosVRT>
233 Grid::AttachmentAccessor<Vertex, APosition>& aaPos,
234 Grid::AttachmentAccessor<Vertex, ANormal>& aaNorm);
242 template <
class TVrtIter,
class TAPosition>
246 typename TAPosition::ValueType& vMaxOut,
247 TVrtIter vrtsBegin, TVrtIter vrtsEnd,
248 Grid::AttachmentAccessor<Vertex, TAPosition>& aaPos);
256 template <
class TVrtIter,
class TAPosition>
258 typename TAPosition::ValueType
260 Grid::AttachmentAccessor<Vertex, TAPosition>& aaPos);
265 template <
class TVrtIter,
class TAPosition>
267 typename TAPosition::ValueType
269 Grid::VertexAttachmentAccessor<TAPosition>& aaPos);
286 template <
class TVrtIterator>
289 TVrtIterator vrtsEnd);
302 template <
int dim,
class TVrtIterator>
304 void RemoveDoubles(Grid& grid,
const TVrtIterator& iterBegin,
305 const TVrtIterator& iterEnd, Attachment<MathVector<dim> >& aPos,
308 template <
int dim,
class TVrtIterator,
class TAAPos>
310 void RemoveDoubles(Grid& grid,
const TVrtIterator& iterBegin,
311 const TVrtIterator& iterEnd,
368 int creaseSI,
int fixedSI);
375 template<
class TVertexPositionAttachmentAccessor>
378 typename TVertexPositionAttachmentAccessor::ValueType
379 CalculateCenter(
const Vertex* v, TVertexPositionAttachmentAccessor& aaPosVRT);
381 template<
class TAAPosVRT,
class TAAWeightVRT>
383 typename TAAPosVRT::ValueType
384 CalculateCenter(
const Vertex* v, TAAPosVRT& aaPos, TAAWeightVRT& aaWeight);
390 template<
class TAAPos>
inline
396 template<
class TIterator,
class TAAPos>
inline
403 template<
class TIterator,
class TAAPos>
inline
404 void MoveVertices(TIterator vrtsBegin, TIterator vrtsEnd, TAAPos aaPos,
405 const typename TAAPos::ValueType& offset);
413 template <
class vector_t,
class TAAPos>
415 ContainsPoint(
const Vertex* v,
const vector_t& p, TAAPos aaPos);
bool LiesOnBoundary(Grid &grid, Edge *e)
returns true, if the edge lies on a 2d or 3d boundary
Definition: edge_util.cpp:169
int NumAssociatedFaces(Grid &grid, Edge *e)
returns the number of associated faces of the given edge
Definition: edge_util.cpp:247
UG_API bool ContainsPoint(const EdgeVertices *e, const vector_t &p, TAAPos aaPos)
Returns true if the given point lies on the given edge.
Definition: edge_util_impl.hpp:513
UG_API size_t NumSharedVertices(Grid &grid, TElemPtr1 elem1, TElemPtr2 elem2)
returns the number of vertices that are shared by two objects
Definition: misc_util_impl.hpp:200
UG_API void TransformVertices(TIterator vrtsBegin, TIterator vrtsEnd, matrix33 &m, TAAPos &aaPos)
transforms all given vertices by a given matrix
Definition: vertex_util_impl.hpp:383
bool IsRegularSurfaceVertex(Grid &grid, Vertex *v)
returns true if the vertex lies inside a regular surface
Definition: vertex_util.cpp:601
Vertex * GetSharedVertex(IVertexGroup *vrts0, IVertexGroup *vrts1)
returns the first vertex of vrts0 that is also contained in vrts1 (or NULL if no such vertex exists)
Definition: vertex_util.cpp:134
UG_API void 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.
Definition: vertex_util_impl.hpp:255
UG_API number VertexDistance(Vertex *v0, Vertex *v1, TAAPos &aaPos)
Returns the distance between two vertices.
Definition: vertex_util_impl.hpp:54
bool IsBoundaryVertex2D(Grid &grid, Vertex *v)
returns whether a vertex lies on the boundary of a 2D grid.
Definition: vertex_util.cpp:531
bool IsBoundaryVertex1D(Grid &grid, Vertex *v, Grid::edge_traits::callback cbConsiderEdge)
returns whether a vertex lies on the boundary of a polygonal chain.
Definition: vertex_util.cpp:504
int NumAssociatedEdges(Grid &grid, Vertex *v)
returns the number of associated edges of the given vertex
Definition: vertex_util.cpp:200
Edge * GetConnectedEdge(Grid &g, Vertex *vrt, Face *tri)
returns the edge in the triangle tri, which does not contain vrt.
Definition: vertex_util.cpp:121
UG_API void CalculateBoundaryVertexNormal3D(vector3 &nOut, Grid &grid, Vertex *vrt, TAAPosVRT &aaPos)
calculates the normal of a boundary vertex using associated volumes
Definition: vertex_util_impl.hpp:120
bool CollectSurfaceNeighborsSorted(std::vector< Vertex * > &vNeighborsOut, Grid &grid, Vertex *v)
Collects neighbor-vertices in either clockwise or counter clockwise order.
Definition: vertex_util.cpp:217
UG_API Vertex * MergeMultipleVertices(Grid &grid, TVrtIterator vrtsBegin, TVrtIterator vrtsEnd)
Merges all vertices between the given iterators into a single vertex.
Definition: vertex_util_impl.hpp:235
void MoveVertices(TIterator vrtsBegin, TIterator vrtsEnd, TAAPos aaPos, const typename TAAPos::ValueType &offset)
moves vertices by the specified offset
Definition: vertex_util_impl.hpp:392
void MergeVertices(Grid &grid, Vertex *v1, Vertex *v2)
merges two vertices and restructures the adjacent elements.
Definition: vertex_util.cpp:395
size_t GetSharedVertices(std::vector< Vertex * > &vrtsOut, IVertexGroup *vrts0, IVertexGroup *vrts1)
fills a vector with the vertices that are both contained in vrts0 and vrts1.
Definition: vertex_util.cpp:154
bool IsBoundaryVertex3D(Grid &grid, Vertex *v)
returns true if a vertex lies on the boundary of a 3D grid.
Definition: vertex_util.cpp:558
UG_API void CalculateVertexNormal(vector3 &nOut, Grid &grid, Vertex *vrt, TAAPosVRT &aaPos)
calculates the normal of a vertex using associated faces
Definition: vertex_util_impl.hpp:61
UG_API void TransformVertex(Vertex *vrt, matrix33 &m, TAAPos &aaPos)
transforms a vertex by a given matrix
Definition: vertex_util_impl.hpp:374
int 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...
Definition: vertex_util.cpp:101
int GetVertexIndex(EdgeVertices *e, Vertex *v)
returns the index at which vertex v is found in the given edge
Definition: vertex_util.cpp:44
UG_API TAPosition::ValueType CalculateBarycenter(TVrtIter vrtsBegin, TVrtIter vrtsEnd, Grid::VertexAttachmentAccessor< TAPosition > &aaPos)
calculates the barycenter of a set of vertices
Definition: vertex_util_impl.hpp:216
UG_API number VertexDistanceSq(Vertex *v0, Vertex *v1, TAAPos &aaPos)
Returns the squared distance between two vertices.
Definition: vertex_util_impl.hpp:47
bool 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.
Definition: vertex_util.cpp:345
int FindVertexByCoordinate(const MathVector< dim > &coord, size_t ncoords, const MathVector< dim > vCoords[])
returns (non-unique?) index of closest vertex
Definition: vertex_util_impl.hpp:413
UG_API void CalculateBoundaryVertexNormal2D(typename TAAPosVRT::ValueType &nOut, Grid &grid, Vertex *vrt, TAAPosVRT &aaPos)
calculates the normal of a boundary vertex using associated faces
Definition: vertex_util_impl.hpp:81
Vertex * GetConnectedVertex(Edge *e, Vertex *v)
returns the vertex that is connected to v via e.
Definition: vertex_util.cpp:78
Vertex * FindVertexByCoordiante(vector3 &coord, VertexIterator iterBegin, VertexIterator iterEnd, Grid::VertexAttachmentAccessor< APosition > &aaPos)
returns the vertex that is the closest to the given coordinate
Definition: vertex_util.cpp:317
void MarkFixedCreaseVertices(Grid &grid, SubsetHandler &sh, int creaseSI, int fixedSI)
Definition: vertex_util.cpp:615
#define UG_API
Definition: ug_config.h:65
double number
Definition: types.h:124
void CalculateCenter(vector_t ¢erOut, const vector_t *pointSet, size_t numPoints)
calculates the center of a point-set
Definition: math_util_impl.hpp:98
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
MathMatrix< 3, 3, number > matrix33
a 3x3 matrix
Definition: ugmath_types.h:81
ElementStorage< Vertex >::SectionContainer::iterator VertexIterator
This Iterator will be used as base-class for iterators of specialized geometric objects.
Definition: grid_base_object_traits.h:73
GridSubsetHandler SubsetHandler
Definition: subset_handler_grid.h:376
AABox< typename TAAPos::ValueType > CalculateBoundingBox(Vertex *e, TAAPos aaPos)
calculates the smallest axis aligned box that contains the given vertex
Definition: bounding_box_util.h:43
APosition3 APosition
Definition: common_attachments.h:76
ANormal3 ANormal
Definition: common_attachments.h:77
boost::function< bool(base_object *)> callback
callback type for the elements base type.
Definition: grid.h:150