cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : AutoMidsurfaceTool.cpp 00003 // 00004 // Purpose : 00005 // Create a midsurface of a body/volume given a thickness range. If no thickness range is given 00006 // then make a educated guess at the thickness (using something like Volume/Surface Area). 00007 // 00008 // Create Midsurface Volume <id_list> auto [<lower_tol> <upper_tol>] 00009 // 00010 // Creator : Sam Showman 00011 // 00012 // Creation Date : 05/10/2008 00013 //------------------------------------------------------------------------- 00014 #ifndef AutoMidsurfaceTool_HPP 00015 #define AutoMidsurfaceTool_HPP 00016 00017 #include "CubitDefines.h" 00018 #include "CubitVector.hpp" 00019 #include "CubitPlane.hpp" 00020 00021 class GeometryModifyEngine; 00022 class Body; 00023 class RefFace; 00024 class BodySM; 00025 class Surface; 00026 class Curve; 00027 class RefEdge; 00028 template <class X> class DLIList; 00029 00030 class AutoMidsurfaceTool 00031 { 00032 public: 00033 00034 AutoMidsurfaceTool(); 00035 ~AutoMidsurfaceTool(){} 00036 00037 CubitStatus midsurface( 00038 DLIList<Body*> &body_list_in, 00039 DLIList<BodySM*> &body_list_out, 00040 DLIList<Body*> &old_bodies_midsurfaced, 00041 DLIList<double> &thickness_out, 00042 double lower_tol = CUBIT_DBL_MAX, 00043 double upper_tol = CUBIT_DBL_MAX, 00044 CubitBoolean delete_midsurfaced = CUBIT_FALSE, 00045 CubitBoolean preview = CUBIT_FALSE); 00046 //- automatically midsurfaces a volume based on surface pairs and surface area 00047 //- body_list_in - list of bodies to midsurface 00048 //- body_list_out - result bodies 00049 //- lower_tol - lower tolerance 00050 //- upper_tol - upper tolerance 00051 //- delete_midsurfaced - delete the midsurfaced solid 00052 //- transp_midsurfaced - make the midsurfaced solid transparent 00053 //- preview - preview the results 00054 00055 private: 00056 CubitBoolean curve_in_surface(Curve *curve_in, Surface *surf_in); 00057 00058 CubitStatus get_planar_mid_surface( 00059 RefFace* ref_face1, 00060 RefFace* ref_face2, 00061 BodySM* body_sm_to_trim_to, 00062 BodySM*& midsurface_body_sm, 00063 GeometryModifyEngine *gme_ptr ); 00064 00065 CubitStatus find_offset_pair_patches( 00066 DLIList<RefFace*> pairs_list_0, 00067 DLIList<RefFace*> pairs_list_1, 00068 DLIList<RefFace*>& red_faces, 00069 DLIList<RefFace*>& yellow_faces, 00070 DLIList<double>& offset_distances); 00071 00072 CubitStatus random_loc_on_surface( Surface* face_ptr, CubitVector &loc ); 00073 00074 CubitBoolean check_surf_pairs(double min_thick, double max_thick, 00075 DLIList<RefFace*> check_list, Body* body_in ); 00076 }; 00077 00078 #endif 00079