33 #ifndef __H__LIB_GRID__MISC_UTIL__
34 #define __H__LIB_GRID__MISC_UTIL__
53 template <
class TElem>
62 template<
class TAAPosVRT>
65 typename TAAPosVRT::ValueType
74 template<
class TAAPosVRT,
class TAAWeightVRT>
77 typename TAAPosVRT::ValueType
79 TAAWeightVRT& aaWeight);
87 template <
class TIterator,
class TAAPosVRT>
89 typename TAAPosVRT::ValueType
104 template<
class TElem,
class TVertexPositionAttachmentAccessor>
107 typename geometry_traits<TElem>::iterator iterBegin,
108 typename geometry_traits<TElem>::iterator iterEnd,
109 TVertexPositionAttachmentAccessor& aaPosVRT);
118 template<
class vector_t,
class TIterator,
class TAAPos>
121 TIterator begin, TIterator end,
132 template <
class TElemPtr1,
class TElemPtr2>
145 template <
class TElem>
147 void EraseElements(Grid& grid,
typename geometry_traits<TElem>::iterator iterBegin,
148 typename geometry_traits<TElem>::iterator iterEnd);
153 template <
class TElem,
class TAAPos>
159 template <
class TAAPos>
165 template <
class TElem,
class TAAPos>
172 template <
class TAAPos,
class TIterator>
174 TIterator iterBegin, TIterator iterEnd);
178 template <
class TAAPos,
class TIterator>
180 TIterator iterBegin, TIterator iterEnd);
184 template <
class TElem1,
class TElem2,
class TAAPos>
185 typename TAAPos::ValueType
186 GetDirection (TElem1* e1, TElem2* e2,
const TAAPos& aaPos);
192 template <
class TElem1,
class TElem2,
class TAAPos>
196 const typename TAAPos::ValueType& dir,
number ElementDiameter(const TElem &elem, TDomain &domain)
returns the maximal distance between to element vertices
number ElementDiameterSq(const TElem &elem, TDomain &domain)
returns the maximal squared distance between to element vertices
number MinElementDiameter(TDomain &domain, int level)
returns the minimal diameter of all elements between iterBegin and iterEnd.
Definition: domain_util.cpp:113
number MaxElementDiameter(TDomain &domain, int level)
returns the maximal diameter of all elements between iterBegin and iterEnd.
Definition: domain_util.cpp:104
UG_API void EraseElements(Grid &grid, typename geometry_traits< TElem >::iterator iterBegin, typename geometry_traits< TElem >::iterator iterEnd)
erases all elements between iterBegin and iterEnd.
Definition: misc_util_impl.hpp:222
void EraseConnectingElements(Grid &grid, Vertex *v1, Vertex *v2)
erases all elements that connect v1 and v2
Definition: misc_util.cpp:42
UG_API TElem * FindClosestByCoordinate(const typename TVertexPositionAttachmentAccessor::ValueType &coord, typename geometry_traits< TElem >::iterator iterBegin, typename geometry_traits< TElem >::iterator iterEnd, TVertexPositionAttachmentAccessor &aaPosVRT)
returns the element of the given type, whose center is closest to coord.
Definition: misc_util_impl.hpp:136
TAAPos::ValueType GetDirection(TElem1 *e1, TElem2 *e2, const TAAPos &aaPos)
Returns the direction from the center of e1 to the center of e2.
Definition: misc_util_impl.hpp:326
UG_API TAAPosVRT::ValueType CalculateGridObjectCenter(const GridObject *o, TAAPosVRT &aaPosVRT)
calculates the center for arbitrary geometric object
Definition: misc_util_impl.hpp:81
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 TElem::side * GetSharedSide(Grid &grid, TElem *e1, TElem *e2)
returns the shared side between the two elements or NULL if no such side exists.
Definition: misc_util_impl.hpp:52
bool CheckDirection(TElem1 *e1, TElem2 *e2, const TAAPos &aaPos, const typename TAAPos::ValueType &dir, number minAngle, number maxAngle)
Checks whether the center of e2 can be reached from the center of e1 in the given direction.
Definition: misc_util_impl.hpp:338
#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
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