vtf-logo

FaceRemoval.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__geom_mesh_simplicial__FaceRemoval_h__)
00009 #define __geom_mesh_simplicial__FaceRemoval_h__
00010 
00011 #if defined(DEBUG_geom) && !defined(DEBUG_FaceRemoval)
00012 #define DEBUG_FaceRemoval
00013 #endif
00014 
00015 #include "../simplex/SimplexModCondNum.h"
00016 
00017 #include "../../../ads/array/Array.h"
00018 
00019 #include <cassert>
00020 
00021 BEGIN_NAMESPACE_GEOM
00022 
00023 
00025 template<class _QualityMetric = SimplexModCondNum<3>,
00026          class _Point = ads::FixedArray<3>,
00027          typename _Number = typename _Point::value_type>
00028 class FaceRemoval {
00029 
00030 public:
00031 
00032   //
00033   // Public types.
00034   //
00035 
00037   typedef _QualityMetric QualityMetric;
00039   typedef _Point Point;
00041   typedef _Number Number;
00042 
00043 private:
00044       
00045   //
00046   // Private types.
00047   //
00048 
00049   typedef typename QualityMetric::Simplex Simplex;
00050 
00051   //
00052   // Data
00053   //
00054 
00055   // The source and target of the edge.
00056   Point _source, _target;
00057   // The three vertices in the face shared by the two initial tetrahedra.
00058   ads::FixedArray<3,Point> _face;
00059   // The quality function.
00060   mutable QualityMetric _qualityFunction;
00061   
00062   //
00063   // Not implemented.
00064   //
00065 
00066   // Copy constructor not implemented.
00067   FaceRemoval(const FaceRemoval&);
00068 
00069   // Assignment operator.
00070   FaceRemoval& 
00071   operator=(const FaceRemoval&);
00072 
00073 public:
00074 
00075   //--------------------------------------------------------------------------
00078 
00080   FaceRemoval() :
00081     _source(),
00082     _target(),
00083     _face(),
00084     _qualityFunction()
00085   {}
00086 
00088   ~FaceRemoval()
00089   {}
00090 
00092   //--------------------------------------------------------------------------
00095 
00097   void
00098   setSource(const Point& src) {
00099     _source = src;
00100   }
00101 
00103   void
00104   setTarget(const Point& tgt) {
00105     _target = tgt;
00106   }
00107 
00109 
00112   void
00113   setFace(const Point& a, const Point& b, const Point& c) {
00114     _face[0] = a;
00115     _face[1] = b;
00116     _face[2] = c;
00117   }
00118 
00120   //--------------------------------------------------------------------------
00123 
00125   bool
00126   flip23() {
00127     return computeQuality3() > computeQuality2();
00128   }
00129 
00131 
00132   //
00133   // Private member functions.
00134   //
00135   // CONTINUE: Should these be private?
00136   
00137   // Return the worse quality of the 2 tetrahedra: 
00138   // _face[0], _face[1], _face[2], _target
00139   // and
00140   // _source, _face[0], _face[1], _face[2]
00142   Number
00143   computeQuality2() const;
00144 
00145   // Return the worst quality of the 3 tetrahedra: 
00146   // _source, _target, _face[0], _face[1]
00147   // _source, _target, _face[1], _face[2]
00148   // _source, _target, _face[2], _face[0]
00150   Number
00151   computeQuality3() const;
00152 };
00153 
00154 
00155 END_NAMESPACE_GEOM
00156 
00157 
00158 #define __geom_mesh_simplicial_FaceRemoval_ipp__
00159 #include "FaceRemoval.ipp"
00160 #undef __geom_mesh_simplicial_FaceRemoval_ipp__
00161 
00162 #endif

Generated on Fri Aug 24 12:55:53 2007 for Computational Geometry Package by  doxygen 1.4.7