33 #ifndef __H__UG_orientation_util_impl
34 #define __H__UG_orientation_util_impl
49 template <
class iter_t>
53 for(iter_t iter = elemsBegin; iter != elemsEnd; ++iter)
60 template <
class TFaceIterator>
62 TFaceIterator facesEnd)
69 for(TFaceIterator iter = facesBegin; iter != facesEnd; ++iter){
83 for(TFaceIterator iter = facesBegin; iter != facesEnd; ++iter){
92 vector<Face*> vNeighbours;
95 stack<Face*> stkFaces;
98 while(facesBegin != facesEnd)
106 stkFaces.push(*facesBegin);
109 while(!stkFaces.empty())
112 Face* f = stkFaces.top();
116 for(
size_t i = 0; i < f->
num_edges(); ++i)
122 for(
size_t j = 0; j < vNeighbours.size(); ++j)
124 Face* fn = vNeighbours[j];
153 template<
class TAAPosVRT>
158 typedef typename TAAPosVRT::ValueType vector_t;
167 for(
size_t i = 0; i < numFaces; ++i){
178 if(
VecDot(dir, normal) < 0)
186 template<
class TVolIterator,
class TAAPosVRT>
193 for(TVolIterator iter = volsBegin; iter != volsEnd; ++iter){
Can be used to store information about an edge and to construct an edge.
Definition: grid_base_objects.h:464
Can be queried for the edges and vertices of a face.
Definition: grid_base_objects.h:684
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
virtual EdgeDescriptor edge_desc(int index) const
returns the i-th edge of the face.
Definition: grid_base_objects.h:537
uint num_edges() const
Definition: grid_base_objects.h:545
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
void end_marking()
ends a marking sequence. Call this method when you're done with marking.
Definition: grid.cpp:1285
void unmark(GridObject *obj)
unmarks the object. Calls are only valid between calls to Grid::begin_marking and Grid::end_marking.
Definition: grid_impl.hpp:808
bool is_marked(GridObject *obj) const
returns true if the object is marked, false if not.
Definition: grid_impl.hpp:843
void mark(GridObject *obj)
marks the object. Calls are only valid between calls to Grid::begin_marking and Grid::end_marking.
Definition: grid_impl.hpp:773
void flip_orientation(Edge *e)
flips the orientation of an edge.
Definition: grid.cpp:535
void begin_marking()
begin marking.
Definition: grid.cpp:1262
void associated_elements(traits< Vertex >::secure_container &elemsOut, TElem *e)
Puts all elements of type TAss which are contained in 'e' or which contain 'e' into elemsOut.
Definition: grid_impl.hpp:466
Container which holds an array of pointers.
Definition: pointer_const_array.h:84
size_t size() const
returns the size of the associated array.
Definition: pointer_const_array_impl.hpp:106
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
virtual FaceDescriptor face_desc(int index) const
Definition: grid_base_objects.h:784
virtual uint num_faces() const
Definition: grid_base_objects.h:786
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 NumAssociatedVolumes(Grid &grid, Face *f)
returns the number of associated volumes of the specified face
Definition: face_util.cpp:147
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
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
void VecSubtract(vector_t &vOut, const vector_t &v1, const vector_t &v2)
subtracts v2 from v1 and stores the result in a vOut
Definition: math_vector_functions_common_impl.hpp:226
vector_t::value_type VecDot(const vector_t &v1, const vector_t &v2)
returns the dot-product of two vector_ts
Definition: math_vector_functions_common_impl.hpp:385
Definition: smart_pointer.h:814
bool CheckOrientation(Volume *vol, TAAPosVRT &aaPosVRT)
returns true if the volume is oriented so that all sides point to this outside.
Definition: orientation_util_impl.hpp:155
int FixOrientation(Grid &grid, TVolIterator volsBegin, TVolIterator volsEnd, TAAPosVRT &aaPosVRT)
Changes orientation of badly oriented volumes.
Definition: orientation_util_impl.hpp:188
bool OrientationMatches(const EdgeVertices &e1, const EdgeVertices &e2)
Definition: orientation.cpp:60
void InvertOrientation(Grid &grid, iter_t elemsBegin, iter_t elemsEnd)
inverts the orientation of all elements between elemsBegin and elemsEnd
Definition: orientation_util_impl.hpp:50
bool EdgeOrientationMatches(EdgeVertices *ev, Face *f)
checks if the edge-orientation of the edge and the face matches.
Definition: orientation_util.cpp:37
void FixFaceOrientation(Grid &grid, TFaceIterator facesBegin, TFaceIterator facesEnd)
creates uniform orientation of neighboured and boundary faces.
Definition: orientation_util_impl.hpp:61