33 #ifndef __H__LIB_GRID__EDGE_UTIL__
34 #define __H__LIB_GRID__EDGE_UTIL__
120 Edge* e,
int maxNumFaces);
141 template <
class face_iter_t>
143 std::vector<Edge*>& edgesOut,
145 face_iter_t facesBegin,
146 face_iter_t facesEnd);
152 template <
class TAAPosVRT>
160 template <
class TAAPosVRT>
185 Grid::AttachmentAccessor<Vertex, APosition>& aaPos,
186 Grid::AttachmentAccessor<Face, ANormal>* paaNormFACE = NULL);
209 Grid::VertexAttachmentAccessor<APosition>& aaPos,
210 Grid::FaceAttachmentAccessor<ANormal>* paaNormFACE = NULL);
247 template<
class TVertex>
248 TVertex*
SplitEdge(Grid& grid, Edge* e,
bool bConservative =
false);
267 template<
class TVertex>
268 TVertex*
SplitEdge(Grid& destGrid, Grid& srcGrid, Edge* e,
269 AVertex* paAssociatedVertices = NULL,
270 bool bConservative =
false);
283 Edge*
SwapEdge(Grid& grid, Edge* e);
302 AVertex* paAssociatedVertices = NULL);
307 template<
class TVertexPositionAttachmentAccessor>
309 typename TVertexPositionAttachmentAccessor::ValueType
310 CalculateCenter(
const Edge* e, TVertexPositionAttachmentAccessor& aaPosVRT);
318 template<
class TAAPosVRT,
class TAAWeightVRT>
320 typename TAAPosVRT::ValueType
321 CalculateCenter(
const EdgeVertices* e, TAAPosVRT& aaPos, TAAWeightVRT& aaWeight);
348 template <
class TEdgeIterator>
351 TEdgeIterator edgesEnd);
375 template <
class TEdgeIterator>
378 TEdgeIterator edgesEnd);
380 template <
class TEdgeIterator>
383 TEdgeIterator edgesEnd,
398 template <
class TEdgeIterator,
class TAAPosVRT>
416 template <
class EdgeIterator,
class TAAPos>
426 template <
class vector_t,
class TAAPos>
428 ContainsPoint(
const EdgeVertices* e,
const vector_t& p, TAAPos aaPos);
437 template <
class TAAPosVRT>
int GetEdgeIndex(Face *f, Edge *e)
returns the index at which edge e is found in the given object
Definition: edge_util.cpp:50
Edge * SwapEdge(Grid &grid, Edge *e)
swaps e and thus reconnects its two adjacent triangles.
Definition: edge_util.cpp:793
TVertex * SplitEdge(Grid &grid, Edge *e, bool bConservative=false)
inserts new triangles and one new vertex by splitting the specified edge.
Definition: edge_util_impl.hpp:89
bool LiesOnBoundary(Grid &grid, Edge *e)
returns true, if the edge lies on a 2d or 3d boundary
Definition: edge_util.cpp:169
bool CollapseEdge(Grid &grid, Edge *e, Vertex *newVrt)
Collapses the specified edge performs local grid restructuring.
Definition: edge_util.cpp:403
void GetInnerEdgesOfFaceSoup(std::vector< Edge * > &edgesOut, Grid &g, face_iter_t facesBegin, face_iter_t facesEnd)
Definition: edge_util_impl.hpp:47
UG_API void MinimizeEdgeLength_SwapsOnly(Grid &grid, EdgeIterator edgesBegin, EdgeIterator edgesEnd, TAAPos &aaPos)
Transforms the given edge-set so that the sum of the length the edges is minimized.
Definition: edge_util_impl.hpp:419
int NumAssociatedFaces(Grid &grid, Edge *e)
returns the number of associated faces of the given edge
Definition: edge_util.cpp:247
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
number CalculateAverageEdgeLength(Grid &grid, TAAPosVRT &aaPos)
Returns the average length of edges in the given grid.
Definition: edge_util_impl.hpp:523
bool CreateEdgeSplitGeometry(Grid &destGrid, Grid &srcGrid, Edge *e, Vertex *newVertex, AVertex *paAssociatedVertices)
given an edge and a vertex (the split-vertex) this method constructs the split-geometry.
Definition: edge_util.cpp:591
UG_API Edge * FindShortestEdge(TEdgeIterator edgesBegin, TEdgeIterator edgesEnd, TAAPosVRT &aaPos)
Returns the shortest edge in a list of edges.
Definition: edge_util_impl.hpp:304
bool IsBoundaryEdge2D(Grid &grid, Edge *e)
returns whether an edge lies on the boundary of a 2D grid.
Definition: edge_util.cpp:112
int GetAssociatedFaces(Face **facesOut, Grid &grid, Edge *e, int maxNumFaces)
writes associated faces of e to facesOut.
Definition: edge_util.cpp:186
UG_API void AdjustEdgeOrientationToFaceOrientation(Grid &grid, TEdgeIterator edgesBegin, TEdgeIterator edgesEnd)
Orientates boundary edges in the given edge set to the orientation of associated faces.
Definition: edge_util_impl.hpp:256
bool CutEdgesWithPlane(Selector &sel, const vector3 &p, const vector3 &n, APosition &aPos)
refines all edges in sel which cut the given plane.
Definition: edge_util.cpp:868
UG_API number EdgeLengthSq(const EdgeVertices *e, TAAPosVRT &aaPos)
Calculates the squared length of the given edge.
Definition: edge_util_impl.hpp:73
bool EdgeCollapseIsValid(Grid &grid, Edge *e)
Checks if an edge-collapse would invalidate the current topology.
Definition: edge_util.cpp:527
UG_API void FixEdgeOrientation(Grid &grid, TEdgeIterator edgesBegin, TEdgeIterator edgesEnd)
creates uniform orientation of neighboured edges.
Definition: edge_util_impl.hpp:199
bool IsBoundaryEdge(Grid &grid, Edge *e, Grid::face_traits::callback funcIsSurfFace)
returns true if the edge is connected to exactly one surface face.
Definition: edge_util.cpp:78
Edge * GetConnectingEdge(Grid &grid, Face *f1, Face *f2)
Definition: edge_util.cpp:298
bool IsBoundaryEdge3D(Grid &grid, Edge *e)
returns whether an edge lies on the boundary of a 3D grid.
Definition: edge_util.cpp:139
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 number EdgeLength(const EdgeVertices *e, TAAPosVRT &aaPos)
Calculates the length of the given edge.
Definition: edge_util_impl.hpp:80
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
#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
ElementStorage< Edge >::SectionContainer::iterator EdgeIterator
Definition: grid_base_object_traits.h:76
Attachment< Vertex * > AVertex
Definition: common_attachments.h:64
APosition3 APosition
Definition: common_attachments.h:76
APosition aPosition("position", true)
The standard 3d position type.
Definition: common_attachments.h:84
boost::function< bool(base_object *)> callback
callback type for the elements base type.
Definition: grid.h:150