cgma
|
00001 //----------------------------------------------------------------------------- 00002 // Filename : GeometryHealerEngine.hpp 00003 // 00004 // Purpose : Define the healer interface for all solid modeling engines. 00005 // 00006 // Special Notes : This is an abstract base 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 _GEOMETRYHEALERENGINE_HPP 00016 #define _GEOMETRYHEALERENGINE_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 Body; 00029 00030 class RefEntity; 00031 class RefFace; 00032 class RefEdge; 00033 00034 class TopologyBridge; 00035 class TopologyEntity; 00036 00037 // *** END FORWARD DECLARATIONS *** // 00038 00039 class CUBIT_GEOM_EXPORT GeometryHealerEngine 00040 { 00041 public: 00042 00043 // virtual destructor 00044 virtual ~GeometryHealerEngine() {} 00045 00046 // returns CUBIT_TRUE if the entity belongs to this healer engine 00047 virtual CubitBoolean is_healer_engine( const TopologyBridge* ) = 0; 00048 virtual CubitBoolean is_healer_engine( const TopologyEntity* ) = 0; 00049 00050 virtual CubitStatus auto_heal_bodies( DLIList<Body*> &body_list, DLIList<Body*> &new_body_list, 00051 DLIList<TopologyEntity*> &bad_geometry, 00052 CubitBoolean rebuild = CUBIT_FALSE, 00053 CubitBoolean keep_old = CUBIT_FALSE, 00054 CubitBoolean make_tolerant = CUBIT_FALSE, 00055 FILE* logfile_ptr = NULL ) = 0; 00056 // Uses the autohealer to heal the given body list. The rebuild option 00057 // can be used for more rigorous healing, where each surface is pulled off, 00058 // healed, and then stitched back into a body. 00059 00060 virtual CubitStatus heal_bodies( DLIList<Body*> &body_list, DLIList<Body*> &new_body_list, 00061 DLIList<TopologyEntity*> &bad_geometry, 00062 CubitBoolean rebuild = CUBIT_FALSE, 00063 CubitBoolean keep_old = CUBIT_FALSE, 00064 CubitBoolean make_tolerant = CUBIT_FALSE, 00065 FILE* logfile_ptr = NULL ) = 0; 00066 // Heals the input bodies, using either autoheal or incremental, 00067 // depending on the switches that are setup. Writes to the logfile 00068 // if it's been opened. 00069 00070 virtual CubitStatus analyze_badgeom( DLIList<Body*> &body_list, 00071 DLIList<TopologyEntity*> &bad_geometry, 00072 FILE* logfile = NULL ) = 0; 00073 // Uses the healing husk to find bad geometry and give feedback to 00074 // the user. A lot more could be done here - this is just a quick 00075 // overview for the user (the user will have no idea why the identified 00076 // geometry is bad). A logfile can give a little more information. 00077 00078 virtual CubitStatus get_badgeom( DLIList<Body*> &body_list, 00079 DLIList<TopologyEntity*> &bad_geometry ) = 0; 00080 // Shows the bad geometry. The geometry must have been analyzed first. 00081 // If body_list is empty, shows only for those bodies that have been 00082 // analyzed. 00083 00084 virtual CubitStatus get_tcurves( DLIList<Body*> &body_list, 00085 DLIList<RefEdge*> &t_curves ) = 0; 00086 // Gets tolerant curves. If the body list is empty, all tolerant 00087 // curves are retrieved. 00088 00089 virtual CubitStatus heal_incremental( DLIList<Body*> &body_list, 00090 DLIList<Body*> &new_bodies, 00091 DLIList<TopologyEntity*> &bad_geometry, 00092 double simplify_tol = CUBIT_DBL_MAX, 00093 double stitch_min_tol = CUBIT_DBL_MAX, 00094 double stitch_max_tol = CUBIT_DBL_MAX, 00095 double geombuild_tol = CUBIT_DBL_MAX, 00096 double analytic_tol = CUBIT_DBL_MAX, 00097 double isospline_tol = CUBIT_DBL_MAX, 00098 double reblend_classify_tol = CUBIT_DBL_MAX, 00099 double reblend_tol = CUBIT_DBL_MAX, 00100 CubitBoolean keep_old = CUBIT_FALSE, 00101 CubitBoolean make_tolerant = CUBIT_FALSE, 00102 FILE* logfile_ptr = NULL) = 0; 00103 // Uses the healing husk to perform one or more healing operations. 00104 // Which operations are performed is determined by switches in the 00105 // healer. The user can set default tolerances (separate from this 00106 // function, override the defaults with this function, or just use the 00107 // tolerances calculated by the healer (preferred). 00108 // 00109 // The possible healing steps are: 00110 // 1) preprocess - removes zero-length edges, sliver faces, duplicate 00111 // vertices. This is the first step which is always 00112 // done (user shouldn't suppress this). Tolerance is resabs. 00113 // 2) simplify - simplify NURBS into analytic. 00114 // Default simplify_tol = .0001 00115 // 3) stitch - stitch geometry together. Iterative from min to max 00116 // tolerance. 00117 // Default min tol = 10e-5 00118 // Default max tol = 1 00119 // 4) geombuild - geometry-related healing. 00120 // Default geombuild_tol = .01 00121 // Default analytic_tangency_tol = .01 00122 // Default isolspline_solver_tol = .01 00123 // Individual geombuild steps can be (instead of doing all): 00124 // analytic - performs all of the stages of the analytic solver 00125 // subphase of the geometry building phase. The analytic 00126 // solver subphase attempts to heal all edges and 00127 // vertices shared by analytic surfaces. 00128 // isospline - performs all of the stages of the isospline solver 00129 // subphase of the geometry building phase. The 00130 // isospline solver attempts to heal all edges shared 00131 // by tangential isoparametric surfaces (e.g., the 00132 // intersection curve is an isoparametric curve of 00133 // both splines in the intersection). 00134 // reblend - future option 00135 // sharpedge - performs all of the stages of the sharp edge solver 00136 // subphase of the geometry building phase. The sharp 00137 // edge solver attempts to heal all edges and vertices 00138 // that are shared by surfaces that intersect sharply. 00139 // This includes nontangential surface junctions. 00140 // genericspline - performs all of the stages of the generic spline 00141 // solver subphase of the geometry building phase. 00142 // The generic spline solver attempts to heal 00143 // generic tangential spline junctions, (e.g., the 00144 // intersection curve is not an isoparametric curve 00145 // of both splines in the intersection). 00146 // wrapup - handles remaining pcurves, wraps up 00147 // geometry buiilding phase (user shouldn't suppress) 00148 // 5) postprocess - correction of neg-area faces, duplicate vertices, edge groups; 00149 // last step - always done (user shouldn't suppress) 00150 00151 virtual void list_incremental() = 0; 00152 // Lists the current settings for incremental healing 00153 00154 virtual void list_tolerances( DLIList<Body*> &body_list ) = 0; 00155 // Lists out the tolerances of each body, separately 00156 00157 virtual double get_default_simplify_tol() = 0; 00158 virtual void set_default_simplify_tol( double tol ) = 0; 00159 virtual double get_default_stitch_min_tol() = 0; 00160 virtual void set_default_stitch_min_tol( double tol ) = 0; 00161 virtual double get_default_stitch_max_tol() = 0; 00162 virtual void set_default_stitch_max_tol( double tol ) = 0; 00163 virtual double get_default_geombuild_tol() = 0; 00164 virtual void set_default_geombuild_tol( double tol ) = 0; 00165 virtual double get_default_analytic_tol() = 0; 00166 virtual void set_default_analytic_tol( double tol ) = 0; 00167 virtual double get_default_isospline_tol() = 0; 00168 virtual void set_default_isospline_tol( double tol ) = 0; 00169 virtual double get_default_reblend_classify_tol() = 0; 00170 virtual void set_default_reblend_classify_tol( double tol ) = 0; 00171 virtual double get_default_reblend_tol() = 0; 00172 virtual void set_default_reblend_tol( double tol ) = 0; 00173 virtual void reset_default_tolerances() = 0; 00174 virtual void list_default_tolerances() = 0; 00175 // Functions to set the default tolerances used. The healer calculates 00176 // the default tolerance per body. These functions allow the user to override 00177 // these defaults for all bodies healed. In incremental healing, the user can 00178 // override these defaults by sending-in tolerances. For autoheal, these 00179 // defaults are used if they are set, otherwise the healer calculates 00180 // intelligent defaults. 00181 00182 virtual void clean_attributes( DLIList<Body*>& body_list ) = 0; 00183 // Cleans healer attributes from the bodies. These can be left if the 00184 // CleanAtt setting was used when doing analysis or healing. 00185 00186 virtual CubitBoolean get_cleanatt_flg() = 0; 00187 virtual void set_cleanatt_flg( CubitBoolean flg ) = 0; 00188 // Get/set flags which determine whether to clean attributes after 00189 // analysis and healing. 00190 00191 virtual int get_show_method() = 0; // 0-none, 1-highlight, 2-draw 00192 virtual void set_show_method( int method ) = 0; 00193 // Method determines how bad geometry is displayed 00194 00195 virtual CubitBoolean get_show_summary_flg() = 0; 00196 virtual void set_show_summary_flg( CubitBoolean flg ) = 0; 00197 // Flag to determine whether to list a summary when showing bad geometry 00198 00199 virtual CubitBoolean get_show_details_flg() = 0; 00200 virtual void set_show_details_flg( CubitBoolean flg ) = 0; 00201 // Flag to determine whether to list details when showing bad geometry 00202 00203 virtual CubitBoolean get_show_on_heal_flg() = 0; 00204 virtual void set_show_on_heal_flg( CubitBoolean flg ) = 0; 00205 // Flag to determine whether to show bad geometry after healing 00206 00207 virtual CubitBoolean get_check_vol_on_heal_flg() = 0; 00208 virtual void set_check_vol_on_heal_flg( CubitBoolean flg ) = 0; 00209 virtual double get_vol_on_heal_limit() = 0; 00210 virtual void set_vol_on_heal_limit( double limit ) = 0; 00211 // Allow for checking of short curves after healing 00212 00213 virtual CubitBoolean get_check_surf_on_heal_flg() = 0; 00214 virtual void set_check_surf_on_heal_flg( CubitBoolean flg ) = 0; 00215 virtual double get_surf_on_heal_limit() = 0; 00216 virtual void set_surf_on_heal_limit( double limit ) = 0; 00217 // Allow for checking of small surfaces after healing 00218 00219 virtual CubitBoolean get_check_curve_on_heal_flg() = 0; 00220 virtual void set_check_curve_on_heal_flg( CubitBoolean flg ) = 0; 00221 virtual double get_curve_on_heal_limit() = 0; 00222 virtual void set_curve_on_heal_limit( double limit ) = 0; 00223 // Allow for checking of short curves after healing 00224 00225 virtual CubitBoolean get_show_bad_vertices_flg() = 0; 00226 virtual void set_show_bad_vertices_flg( CubitBoolean flg ) = 0; 00227 virtual CubitBoolean get_show_bad_curves_flg() = 0; 00228 virtual void set_show_bad_curves_flg( CubitBoolean flg ) = 0; 00229 virtual CubitBoolean get_show_bad_coedges_flg() = 0; 00230 virtual void set_show_bad_coedges_flg( CubitBoolean flg ) = 0; 00231 virtual CubitBoolean get_show_bad_loops_flg() = 0; 00232 virtual void set_show_bad_loops_flg( CubitBoolean flg ) = 0; 00233 virtual CubitBoolean get_show_bad_surfaces_flg() = 0; 00234 virtual void set_show_bad_surfaces_flg( CubitBoolean flg ) = 0; 00235 virtual CubitBoolean get_show_bad_shells_flg() = 0; 00236 virtual void set_show_bad_shells_flg( CubitBoolean flg ) = 0; 00237 virtual CubitBoolean get_show_bad_volumes_flg() = 0; 00238 virtual void set_show_bad_volumes_flg( CubitBoolean flg ) = 0; 00239 virtual CubitBoolean get_show_bad_bodies_flg() = 0; 00240 virtual void set_show_bad_bodies_flg( CubitBoolean flg ) = 0; 00241 // Get/set for flags for what to show during analysis/show 00242 00243 virtual void list_onshow_flgs() = 0; 00244 // Function to list to user what the current onshow flags are 00245 00246 virtual CubitBoolean get_inc_preprocess_flg() = 0; 00247 virtual void set_inc_preprocess_flg( CubitBoolean flg ) = 0; 00248 virtual CubitBoolean get_inc_simplify_flg() = 0; 00249 virtual void set_inc_simplify_flg( CubitBoolean flg ) = 0; 00250 virtual CubitBoolean get_inc_stitch_flg() = 0; 00251 virtual void set_inc_stitch_flg( CubitBoolean flg ) = 0; 00252 virtual CubitBoolean get_inc_geombuild_flg() = 0; 00253 virtual void set_inc_geombuild_flg( CubitBoolean flg ) = 0; 00254 virtual CubitBoolean get_inc_analytic_flg() = 0; 00255 virtual void set_inc_analytic_flg( CubitBoolean flg ) = 0; 00256 virtual CubitBoolean get_inc_isospline_flg() = 0; 00257 virtual void set_inc_isospline_flg( CubitBoolean flg ) = 0; 00258 virtual CubitBoolean get_inc_reblend_flg() = 0; 00259 virtual void set_inc_reblend_flg( CubitBoolean flg ) = 0; 00260 virtual CubitBoolean get_inc_sharpedge_flg() = 0; 00261 virtual void set_inc_sharpedge_flg( CubitBoolean flg ) = 0; 00262 virtual CubitBoolean get_inc_genericspline_flg() = 0; 00263 virtual void set_inc_genericspline_flg( CubitBoolean flg ) = 0; 00264 virtual CubitBoolean get_inc_wrapup_flg() = 0; 00265 virtual void set_inc_wrapup_flg( CubitBoolean flg ) = 0; 00266 virtual CubitBoolean get_inc_postprocess_flg() = 0; 00267 virtual void set_inc_postprocess_flg( CubitBoolean flg ) = 0; 00268 // Functions for controlling incremental healing 00269 00270 virtual void measure_filter( DLIList<RefEntity*> &ref_entities, 00271 double measure_value, 00272 double tolerance ) = 0; 00273 00274 virtual CubitStatus force_simplify_to_plane( DLIList<RefFace*> &ref_face_list, 00275 DLIList<Body*>& new_body_list, 00276 CubitBoolean keep = CUBIT_FALSE ) = 0; 00277 virtual CubitStatus force_simplify_to_cylinder( DLIList<RefFace*> &ref_face_list, 00278 DLIList<Body*>& new_body_list, 00279 CubitBoolean keep = CUBIT_FALSE ) = 0; 00280 virtual CubitStatus force_simplify_to_cone( DLIList<RefFace*> &ref_face_list, 00281 DLIList<Body*>& new_body_list, 00282 CubitBoolean keep = CUBIT_FALSE ) = 0; 00283 virtual CubitStatus force_simplify_to_sphere( DLIList<RefFace*> &ref_face_list, 00284 DLIList<Body*>& new_body_list, 00285 CubitBoolean keep = CUBIT_FALSE ) = 0; 00286 virtual CubitStatus force_simplify_to_torus( DLIList<RefFace*> &ref_face_list, 00287 DLIList<Body*>& new_body_list, 00288 CubitBoolean keep = CUBIT_FALSE ) = 0; 00289 // Forces a spline surface to be an analytical of the type specified. 00290 00291 protected: 00292 00293 private: 00294 00295 }; 00296 00297 #endif 00298