cgma
GeometryHealerTool.hpp
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // Filename      : GeometryHealerTool.hpp
00003 //
00004 // Purpose       : Define the healer interface for all solid modeling engines.
00005 //
00006 // Special Notes : This is a singleton pattern class for the healer functions.
00007 //
00008 // Creator       : Tyronne Lim (CAT)
00009 //
00010 // Creation Date : 7/21/03
00011 //
00012 // Owner         : 
00013 //-----------------------------------------------------------------------------
00014 
00015 #ifndef _GEOMETRYHEALERTOOL_HPP
00016 #define _GEOMETRYHEALERTOOL_HPP
00017 
00018 // *** BEGIN INCLUDES *** //
00019 
00020 #include "CubitDefines.h"
00021 #include "DLIList.hpp"
00022 #include "CGMGeomConfigure.h"
00023 
00024 // *** END INCLUDES *** //
00025 
00026 // *** BEGIN FORWARD DECLARATIONS *** //
00027 
00028 class GeometryHealerEngine;
00029 
00030 class TopologyBridge;
00031 class TopologyEntity;
00032 
00033 class RefEntity;
00034 class RefFace;
00035 class RefEdge;
00036 
00037 class Body;
00038 // *** END FORWARD DECLARATIONS *** //
00039 
00041 class CUBIT_GEOM_EXPORT GeometryHealerTool
00042 {
00043    public:
00044 
00045       // singleton pattern class instance interface
00046       static GeometryHealerTool* instance( GeometryHealerEngine* GHEPtr = NULL );
00047 
00048       static void delete_instance() 
00049       {
00050         if (instance_)
00051         {
00052           delete instance_;
00053           instance_ = NULL;
00054         }
00055       };
00056 
00057       // destructor
00058       ~GeometryHealerTool();
00059 
00060       // *** BEGIN ENGINE OPERATIONS *** //
00061 
00062       // set the default healer engine
00063 //      void set_default_engine( GeometryHealerEngine *ghe_ptr );
00064 
00066       void add_ghe( GeometryHealerEngine *ghe_ptr );
00067 
00068       // remove a healer engine from the list
00069 //      CubitStatus remove_ghe( GeometryHealerEngine *ghe_ptr );
00070 
00071       // get the list of healer engines
00072 //      void get_ghe_list( DLIList<GeometryHealerEngine*> &ghe_list );
00073 
00074    private:
00075       // returns the healer engine of an entity
00076       GeometryHealerEngine* get_engine( TopologyBridge *tb_ptr ) const;
00077       GeometryHealerEngine* get_engine( TopologyEntity *te_ptr ) const;
00078 
00079       // determines if entities belong to the same engine
00080       CubitBoolean same_healer_engine( DLIList<RefEntity*> &ref_entity_list,
00081                                              CubitBoolean check_children ) const;
00082       CubitBoolean same_healer_engine( DLIList<TopologyEntity*> &topo_list ) const;
00083 
00084       // *** END ENGINE OPERATIONS *** //
00085 
00086       // *** BEGIN HEALER FUNCTIONS *** //
00087    public:
00091       CubitStatus auto_heal_bodies( DLIList<Body*> &body_list, 
00092                                     DLIList<Body*> &new_body_list,
00093                                     DLIList<TopologyEntity*> &bad_geometry,
00094                                     CubitBoolean rebuild = CUBIT_FALSE, 
00095                                     CubitBoolean keep_old = CUBIT_FALSE,
00096                                     CubitBoolean make_tolerant = CUBIT_FALSE,
00097                                     FILE* logfile_ptr = NULL );
00098 
00102       CubitStatus heal_bodies( DLIList<Body*> &body_list, 
00103                                DLIList<Body*> &new_body_list,
00104                                DLIList<TopologyEntity*> &bad_geometry,
00105                                CubitBoolean rebuild = CUBIT_FALSE,
00106                                CubitBoolean keep_old = CUBIT_FALSE,
00107                                CubitBoolean make_tolerant = CUBIT_FALSE,
00108                                FILE* logfile_ptr = NULL );
00109 
00114       CubitStatus analyze_badgeom( DLIList<Body*> &body_list, 
00115                                    DLIList<TopologyEntity*> &bad_geometry,
00116                                    FILE* logfile = NULL );
00117 
00121       CubitStatus get_badgeom( DLIList<Body*> &body_list, 
00122                                DLIList<TopologyEntity*> &bad_geometry );
00123 
00126       CubitStatus get_tcurves( DLIList<Body*> &body_list,
00127                                DLIList<RefEdge*> &t_curves );
00128 
00177       CubitStatus heal_incremental( DLIList<Body*> &body_list, 
00178                                     DLIList<Body*> &new_bodies,
00179                                     DLIList<TopologyEntity*> &bad_geometry,
00180                                     double simplify_tol = CUBIT_DBL_MAX,
00181                                     double stitch_min_tol = CUBIT_DBL_MAX,
00182                                     double stitch_max_tol = CUBIT_DBL_MAX,
00183                                     double geombuild_tol = CUBIT_DBL_MAX,
00184                                     double analytic_tol = CUBIT_DBL_MAX,
00185                                     double isospline_tol = CUBIT_DBL_MAX,
00186                                     double reblend_classify_tol = CUBIT_DBL_MAX,
00187                                     double reblend_tol = CUBIT_DBL_MAX,
00188                                     CubitBoolean keep_old = CUBIT_FALSE,
00189                                     CubitBoolean make_tolerant = CUBIT_FALSE,
00190                                     FILE* logfile_ptr = NULL);
00191 
00193       void list_incremental();
00194 
00196       void list_tolerances( DLIList<Body*> &body_list );
00197       
00199 
00200 
00201 
00202 
00203 
00204 
00205       double get_default_simplify_tol();
00206       void set_default_simplify_tol( double tol );
00207       double get_default_stitch_min_tol();
00208       void set_default_stitch_min_tol( double tol );
00209       double get_default_stitch_max_tol();
00210       void set_default_stitch_max_tol( double tol );
00211       double get_default_geombuild_tol();
00212       void set_default_geombuild_tol( double tol );
00213       double get_default_analytic_tol();
00214       void set_default_analytic_tol( double tol );
00215       double get_default_isospline_tol();
00216       void set_default_isospline_tol( double tol );
00217       double get_default_reblend_classify_tol();
00218       void set_default_reblend_classify_tol( double tol );
00219       double get_default_reblend_tol();
00220       void set_default_reblend_tol( double tol );
00221       void reset_default_tolerances();
00222       void list_default_tolerances();
00224 
00227       void clean_attributes( DLIList<Body*>& body_list );
00228 
00230 
00231 
00232       CubitBoolean get_cleanatt_flg();
00233       void set_cleanatt_flg( CubitBoolean flg );
00235 
00237 
00238       int get_show_method(); // 0-none, 1-highlight, 2-draw
00239       void set_show_method( int method );
00241 
00243 
00244       CubitBoolean get_show_summary_flg();
00245       void set_show_summary_flg( CubitBoolean flg );
00247 
00249 
00250       CubitBoolean get_show_details_flg();
00251       void set_show_details_flg( CubitBoolean flg );
00253 
00255 
00256       CubitBoolean get_show_on_heal_flg();
00257       void set_show_on_heal_flg( CubitBoolean flg );
00259 
00261 
00262       CubitBoolean get_check_vol_on_heal_flg();
00263       void set_check_vol_on_heal_flg( CubitBoolean flg );
00264       double get_vol_on_heal_limit();
00265       void set_vol_on_heal_limit( double limit );
00267 
00269 
00270       CubitBoolean get_check_surf_on_heal_flg();
00271       void set_check_surf_on_heal_flg( CubitBoolean flg );
00272       double get_surf_on_heal_limit();
00273       void set_surf_on_heal_limit( double limit );
00275       
00277 
00278       CubitBoolean get_check_curve_on_heal_flg();
00279       void set_check_curve_on_heal_flg( CubitBoolean flg );
00280       double get_curve_on_heal_limit();
00281       void set_curve_on_heal_limit( double limit );
00283       
00285 
00286       CubitBoolean get_show_bad_vertices_flg();
00287       void set_show_bad_vertices_flg( CubitBoolean flg );
00288       CubitBoolean get_show_bad_curves_flg();
00289       void set_show_bad_curves_flg( CubitBoolean flg );
00290       CubitBoolean get_show_bad_coedges_flg();
00291       void set_show_bad_coedges_flg( CubitBoolean flg );
00292       CubitBoolean get_show_bad_loops_flg();
00293       void set_show_bad_loops_flg( CubitBoolean flg );
00294       CubitBoolean get_show_bad_surfaces_flg();
00295       void set_show_bad_surfaces_flg( CubitBoolean flg );
00296       CubitBoolean get_show_bad_shells_flg();
00297       void set_show_bad_shells_flg( CubitBoolean flg );
00298       CubitBoolean get_show_bad_volumes_flg();
00299       void set_show_bad_volumes_flg( CubitBoolean flg );
00300       CubitBoolean get_show_bad_bodies_flg();
00301       void set_show_bad_bodies_flg( CubitBoolean flg );
00303 
00305       void list_onshow_flgs();
00306       
00308       // Functions for controlling incremental healing
00309       CubitBoolean get_inc_preprocess_flg();
00310       void set_inc_preprocess_flg( CubitBoolean flg );
00311       CubitBoolean get_inc_simplify_flg();
00312       void set_inc_simplify_flg( CubitBoolean flg );
00313       CubitBoolean get_inc_stitch_flg();
00314       void set_inc_stitch_flg( CubitBoolean flg );
00315       CubitBoolean get_inc_geombuild_flg();
00316       void set_inc_geombuild_flg( CubitBoolean flg );
00317       CubitBoolean get_inc_analytic_flg();
00318       void set_inc_analytic_flg( CubitBoolean flg );
00319       CubitBoolean get_inc_isospline_flg();
00320       void set_inc_isospline_flg( CubitBoolean flg );
00321       CubitBoolean get_inc_reblend_flg();
00322       void set_inc_reblend_flg( CubitBoolean flg );
00323       CubitBoolean get_inc_sharpedge_flg();
00324       void set_inc_sharpedge_flg( CubitBoolean flg );
00325       CubitBoolean get_inc_genericspline_flg();
00326       void set_inc_genericspline_flg( CubitBoolean flg );
00327       CubitBoolean get_inc_wrapup_flg();
00328       void set_inc_wrapup_flg( CubitBoolean flg );
00329       CubitBoolean get_inc_postprocess_flg();
00330       void set_inc_postprocess_flg( CubitBoolean flg );
00332 
00334 
00335       CubitStatus force_simplify_to_plane( DLIList<RefFace*> &ref_face_list, DLIList<Body*>& new_body_list, 
00336                                            CubitBoolean keep = CUBIT_FALSE );
00337       CubitStatus force_simplify_to_cylinder( DLIList<RefFace*> &ref_face_list, DLIList<Body*>& new_body_list, 
00338                                               CubitBoolean keep = CUBIT_FALSE );
00339       CubitStatus force_simplify_to_cone( DLIList<RefFace*> &ref_face_list, DLIList<Body*>& new_body_list, 
00340                                           CubitBoolean keep = CUBIT_FALSE );
00341       CubitStatus force_simplify_to_sphere( DLIList<RefFace*> &ref_face_list, DLIList<Body*>& new_body_list, 
00342                                             CubitBoolean keep = CUBIT_FALSE );
00343       CubitStatus force_simplify_to_torus( DLIList<RefFace*> &ref_face_list, DLIList<Body*>& new_body_list, 
00344                                            CubitBoolean keep = CUBIT_FALSE );
00346 
00347       // *** END HEALER FUNCTIONS *** //
00348 
00349    protected:
00350 
00351       // constructor
00352       GeometryHealerTool( GeometryHealerEngine *GHEPtr );
00353 
00354    private:
00355 
00356       // singleton pattern class instance interface
00357       static GeometryHealerTool* instance_;
00358 
00359       // list of healer engines
00360       DLIList<GeometryHealerEngine*> gheList;
00361 };
00362 
00363 #endif
00364 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines