33 #ifndef __H__UG_mark_util_impl
34 #define __H__UG_mark_util_impl
39 template <
class TEdgeIterator>
41 TEdgeIterator edgesBegin, TEdgeIterator edgesEnd,
42 int subsetIndex,
number angle,
60 number minDot = cos(angle * 3.14159265 / 180.f);
63 for(TEdgeIterator iter = edgesBegin; iter != edgesEnd; ++iter)
74 if(
VecDot(n[0], n[1]) < minDot)
83 template <
class TVertexIterator,
class TAPosition>
85 TVertexIterator vrtsBegin, TVertexIterator vrtsEnd,
87 int subsetIndex,
number angle,
90 typedef typename TAPosition::ValueType vector_t;
103 for(TVertexIterator iter = vrtsBegin; iter != vrtsEnd; ++iter){
106 int numPathEdges = 0;
108 for(
size_t i = 0; i < edges.
size(); ++i){
112 pathEdge[numPathEdges] = e;
117 if(numPathEdges == 2){
118 for(
size_t i = 0; i < 2; ++i){
125 if(
VecDot(dir[0], dir[1]) < dotThreshold)
128 else if(numPathEdges > 0){
A generic specialization of IAttachment.
Definition: attachment_pipe.h:263
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
bool has_vertex_attachment(IAttachment &attachment)
Definition: grid.h:798
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
Definition: subset_handler_interface.h:223
void assign_subset(TIterator iterBegin, TIterator iterEnd, int subsetIndex)
Definition: subset_handler_interface_impl.hpp:170
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
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
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 GetAssociatedFaces(Face **facesOut, Grid &grid, Edge *e, int maxNumFaces)
writes associated faces of e to facesOut.
Definition: edge_util.cpp:186
Vertex * GetConnectedVertex(Edge *e, Vertex *v)
returns the vertex that is connected to v via e.
Definition: vertex_util.cpp:78
double number
Definition: types.h:124
TNumber deg_to_rad(TNumber deg)
Definition: math_util_impl.hpp:49
void VecNormalize(vector_t &vOut, const vector_t &v)
scales a vector_t to unit length
Definition: math_vector_functions_common_impl.hpp:501
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
UG_API void MarkCorners(Grid &grid, ISubsetHandler &sh, TVertexIterator vrtsBegin, TVertexIterator vrtsEnd, Grid::edge_traits::callback cbPathEdge, int subsetIndex, number angle, TAPosition &aPos)
Definition: mark_util_impl.h:84
UG_API void MarkCreaseEdges(Grid &grid, ISubsetHandler &sh, TEdgeIterator edgesBegin, TEdgeIterator edgesEnd, int subsetIndex, number angle, APosition &aPos=aPosition, ANormal *paFaceNormal=NULL)
Definition: mark_util_impl.h:40
boost::function< bool(base_object *)> callback
callback type for the elements base type.
Definition: grid.h:150