00001
00002
00008 #if !defined(__geom_mesh_simplicial_flip_h__)
00009 #define __geom_mesh_simplicial_flip_h__
00010
00011 #include "SimpMeshRed.h"
00012 #include "geometry.h"
00013
00014 #include "../simplex/SimplexModCondNum.h"
00015 #include "../simplex/SimplexModMeanRatio.h"
00016
00017 BEGIN_NAMESPACE_GEOM
00018
00020
00027 template<class DistortionFunction,
00028 int N, typename T,
00029 template<class> class Node,
00030 template<class> class Cell,
00031 template<class,class> class Cont>
00032 int
00033 flip(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh);
00034
00035
00037
00046 template<class DistortionFunction,
00047 int N, typename T,
00048 template<class> class Node,
00049 template<class> class Cell,
00050 template<class,class> class Cont>
00051 int
00052 flip(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh, T maxAngle);
00053
00054
00056
00063 template<int N, typename T,
00064 template<class> class Node,
00065 template<class> class Cell,
00066 template<class,class> class Cont>
00067 inline
00068 int
00069 flipUsingModifiedMeanRatio(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh) {
00070 return flip<SimplexModMeanRatio<2,T> >(mesh);
00071 }
00072
00073
00075
00082 template<int N, typename T,
00083 template<class> class Node,
00084 template<class> class Cell,
00085 template<class,class> class Cont>
00086 inline
00087 int
00088 flipUsingModifiedMeanRatio(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh,
00089 const T maxAngle) {
00090 return flip<SimplexModMeanRatio<2,T> >(mesh, maxAngle);
00091 }
00092
00093
00095
00102 template<int N, typename T,
00103 template<class> class Node,
00104 template<class> class Cell,
00105 template<class,class> class Cont>
00106 inline
00107 int
00108 flipUsingModifiedConditionNumber(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh) {
00109 return flip<SimplexModCondNum<2,T> >(mesh);
00110 }
00111
00112
00114
00121 template<int N, typename T,
00122 template<class> class Node,
00123 template<class> class Cell,
00124 template<class,class> class Cont>
00125 inline
00126 int
00127 flipUsingModifiedConditionNumber(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh,
00128 const T maxAngle) {
00129 return flip<SimplexModCondNum<2,T> >(mesh, maxAngle);
00130 }
00131
00132
00134
00141 template<int N, typename T,
00142 template<class> class Node,
00143 template<class> class Cell,
00144 template<class,class> class Cont,
00145 class DistortionFunction>
00146 bool
00147 flip(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh,
00148 const typename SimpMeshRed<N,2,T,Node,Cell,Cont>::Face& face,
00149 DistortionFunction& distortionFunction);
00150
00151
00153
00160 template<int N, typename T,
00161 template<class> class Node,
00162 template<class> class Cell,
00163 template<class,class> class Cont,
00164 class DistortionFunction>
00165 bool
00166 flip(SimpMeshRed<N,2,T,Node,Cell,Cont>* mesh,
00167 const typename SimpMeshRed<N,2,T,Node,Cell,Cont>::Face& face,
00168 DistortionFunction& distortionFunction, T minCosine);
00169
00170
00172
00175 template<int N, typename T,
00176 template<class> class Node,
00177 template<class> class Cell,
00178 template<class,class> class Cont,
00179 class DistortionFunction>
00180 bool
00181 shouldFlip(const SimpMeshRed<N,2,T,Node,Cell,Cont>& mesh,
00182 const typename SimpMeshRed<N,2,T,Node,Cell,Cont>::Face& face,
00183 DistortionFunction& distortionFunction);
00184
00185
00187
00190 template<int N, typename T,
00191 template<class> class Node,
00192 template<class> class Cell,
00193 template<class,class> class Cont,
00194 class DistortionFunction >
00195 bool
00196 shouldFlip(const SimpMeshRed<N,2,T,Node,Cell,Cont>& mesh,
00197 const typename SimpMeshRed<N,2,T,Node,Cell,Cont>::Face& face,
00198 DistortionFunction& distortionFunction, T minCosine);
00199
00200
00202
00208 template<typename SMR>
00209 void
00210 flip(typename SMR::CellIterator cell, int faceIndex);
00211
00212
00214
00219 template<typename SMR>
00220 inline
00221 void
00222 flip(const typename SMR::Face& face) {
00223 flip<SMR>(face.first, face.second);
00224 }
00225
00226
00227 END_NAMESPACE_GEOM
00228
00229 #define __geom_mesh_simplicial_flip_ipp__
00230 #include "flip.ipp"
00231 #undef __geom_mesh_simplicial_flip_ipp__
00232
00233 #endif