00001 00008 #ifndef CLEANER_H 00009 #define CLEANER_H 00010 00011 #include <sys/time.h> 00012 00013 #include "globals.h" 00014 #include "cell.h" 00015 00016 00017 class BezierMesh; 00018 class BoundaryMesh; 00019 00020 00028 class Cleaner { 00029 private: 00030 BezierMesh *bezier_mesh; 00031 BoundaryMesh *bdry_mesh; 00032 00033 /* Controls smoothing sensitivity. Decrease for more smoothing (0=smooth every edge) */ 00034 double jacobian_bound; 00035 00036 /* Corsening grading function decrease twords 0 for better grading */ 00037 double lipschitz_const; 00038 00039 /* Nearest Neighbor constant decrease twords 0.5 for more agressive corsening*/ 00040 double nearest_neighbor_const; 00041 00042 /* Douglas-Puecker epsilon for spline simplification */ 00043 double dp_epsilon; 00044 00045 /* Coarsen keeper point radius fraction */ 00046 double keep_radius_frac; 00047 00048 /* Size constant */ 00049 double size_const; 00050 00051 void read_cfg_file(char *filename); 00052 00053 unsigned num_flips; /*Number of edge flips to maintain delaunay */ 00054 unsigned num_smoothed; /*Number of edges smoothed */ 00055 unsigned num_refines_size; /*Number of triangles refined due to size */ 00056 unsigned num_refines_angle; /*Number of triangles refined due to small angles */ 00057 unsigned num_coarsens; /*Number of vertexs coarsened */ 00058 unsigned num_refines_boundaries; /*Number of refines to protect boundaries */ 00059 timeval start_time; /*Start time of clean */ 00060 char *config_filename; 00061 00062 public: 00063 /* Constructor */ 00064 /* size_const is sizing function for refining and coarsening 00065 * cfg_file is name of confiuration file 00066 */ 00067 Cleaner(BezierMesh *_bezier_mesh, BoundaryMesh *_bdry_mesh, char *cfg_file); 00068 Cleaner(BezierMesh *_bezier_mesh, BoundaryMesh *_bdry_mesh, 00069 double _jacobian_bound, double _lipschitz_const, 00070 double _nn_const, double _dp_epsilon, 00071 double _kr_frac, double _size_const); 00072 00073 /* Destructor */ 00074 ~Cleaner() {} 00075 00076 /* main cleaning function */ 00077 void clean(); 00078 00079 void print_summary(); 00080 }; 00081 00082 #endif /* CLEANER_H */