33 #ifndef __H__LIB_GRID__FACE_UTIL__
34 #define __H__LIB_GRID__FACE_UTIL__
79 Grid::AttachmentAccessor<Vertex, APosition>& aaPos);
99 Grid::AttachmentAccessor<Vertex, APosition>& aaPos);
149 template <
class TFace>
156 template <
class TFace>
164 template <
class TAAPosVRT>
171 template <
class TIterator,
class TAAPosVRT>
173 number FaceArea(TIterator facesBegin, TIterator facesEnd, TAAPosVRT& aaPos);
181 template <
class TIterator,
class TAAPosVRT>
183 Face*
FindSmallestFace(TIterator facesBegin, TIterator facesEnd, TAAPosVRT& aaPos);
196 number FaceQuality(FaceVertices* f, Grid::VertexAttachmentAccessor<APosition> aaPos);
205 template <
class TIterator>
208 Grid::VertexAttachmentAccessor<APosition>& aaPos);
234 Grid::VertexAttachmentAccessor<APosition>* paaPos = NULL);
250 Grid::VertexAttachmentAccessor<APosition>* paaPos = NULL);
254 Grid::VertexAttachmentAccessor<APosition>* paaPos = NULL);
263 void GetNeighbours(std::vector<Face*>& vFacesOut, Grid& grid, Face* f,
264 int side,
bool clearContainer =
true);
282 template<
class TVertexPositionAttachmentAccessor>
284 typename TVertexPositionAttachmentAccessor::ValueType
285 CalculateCenter(
const FaceVertices* f, TVertexPositionAttachmentAccessor& aaPosVRT);
294 template<
class TAAPosVRT,
class TAAWeightVRT>
296 typename TAAPosVRT::ValueType
297 CalculateCenter(
const FaceVertices* f, TAAPosVRT& aaPos, TAAWeightVRT& aaWeight);
305 template <
class vector_t,
class TAAPos>
307 ContainsPoint(
const FaceVertices* f,
const vector_t& p, TAAPos aaPos);
312 template <
class TTriangleIterator,
class TAAPosVRT>
315 TTriangleIterator trisBegin, TTriangleIterator trisEnd,
316 TAAPosVRT& aaPos,
bool compareNormals =
false);
325 template <
class TAAPosVRT>
332 template <
class TAAPosVRT>
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
static number FaceArea(TDomain &dom, ISubsetHandler &sh, int si, size_t lvl)
Definition: domain_bridge.cpp:262
bool LiesOnBoundary(Grid &grid, Edge *e)
returns true, if the edge lies on a 2d or 3d boundary
Definition: edge_util.cpp:169
int CalculateNormal(vector3 &vNormOut, Grid &grid, Edge *e, Grid::AttachmentAccessor< Vertex, APosition > &aaPos, Grid::AttachmentAccessor< Face, ANormal > *paaNormFACE)
Calculates the normal of the given edge.
Definition: edge_util.cpp:314
int CalculateNormalNoNormalize(vector3 &vNormOut, Grid &grid, Edge *e, Grid::VertexAttachmentAccessor< APosition > &aaPos, Grid::FaceAttachmentAccessor< ANormal > *paaNormFACE)
Calculates the normal of the given edge.
Definition: edge_util.cpp:358
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 bool IsDegenerated(Face *f, TAAPosVRT &aaPos, number threshold=SMALL)
returns true if the given face is degenerated.
Definition: face_util_impl.hpp:218
UG_API bool IsBoundaryFace3D(Grid &grid, TFace *f)
A wrapper for IsVolumeBoundaryFace.
Definition: face_util.h:151
void CalculateFaceNormals(Grid &grid, const FaceIterator &facesBegin, const FaceIterator &facesEnd, AVector3 &aPos, AVector3 &aNorm)
calculates the normal of each face. Presumes that all faces are flat.
Definition: face_util.cpp:128
int NumAssociatedVolumes(Grid &grid, Face *f)
returns the number of associated volumes of the specified face
Definition: face_util.cpp:147
number FaceQuality(FaceVertices *f, Grid::VertexAttachmentAccessor< APosition > aaPos)
a simple measure for the quality of a face
Definition: face_util.cpp:203
void GetNeighbours(std::vector< Face * > &vFacesOut, Grid &grid, Face *f, int side, bool clearContainer)
collects neighbours of the given side of a face.
Definition: face_util.cpp:363
UG_API number AreaFaceQuality(TIterator facesBegin, TIterator facesEnd, Grid::VertexAttachmentAccessor< APosition > &aaPos)
returns a value between 0 (bad) and 1 (good) that describes the quality of the area.
Definition: face_util_impl.hpp:43
UG_API int PointFaceTest(vector3 &v, Face *f, TAAPosVRT &aaPos)
Definition: face_util_impl.hpp:201
UG_API bool ProjectPointToSurface(vector3 &vOut, const vector3 &v, const vector3 &n, TTriangleIterator trisBegin, TTriangleIterator trisEnd, TAAPosVRT &aaPos, bool compareNormals=false)
Definition: face_util_impl.hpp:153
void Triangulate(Grid &grid, Quadrilateral *q, Grid::VertexAttachmentAccessor< APosition > *paaPos)
removes the quadrilateral and replaces it by two triangles.
Definition: face_util.cpp:273
int GetFaceIndex(Volume *vol, Face *f)
returns the index at which face f is found in the given object
Definition: face_util.cpp:46
UG_API Face * FindSmallestFace(TIterator facesBegin, TIterator facesEnd, TAAPosVRT &aaPos)
Returns the face with the smallest area.
Definition: face_util_impl.hpp:260
void InsertCenterVertex(Grid &g, Face *f, Vertex *vrt, bool eraseOldFace)
Refines the face by connecting its sides with the new center.
Definition: face_util.cpp:394
number TriangleQuality(vector3 &v1, vector3 &v2, vector3 &v3)
a simple measure for the quality of a triangle
Definition: face_util.cpp:242
bool IsVolumeBoundaryFace(Grid &grid, Face *f)
returns true if the given face is a boundary face.
Definition: face_util.cpp:177
#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
geometry_traits< Quadrilateral >::iterator QuadrilateralIterator
Definition: grid_objects_2d.h:366
ElementStorage< Face >::SectionContainer::iterator FaceIterator
Definition: grid_base_object_traits.h:79
const number SMALL
Definition: math_constants.h:41
Attachment< vector3 > AVector3
Definition: common_attachments.h:62