cgma
|
00001 00015 #ifndef GEOMETRYMODIFYTOOL_HPP 00016 #define GEOMETRYMODIFYTOOL_HPP 00017 00018 #include <stdio.h> 00019 #include <map> 00020 00021 #include "CubitDefines.h" 00022 #include "GeometryDefines.h" 00023 #include "CubitBox.hpp" 00024 #include "CubitVector.hpp" 00025 #include "DLIList.hpp" 00026 #include "CGMGeomConfigure.h" 00027 #include "FacetShapeDefs.hpp" 00028 #include "CubitColor.hpp" 00029 00030 class CoEdgeSM; 00031 class LoopSM; 00032 class CubitPlane; 00033 class Surface; 00034 class Lump; 00035 class Curve; 00036 class Body; 00037 class RefVertex; 00038 class RefEdge; 00039 class RefFace; 00040 class RefVolume; 00041 class RefVertex; 00042 class RefFace; 00043 class RefVolume; 00044 template <class X> class DLIList; 00045 class Loop; 00046 class LoopSM; 00047 class RefEntity; 00048 class CoEdgeSM; 00049 class Surface; 00050 class ShellSM; 00051 class Lump; 00052 class TopologyEntity; 00053 class TopologyBridge; 00054 class ShellSM; 00055 class GeometryModifyEngine; 00056 class TopologyBridge; 00057 class TopologyEntity; 00058 class BodySM; 00059 class Surface; 00060 class Curve; 00061 class TBPoint; 00062 class GeometryEntity; 00063 00064 00066 class CUBIT_GEOM_EXPORT GeometryModifyTool 00067 { 00068 00069 friend class MergeTool; 00070 public : 00071 00086 static GeometryModifyTool* instance( GeometryModifyEngine* GMEPtr = NULL); 00087 00088 static void delete_instance(); 00089 00091 ~GeometryModifyTool(); 00092 00097 00098 Body* sphere( double radius, 00099 int x_shift = 0, 00100 int y_shift = 0, 00101 int z_shift = 0, 00102 double inner_radius = 0, 00103 bool delete_side = false ); 00104 00109 00110 Body* brick( double wid, double dep, double hi ); 00111 00118 00119 Body* brick( const CubitVector ¢er, 00120 const CubitVector axes[3], 00121 const CubitVector &extension ); 00122 00128 00129 Body* prism( double height, int sides, double major, double minor ); 00130 00137 00138 Body* pyramid( double height, int sides, double major, double minor, 00139 double top=0.0 ); 00140 00148 00149 Body* cylinder( double hi, double r1, double r2, double r3 ); 00150 00156 00157 Body* torus( double r1, double r2 ); 00158 00165 00166 Body* planar_sheet( const CubitVector& p1, 00167 const CubitVector& p2, 00168 const CubitVector& p3, 00169 const CubitVector& p4 ); 00170 00176 00177 Body* planar_sheet( const CubitVector ¢er, 00178 const CubitVector axes[2], 00179 double width, double height ); 00180 00189 00190 Body* planar_sheet( const CubitPlane& plane, 00191 const CubitBox& bounding_box, 00192 int extension_type = 0, 00193 double extension = 0.0 ); 00194 00202 00203 Body* create_body( VolumeFacets& volume, std::map<FacetShapes*, RefEntity*>& entity_map, 00204 const FacetPointSet& points, int interp_order); 00205 00207 CubitStatus scale ( Body *&entity, 00208 const CubitVector& point, 00209 const CubitVector& factors, 00210 bool check_to_transform = true, 00211 bool preview = false, 00212 bool reset_preview=true); 00213 00226 00227 Body* copy_body( Body* body_ptr, 00228 std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL ); 00229 00233 00234 RefEntity* copy_refentity( RefEntity *old_entity ); 00235 00237 CubitStatus reverse( DLIList<Body*> &body_list ); 00238 00240 CubitStatus reverse( DLIList<RefFace*> &ref_face_list ); 00241 00245 00246 00247 CubitStatus align_entities( RefFace *my_face, 00248 RefFace *target_face, 00249 DLIList<RefEntity*> &entities_to_move, 00250 bool reverse, 00251 CubitVector &my_center, 00252 CubitVector &axis_of_rot, 00253 CubitVector &target_center, 00254 double &angle, 00255 bool preview); 00275 00276 CubitStatus align_entities(DLIList<RefEntity*> &entities_to_move, 00277 CubitVector &position_to_align, 00278 CubitVector &position_to_align_to, 00279 CubitVector &axis_origin, 00280 CubitVector &axis_of_rot, 00281 double &angle_of_rotation, 00282 bool preview); 00283 00301 00302 CubitStatus align_entities( DLIList<RefEntity*>& reference_entities, 00303 DLIList<RefEntity*> &entities_to_move, 00304 CubitVector align_to_vec, 00305 CubitVector &my_center, 00306 CubitVector &axis_of_rot, 00307 double &angle, 00308 bool preview ); 00336 00337 CubitStatus chop( DLIList<Body*> &bodies, 00338 DLIList<Body*> &intersectBodies, 00339 DLIList<Body*> &outsideBodies, 00340 Body*& leftoversBody, 00341 bool keep_old = false, 00342 bool nonreg = false ); 00343 00344 CubitStatus hollow( DLIList<Body*>& bodies, 00345 DLIList<RefFace*> faces_to_remove, 00346 DLIList<Body*>& new_bodies, 00347 double depth); 00348 00350 CubitStatus thicken( DLIList<Body*>& bodies, 00351 DLIList<Body*>& new_bodies, 00352 double depth, 00353 bool both = false ); 00355 CubitStatus unite( DLIList<Body*> &bodies, 00356 DLIList<Body*> &newBodies, 00357 bool keep_old = false ); 00358 00360 CubitStatus unite( DLIList<BodySM*> &body_sm_list, 00361 DLIList<BodySM*> &new_body_sm_list, 00362 bool keep_old = false); 00363 00365 CubitStatus subtract( DLIList<Body*> &tool_body_list, 00366 DLIList<Body*> &from_bodies, 00367 DLIList<Body*> &new_bodies, 00368 bool imprint = false, 00369 bool keep_old = false ); 00370 00372 CubitStatus subtract( Body* tool_body, 00373 DLIList<Body*> &from_bodies, 00374 DLIList<Body*> &new_bodies, 00375 bool imprint = false, 00376 bool keep_old = false ); 00377 00382 00383 CubitStatus validate_normals( DLIList<Body*>& bodies, 00384 RefFace *surf_ref, 00385 bool reverse ); 00386 00388 CubitStatus intersect( Body *tool_body_ptr, 00389 DLIList<Body*> &from_bodies, 00390 DLIList<Body*> &new_bodies, 00391 bool keep_old = false, 00392 bool preview = false ); 00393 00395 CubitStatus intersect( DLIList<Body*> &from_bodies, 00396 DLIList<Body*> &new_bodies, 00397 bool keep_old = false, 00398 bool preview = false); 00399 00404 00405 CubitStatus section( DLIList<Body*> §ion_body_list, 00406 const CubitVector &point_1, 00407 const CubitVector &point_2, 00408 const CubitVector &point_3, 00409 DLIList<Body*> &new_body_list, 00410 CubitBoolean keep_normal_side, 00411 CubitBoolean keep_old = CUBIT_FALSE ); 00412 00414 CubitStatus split_periodic( Body *body_ptr, 00415 Body *&new_body_ptr ); 00416 00418 CubitStatus stitch( DLIList<Body*> &bodies_to_stitch, 00419 DLIList<Body*> &result_list, 00420 bool tighten_gaps, 00421 double tolerance = -1.0 ); 00422 00424 CubitStatus discover_topology(RefFace *ref_face_ptr, 00425 CubitVector &pos, 00426 double &step_size, 00427 int num_subdivisions); 00428 00429 CubitStatus imprint_and_merge_curves(RefEdge *curve1, 00430 RefEdge *curve2, 00431 DLIList<RefVertex*> &vert_list, 00432 double divergence_angle, 00433 DLIList<DLIList<RefEdge*>*> &curves_to_merge1, 00434 DLIList<DLIList<RefEdge*>*> &curves_to_merge2, 00435 DLIList<DLIList<RefEdge*>*> &prev_curve_merge_lists, 00436 DLIList<DLIList<RefFace*>*> &prev_surf_merge_lists); 00437 00438 #ifdef KCM_MESH_TO_GEOM 00439 00440 CubitStatus mesh2brep(std::vector<double> &xvals, 00441 std::vector<double> &yvals, 00442 std::vector<double> &zvals, 00443 std::vector<unsigned int> &tri_connectivity, 00444 DLIList<BodySM*> &new_body_sms); 00445 #endif 00446 00448 void march_path_to_discover_horizontal(CubitVector &start_pos, 00449 CubitVector &sweep_dir, 00450 RefFace *start_face, 00451 CubitVector &march_dir, 00452 double &step_size, 00453 DLIList<CubitVector> &final_points, 00454 DLIList<RefFace*> &ending_faces); 00455 void march_path_to_discover_vertical(CubitVector &start_pos, 00456 CubitVector &sweep_dir, 00457 RefFace *start_face, 00458 CubitVector &march_dir, // should be normalized 00459 double &step_size, 00460 DLIList<CubitVector> &final_points, 00461 DLIList<RefFace*> &ending_faces); 00462 void march_using_planes(CubitVector &point_on_surf, 00463 RefFace *surf, 00464 CubitVector &march_dir, 00465 double step_size, 00466 DLIList<CubitVector> &horizontal_points, 00467 DLIList<CubitVector> &vertical_points); 00468 void trace_out_curves(Body *plane_body, 00469 CubitVector &start_point, 00470 CubitVector &march_dir, 00471 double step_size, 00472 DLIList<CubitVector> &horizontal_points, 00473 DLIList<CubitVector> &vertical_points); 00474 00476 void subdivide_pie(CubitVector &dir1, CubitVector &dir2, int num_subdivisions, 00477 DLIList<CubitVector> &all_directions); 00478 00490 00491 CubitStatus split_surface( RefFace *ref_face_ptr, 00492 DLIList<CubitVector*> &locations, 00493 DLIList<DLIList<CubitVector*>*> &vec_lists, 00494 CubitBoolean preview_flg = CUBIT_FALSE, 00495 CubitBoolean create_ref_edges_flg = CUBIT_FALSE, 00496 CubitBoolean clear_previous_previews = CUBIT_TRUE ); 00497 00498 00502 00503 CubitStatus split_surface( DLIList<RefFace*> &ref_face_list, 00504 DLIList<CubitVector*> &locations, 00505 DLIList<DLIList<DLIList<CubitVector*>*>*> &list_of_vec_lists, 00506 CubitBoolean preview_flg = CUBIT_FALSE, 00507 CubitBoolean create_ref_edges_flg = CUBIT_FALSE, 00508 CubitBoolean clear_previous_previews = CUBIT_TRUE ); 00509 00541 00542 CubitStatus split_surfaces_extend( DLIList<RefFace*> &ref_face_list, 00543 DLIList<RefVertex*> &ref_vertex_list, 00544 CubitBoolean preview_flg = CUBIT_FALSE, 00545 CubitBoolean create_ref_edges_flg = CUBIT_FALSE ); 00546 00602 00603 CubitStatus split_surfaces( DLIList<RefFace*> &ref_face_list, 00604 int num_segs, 00605 double fraction, 00606 double distance, 00607 RefEdge *from_curve_ptr, 00608 DLIList<RefVertex*> &corner_vertex_list, 00609 DLIList<RefVertex*> &through_vertex_list, 00610 RefEdge *curve_dir_ptr = NULL, 00611 CubitBoolean preview_flg = CUBIT_FALSE, 00612 CubitBoolean create_ref_edges_flg = CUBIT_FALSE ); 00613 00630 00631 CubitStatus split_surfaces_offset( 00632 DLIList<RefFace*> &ref_face_list, 00633 DLIList<RefEdge*> &edge_list, 00634 int num_segs, 00635 double distance, 00636 CubitBoolean partition_flg = CUBIT_FALSE, 00637 CubitBoolean blunt_flg = CUBIT_FALSE, 00638 CubitBoolean preview_flg = CUBIT_FALSE, 00639 CubitBoolean create_ref_edges_flg = CUBIT_FALSE); 00640 00648 00649 CubitStatus auto_mid_surface( 00650 DLIList<Body*> &body_list_in, 00651 DLIList<Body*> &body_list_out, 00652 DLIList<Body*> &old_bodies_midsurfaced, 00653 DLIList<double> &thickness_list, 00654 double lower_tol, 00655 double upper_tol, 00656 CubitBoolean delete_midsurfaced, 00657 CubitBoolean preview); 00672 00673 CubitStatus webcut_with_cylinder( DLIList<Body*>& webcut_body_list, 00674 double radius, 00675 const CubitVector &axis, 00676 const CubitVector& center, 00677 DLIList<Body*> &results_list, 00678 DLIList<Body*> &neighboring_bodies, 00679 ImprintType imprint_type = NO_IMPRINT, 00680 CubitBoolean merge = CUBIT_FALSE , 00681 CubitBoolean preview = CUBIT_FALSE); 00682 00688 00689 CubitStatus webcut_with_Cone( DLIList<Body*>& webcut_body_list, 00690 DLIList<BodySM*> &webcut_bodySM_list, 00691 double outer_radius, 00692 double top_radius, 00693 CubitVector &Axispt1, 00694 CubitVector& Axispt2, 00695 DLIList<Body*> &results_list, 00696 DLIList<Body*> &neighboring_bodies, 00697 ImprintType imprint_type = NO_IMPRINT, 00698 CubitBoolean merge = CUBIT_FALSE , 00699 CubitBoolean preview = CUBIT_FALSE); 00700 00701 #ifdef CAT 00702 CubitStatus webcut_across_translate( DLIList<Body*>& body_list, 00703 RefFace* plane_surf1, 00704 RefFace* plane_surf2, 00705 DLIList<Body*>& results_list, 00706 ImprintType imprint_type = NO_IMPRINT, 00707 CubitBoolean merge = CUBIT_FALSE, 00708 CubitBoolean preview = CUBIT_FALSE); 00712 #endif 00713 00722 00723 CubitStatus webcut_with_brick( DLIList<Body*>& webcut_body_list, 00724 const CubitVector ¢er, 00725 const CubitVector axes[3], 00726 const CubitVector &extension, 00727 DLIList<Body*> &results_list, 00728 DLIList<Body*> &neighbor_list, 00729 ImprintType imprint_type = NO_IMPRINT, 00730 CubitBoolean merge = CUBIT_FALSE, 00731 CubitBoolean preview = CUBIT_FALSE); 00732 00733 00739 00740 CubitStatus webcut_with_planar_sheet( DLIList<Body*>& webcut_body_list, 00741 const CubitVector ¢er, 00742 const CubitVector axes[2], 00743 double width, 00744 double height, 00745 DLIList<Body*> &results_list, 00746 DLIList<Body*> &neighbor_list, 00747 ImprintType imprint_type = NO_IMPRINT, 00748 CubitBoolean merge = CUBIT_FALSE, 00749 CubitBoolean preview = CUBIT_FALSE); 00750 00751 00769 00770 CubitStatus webcut_with_plane( DLIList<Body*>& webcut_body_list, 00771 const CubitVector &vector1, 00772 const CubitVector &vector2, 00773 const CubitVector &vector3, 00774 DLIList<Body*> &results_list, 00775 DLIList<Body*> &neighbor_list, 00776 ImprintType imprint_type = NO_IMPRINT, 00777 CubitBoolean merge = CUBIT_FALSE, 00778 CubitBoolean preview = CUBIT_FALSE) ; 00779 00799 00800 CubitStatus webcut_with_surface( DLIList<Body*>& webcut_body_list, 00801 RefFace* refFace, 00802 DLIList<Body*>& results_list, 00803 DLIList<Body*> &neighbor_list, 00804 ImprintType imprint_type = NO_IMPRINT, 00805 CubitBoolean merge = CUBIT_FALSE, 00806 CubitBoolean preview = CUBIT_FALSE); 00807 00827 00828 CubitStatus webcut_with_curve_loop( DLIList<Body*>& webcut_body_list, 00829 DLIList<RefEdge*>& refedge_list, 00830 DLIList<Body*>& results_list, 00831 DLIList<Body*> &neighbor_list, 00832 ImprintType imprint_type = NO_IMPRINT, 00833 CubitBoolean merge = CUBIT_FALSE, 00834 CubitBoolean preview = CUBIT_FALSE); 00835 00841 00842 CubitStatus webcut_with_sheet( DLIList<Body*>& webcut_body_list, 00843 Body *sheet_body, 00844 DLIList<Body*> &new_bodies, 00845 DLIList<Body*> &neighbor_list, 00846 ImprintType imprint_type = NO_IMPRINT, 00847 CubitBoolean merge = CUBIT_FALSE, 00848 CubitBoolean preview = CUBIT_FALSE); 00849 00867 00868 CubitStatus webcut_with_body( DLIList<Body*>& webcut_body_list, 00869 Body* body, 00870 DLIList<Body*>& results_list, 00871 DLIList<Body*> &neighbor_list, 00872 ImprintType imprint_type = NO_IMPRINT, 00873 CubitBoolean merge = CUBIT_FALSE, 00874 CubitBoolean preview = CUBIT_FALSE); 00875 00879 00880 CubitStatus webcut_with_extended_sheet( DLIList<Body*> &webcut_body_list, 00881 DLIList<RefFace*> &ref_face_list, 00882 DLIList<Body*> &new_bodies, 00883 DLIList<Body*> &neighbor_list, 00884 int &num_cut, 00885 ImprintType imprint_type = NO_IMPRINT, 00886 CubitBoolean merge = CUBIT_FALSE, 00887 CubitBoolean preview = CUBIT_FALSE); 00888 00890 CubitStatus webcut_with_sweep_surfaces_rotated( 00891 DLIList<Body*> &webcut_body_list, 00892 DLIList<RefFace*> &tool_faces, 00893 CubitVector &point, 00894 CubitVector &sweep_axis, 00895 double angle, 00896 RefFace* stop_surf, 00897 bool up_to_next, 00898 DLIList<Body*> &new_bodies, 00899 DLIList<Body*> &neighbor_list, 00900 ImprintType imprint_type = NO_IMPRINT, 00901 CubitBoolean merge = false, 00902 CubitBoolean preview = false); 00903 00905 CubitStatus webcut_with_sweep_curves_rotated( 00906 DLIList<Body*> &webcut_body_list, 00907 DLIList<RefEdge*> &tool_curves, 00908 CubitVector &point, 00909 CubitVector &sweep_axis, 00910 double angle, 00911 RefFace* stop_surf, 00912 DLIList<Body*> &new_bodies, 00913 DLIList<Body*> &neighbor_list, 00914 ImprintType imprint_type = NO_IMPRINT, 00915 CubitBoolean merge = false, 00916 CubitBoolean preview = false); 00917 00919 CubitStatus webcut_with_sweep_surfaces( 00920 DLIList<Body*> &webcut_body_list, 00921 DLIList<RefFace*> &tool_faces, 00922 const CubitVector sweep_vector, 00923 bool sweep_perp, 00924 bool through_all, 00925 bool outward, 00926 bool up_to_next, 00927 RefFace *stop_surf, 00928 RefEdge* edge_to_sweep_along, 00929 DLIList<Body*> &new_bodies, 00930 DLIList<Body*> &neighbor_list, 00931 ImprintType imprint_type = NO_IMPRINT, 00932 CubitBoolean merge = false, 00933 CubitBoolean preview = false); 00934 00936 CubitStatus webcut_with_sweep_curves( 00937 DLIList<Body*> &webcut_body_list, 00938 DLIList<RefEdge*> &tool_curves, 00939 const CubitVector sweep_vector, 00940 bool through_all, 00941 RefFace *stop_surf, 00942 RefEdge* edge_to_sweep_along, 00943 DLIList<Body*> &new_bodies, 00944 DLIList<Body*> &neighbor_list, 00945 ImprintType imprint_type = NO_IMPRINT, 00946 CubitBoolean merge = false, 00947 CubitBoolean preview = false); 00948 00950 CubitStatus remove_topology( DLIList<RefEdge*> &ref_edge_list, 00951 DLIList<RefFace*> &ref_face_list, double backoff_distance, 00952 double small_curve_size, DLIList<Body*> &new_body_list, 00953 CubitBoolean propagate, 00954 CubitBoolean preview); 00955 00961 00962 CubitStatus offset_curves( DLIList<RefEdge*>& ref_edge_list, 00963 DLIList<RefEdge*>& output_edge_list, 00964 double offset_distance, 00965 const CubitVector& offset_direction, 00966 int gap_type = 1 ); 00967 00973 00974 CubitStatus trim_curve( RefEdge* trim_curve, 00975 const CubitVector& trim_vector, 00976 const CubitVector& keep_vector ); 00977 00979 CubitStatus imprint( DLIList<Body*> &from_body_list, 00980 DLIList<Body*> &new_body_list, 00981 CubitBoolean keep_old = CUBIT_FALSE ); 00982 00988 00989 CubitStatus imprint( DLIList<Body*> &body_list, 00990 DLIList<RefEdge*> &ref_edge_list, 00991 DLIList<Body*>& new_body_list, 00992 CubitBoolean keep_old_body = CUBIT_FALSE, 00993 CubitBoolean show_messages = CUBIT_TRUE ); 00994 01003 01004 CubitStatus imprint( DLIList<RefFace*> &ref_face_list, 01005 DLIList<RefEdge*> &ref_edge_list, 01006 DLIList<Body*>& new_body_list, 01007 CubitBoolean keep_old_body = CUBIT_FALSE ); 01008 01016 01017 CubitStatus imprint( DLIList<Surface*> &surface_list, 01018 DLIList<DLIList<Curve*>*> &curve_lists_list, 01019 Body*& new_body, 01020 CubitBoolean keep_old_body = CUBIT_FALSE, 01021 CubitBoolean expand = CUBIT_TRUE); 01022 01027 01028 CubitStatus imprint(DLIList<Body*> &body_list, 01029 DLIList<CubitVector> &vector_list, 01030 DLIList<Body*>& new_body_list, 01031 CubitBoolean keep_old_body = CUBIT_FALSE, 01032 CubitBoolean merge = CUBIT_FALSE ); 01033 01034 //HEADER- Sweep-related functions. All of these are implemented 01035 //HEADER- only for RefEntities whose underlying geometry is 01036 //HEADER- represented by a solid model such as . The interface 01037 //HEADER- itself is free of . 01038 01039 01041 CubitStatus imprint_projected_edges( DLIList<RefFace*> &ref_face_list, 01042 DLIList<RefEdge*> &ref_edge_list, 01043 DLIList<Body*>& new_body_list, 01044 CubitBoolean keep_old_body, 01045 CubitBoolean keep_free_edges ); 01046 01049 CubitStatus imprint_projected_edges( DLIList<RefFace*> &ref_face_list, 01050 DLIList<Body*> &body_list, 01051 DLIList<RefEdge*> &ref_edge_list, 01052 DLIList<Body*>& new_body_list, 01053 CubitBoolean keep_old_body, 01054 CubitBoolean keep_free_edges ); 01055 01058 CubitStatus tolerant_imprint( DLIList<RefFace*> &ref_faces, 01059 DLIList<RefEdge*> &ref_edge_list, 01060 DLIList<Body*> &new_bodies, 01061 bool merge = false ); 01062 01065 CubitStatus tolerant_imprint( RefFace *ref_face, 01066 DLIList<RefEdge*> &ref_edge_list, 01067 Body *&new_body, bool merge = false ); 01068 01071 CubitStatus tolerant_imprint( DLIList<Body*> &bodies, DLIList<Body*> &new_bodies, 01072 double overlap_tol, 01073 double imprint_tol, 01074 bool merge = false ); 01075 01077 CubitStatus project_edges( DLIList<RefFace*> &ref_face_list, 01078 DLIList<RefEdge*> &ref_edge_list_in, 01079 DLIList<RefEdge*> &ref_edge_list_new, 01080 CubitBoolean trim_projected = CUBIT_FALSE); 01081 01083 CubitStatus regularize_body( Body *body_ptr, Body *&new_body ); 01084 01087 CubitStatus regularize_refentity( RefEntity *old_entity_ptr, 01088 Body *&new_body_ptr); 01089 01092 CubitStatus test_regularize_refentity( RefEntity *old_entity_ptr); 01093 01094 CubitStatus split_free_curve( RefEdge *ref_edge, 01095 DLIList<CubitVector> &split_locations, 01096 DLIList<RefEdge*> &new_ref_edges ); 01097 01099 CubitStatus split_body( Body *body_ptr, 01100 DLIList<Body*> &new_bodies ) const; 01101 01105 01106 CubitStatus separate_surfaces( DLIList<RefFace*> &ref_face_list, 01107 DLIList<Body*> &new_bodies ); 01108 01109 01111 01113 static void set_group_imprint(CubitBoolean flag) {groupImprint = flag;} 01115 static CubitBoolean get_group_imprint() {return groupImprint;} 01116 01118 static void set_all_edges_imprint( CubitBoolean flag ); 01120 static CubitBoolean get_all_edges_imprint(); 01121 01123 static void boolean_regularize( CubitBoolean flag ); 01125 static CubitBoolean boolean_regularize(); 01126 01128 static CubitBoolean unite_mixed_models(); 01130 static void unite_mixed_models( CubitBoolean flag ); 01131 01133 static CubitBoolean get_new_ids() {return newIds;} 01135 static void set_new_ids(CubitBoolean flag) {newIds = flag;} 01136 01138 static CubitBoolean get_old_names() { return oldNames; } 01140 static void set_old_names(CubitBoolean flag) { oldNames = flag; } 01141 01143 static void initialize_settings(); 01144 01145 01146 #ifdef PROE 01147 CubitStatus prepare_for_topology_update( BodySM* old_bodysm ); 01148 01149 CubitStatus finish_topology_update( BodySM* new_bodysm, 01150 Body* old_body ); 01151 #endif 01152 01154 static RefEntity* get_copy_entity() { return copyingEntity; } 01155 01157 static void set_copy_entity( RefEntity *ent) { copyingEntity = ent; } 01158 01159 double get_resultant_angle_score(RefFace *narrow_face, 01160 RefFace *other_face, 01161 RefEdge *common_edge); 01162 01163 double get_neighbor_type_score(RefEdge *common_edge, 01164 RefFace *other_face, 01165 double small_curve_size, 01166 int &neighbor_is_narrow_or_small); 01167 01168 double get_dihedral_angle_score(RefFace *f1, RefFace *f2, 01169 RefEdge *common_edge); 01170 01171 double get_edge_type_score(RefEdge *common_edge, double small_curve_size); 01172 double get_diff_from_multiple_of_90(double angle); 01173 void split_surface_with_narrow_region(RefFace *face, 01174 DLIList<CubitVector> &split_pos1_list, 01175 DLIList<CubitVector> &split_pos2_list); 01176 01178 01192 01193 RefVertex* make_RefVertex(CubitVector const& point, int color = CUBIT_DEFAULT_COLOR_INDEX) const; 01194 RefVertex* make_RefVertex( RefVertex *vertex ) const; 01195 01197 Body *make_Body(Surface *surface) const; 01198 01218 01219 RefEdge* make_RefEdge( GeometryType ref_edge_type, 01220 RefVertex *ref_vertex_1, 01221 RefVertex *ref_vertex_2, 01222 DLIList<CubitVector*>& vector_list, 01223 RefFace* reffaca_ptr = NULL ) const ; 01224 01239 01240 RefEdge* make_RefEdge( RefVertex *ref_vertex_1, 01241 RefVertex *ref_vertex_2, 01242 RefFace* ref_face_ptr, 01243 RefVertex const* ref_vertex_3 = NULL ) const ; 01244 01253 01254 RefEdge* make_RefEdge(RefEdge *ref_edge, 01255 bool copy_attribs = true, 01256 std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL ) const; 01257 01303 01304 RefEdge* make_RefEdge(GeometryType ref_edge_type, 01305 RefVertex *ref_vertex_1, 01306 RefVertex *ref_vertex_2, 01307 CubitVector const* intermediate_point = NULL ) const; 01308 01309 RefEdge* make_elliptical_RefEdge( RefVertex *vert1, 01310 RefVertex *vert2, 01311 CubitVector center_point, 01312 double start_angle, 01313 double end_angle, 01314 CubitSense sense) const; 01315 01316 01318 RefFace* make_RefFace(RefFace *from_ref_face, 01319 std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL) const; 01320 01334 01335 Body* make_extended_sheet( DLIList<RefFace*> &ref_face_list, 01336 CubitBox *clip_box_ptr = NULL, 01337 bool preview = false) const; 01338 01362 01363 RefFace* make_RefFace(GeometryType ref_face_type, 01364 DLIList<RefEdge*>& ref_edge_list, 01365 bool is_free_face, 01366 RefFace *ref_face_ptr = NULL, 01367 bool check_edges = true ) const ; 01368 01382 01383 Body* make_Body(DLIList<RefVolume*>& ref_volume_list) const ; 01384 01390 01391 Body* make_Body(RefFace *from_ref_face, 01392 std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL ) const; 01393 01415 01416 Body* make_Body(GeometryType ref_face_type, 01417 DLIList<RefEdge*>& ref_edge_list, 01418 RefFace *ref_face_ptr = NULL) const ; 01419 01421 CubitStatus sweep_translational(DLIList<RefEntity*>& ref_ent_list, 01422 const CubitVector& sweep_vector, 01423 double draft_angle, 01424 int draft_type, 01425 CubitBoolean switchside, 01426 CubitBoolean rigid, 01427 CubitBoolean anchor_entity, 01428 CubitBoolean keep_old, 01429 DLIList<Body*>& output_body_list); 01430 01431 CubitStatus sweep_helical( DLIList<RefEntity*>& ref_ent_list, 01432 CubitVector &location, 01433 CubitVector &direction, 01434 double &thread_distance, 01435 double &angle, 01436 bool right_handed, 01437 CubitBoolean anchor_entity, 01438 CubitBoolean keep_old, 01439 DLIList<Body*>& output_body_list); 01440 01441 CubitStatus sweep_curve_target(CubitPlane ref_plane, 01442 DLIList<RefEntity*>& ref_ent_list); 01443 01444 CubitStatus sweep_curve_target(DLIList<RefEdge*>& curve_list, 01445 Body *target_body, 01446 DLIList<Body*> &out_bodies, 01447 CubitVector direction, 01448 CubitPlane stop_plane, 01449 bool unite); 01450 01451 CubitStatus sweep_surface_target(RefFace *face, 01452 Body *target_body, 01453 CubitVector distance, 01454 CubitPlane stop_plane, 01455 double magnitude = 0.0 ); 01456 01457 CubitStatus sweep_surface_target(CubitPlane ref_plane, 01458 DLIList<RefEntity*>& ref_ent_list); 01459 01460 CubitStatus sweep_perpendicular(DLIList<RefEntity*>& ref_ent_list, 01461 double distance, 01462 double draft_angle, 01463 int draft_type, 01464 CubitBoolean switchside, 01465 CubitBoolean rigid, 01466 CubitBoolean anchor_entity, 01467 CubitBoolean keep_old, 01468 DLIList<Body*>& output_body_list); 01469 01471 CubitStatus sweep_rotational(DLIList<RefEntity*>& ref_ent_list, 01472 const CubitVector& point, 01473 const CubitVector& direction, 01474 double angle, 01475 DLIList<Body*>& output_body_list, 01476 CubitBoolean anchor_entity, 01477 CubitBoolean keep_old, 01478 int steps = 0, 01479 double draft_angle = 0.0, 01480 int draft_type = 0, 01481 CubitBoolean switchside = CUBIT_FALSE, 01482 CubitBoolean make_solid = CUBIT_FALSE, 01483 CubitBoolean rigid = CUBIT_FALSE ); 01484 01486 CubitStatus sweep_along_curve(DLIList<RefEntity*>& ref_ent_list, 01487 DLIList<RefEdge*>& ref_edge_list, 01488 DLIList<Body*>& output_body_list, 01489 CubitBoolean anchor_entity, 01490 CubitBoolean keep_old, 01491 double draft_angle = 0.0, 01492 int draft_type = 0, 01493 CubitBoolean rigid = CUBIT_FALSE); 01494 01496 CubitStatus tweak_bend(DLIList<Body*> &bend_bodies, 01497 DLIList<Body*> &new_body_list, 01498 CubitVector& neutral_root, 01499 CubitVector& bend_axis, 01500 CubitVector& bend_direction, 01501 double radius, 01502 double angle, 01503 DLIList<CubitVector> &bend_regions, 01504 double width = -1, 01505 CubitBoolean center_bend = CUBIT_FALSE, 01506 int num_points = 0, 01507 CubitBoolean keep_old_body = CUBIT_FALSE, 01508 CubitBoolean preview = CUBIT_FALSE ); 01509 01515 01516 CubitStatus tweak_chamfer( DLIList<RefEdge*> &ref_edge_list, 01517 double left_offset, 01518 DLIList<Body*> &new_body_list, 01519 double right_offset = -1.0, 01520 CubitBoolean keep_old_body = CUBIT_FALSE, 01521 CubitBoolean preview = CUBIT_FALSE ); 01522 01528 01529 CubitStatus tweak_chamfer( DLIList<RefVertex*> &ref_vertex_list, 01530 double offset1, 01531 DLIList<Body*> &new_body_list, 01532 RefEdge *edge1 = NULL, 01533 double offset2 = -1.0, 01534 RefEdge *edge2 = NULL, 01535 double offset3 = -1.0, 01536 RefEdge *edge3 = NULL, 01537 CubitBoolean keep_old_body = CUBIT_FALSE, 01538 CubitBoolean preview = CUBIT_FALSE ); 01539 01542 CubitStatus tweak_fillet( DLIList<RefEdge*> &ref_edge_list, 01543 double radius, 01544 DLIList<Body*> &new_body_list, 01545 CubitBoolean keep_old_body = CUBIT_FALSE, 01546 CubitBoolean preview = CUBIT_FALSE ); 01547 01552 01553 CubitStatus tweak_fillet( RefEdge *ref_edge_ptr, 01554 double start_radius, 01555 double end_radius, 01556 Body *&new_body_ptr, 01557 CubitBoolean keep_old_body = CUBIT_FALSE, 01558 CubitBoolean preview = CUBIT_FALSE ); 01559 01561 CubitStatus tweak_fillet( DLIList<RefVertex*> &ref_vertex_list, 01562 double radius, 01563 DLIList<Body*> &new_body_list, 01564 CubitBoolean keep_old_body = CUBIT_FALSE, 01565 CubitBoolean preview = CUBIT_FALSE ); 01566 01568 CubitStatus tweak_move( DLIList<RefFace*> &ref_face_list, 01569 const CubitVector &delta, 01570 DLIList<Body*> &new_body_list, 01571 CubitBoolean keep_old_body = CUBIT_FALSE, 01572 CubitBoolean preview = CUBIT_FALSE ); 01573 01575 CubitStatus tweak_move( DLIList<RefEdge*> &ref_edge_list, 01576 const CubitVector &delta, 01577 DLIList<Body*> &new_body_list, 01578 CubitBoolean keep_old_body = CUBIT_FALSE, 01579 CubitBoolean preview = CUBIT_FALSE ); 01580 01585 01586 CubitStatus tweak_offset( DLIList<RefFace*> &ref_face_list, 01587 double offset_distance, 01588 DLIList<RefFace*> *add_ref_face_list_ptr, 01589 DLIList<double> *add_offset_list_ptr, 01590 DLIList<Body*> &new_body_list, 01591 CubitBoolean keep_old_body = CUBIT_FALSE, 01592 CubitBoolean preview = CUBIT_FALSE ); 01593 01598 01599 CubitStatus tweak_offset( DLIList<RefEdge*> &ref_edge_list, 01600 double offset_distance, 01601 DLIList<RefEdge*> *add_ref_face_list_ptr, 01602 DLIList<double> *add_offset_list_ptr, 01603 DLIList<Body*> &new_body_list, 01604 CubitBoolean keep_old_body = CUBIT_FALSE, 01605 CubitBoolean preview = CUBIT_FALSE ); 01606 01608 CubitStatus tweak_remove_individually( DLIList<RefFace*> &ref_face_list, 01609 DLIList<Body*> &new_body_list, 01610 CubitBoolean keep_surface = CUBIT_FALSE, 01611 CubitBoolean keep_old_body = CUBIT_FALSE, 01612 CubitBoolean preview = CUBIT_FALSE ); 01613 01615 CubitStatus tweak_remove_together( DLIList<RefFace*> &ref_face_list, 01616 DLIList<Body*> &new_body_list, 01617 CubitBoolean extend_adjoining = CUBIT_TRUE, 01618 CubitBoolean keep_surface = CUBIT_FALSE, 01619 CubitBoolean keep_old_body = CUBIT_FALSE, 01620 CubitBoolean preview = CUBIT_FALSE); 01621 01626 01627 CubitStatus tweak_remove( DLIList<RefEdge*> &ref_edge_list, 01628 DLIList<Body*> &new_body_list, 01629 CubitBoolean keep_old_body = CUBIT_FALSE, 01630 CubitBoolean preview = CUBIT_FALSE ); 01631 01642 01643 CubitStatus tweak_target( DLIList<RefFace*> &ref_face_list, 01644 DLIList<RefFace*> &target_face_list, 01645 DLIList<Body*> &new_body_list, 01646 CubitBoolean extend_flg = CUBIT_TRUE, 01647 CubitPlane *limit_plane = NULL, 01648 CubitBoolean reverse_flg = CUBIT_FALSE, 01649 CubitBoolean keep_old_body = CUBIT_FALSE, 01650 CubitBoolean preview = CUBIT_FALSE ); 01651 01663 01664 CubitStatus tweak_target( DLIList<RefFace*> &ref_face_list, 01665 CubitPlane &plane, 01666 DLIList<Body*> &new_body_list, 01667 CubitBoolean reverse_flg = CUBIT_FALSE, 01668 CubitBoolean keep_old_body = CUBIT_FALSE, 01669 CubitBoolean preview = CUBIT_FALSE ); 01670 01683 01684 CubitStatus tweak_target( DLIList<RefEdge*> &ref_edge_list, 01685 DLIList<RefFace*> &target_face_list, 01686 DLIList<Body*> &new_body_list, 01687 CubitBoolean extend_flg = CUBIT_TRUE, 01688 CubitPlane *limit_plane = NULL, 01689 CubitBoolean reverse_flg = CUBIT_FALSE, 01690 CubitBoolean keep_old_body = CUBIT_FALSE, 01691 CubitBoolean preview = CUBIT_FALSE, 01692 double max_area_increase = 0 ); 01693 CubitStatus tweak_target( DLIList<RefEdge*> &ref_edge_list, 01694 CubitPlane &plane, 01695 DLIList<Body*> &new_body_list, 01696 CubitBoolean reverse_flg = CUBIT_FALSE, 01697 CubitBoolean keep_old_body = CUBIT_FALSE, 01698 CubitBoolean preview = CUBIT_FALSE ); 01699 01712 01713 CubitStatus tweak_target( DLIList<RefEdge*> &ref_edge_list, 01714 DLIList<RefEdge*> &target_edge_list, 01715 DLIList<Body*> &new_body_list, 01716 CubitBoolean extend_flg = CUBIT_TRUE, 01717 CubitPlane *limit_plane = NULL, 01718 CubitBoolean reverse_flg = CUBIT_FALSE, 01719 CubitBoolean keep_old_body = CUBIT_FALSE, 01720 CubitBoolean preview = CUBIT_FALSE, 01721 double max_area_increase = 0 ); 01734 01735 CubitStatus tweak_target( RefVertex *ref_vertex_ptr, 01736 DLIList<RefFace*> &modify_ref_face_list, 01737 CubitVector &target_loc, 01738 Body *&new_Body_ptr, 01739 CubitBoolean keep_old_body = CUBIT_FALSE, 01740 CubitBoolean preview = CUBIT_FALSE ); 01741 01744 CubitStatus remove_curve_slivers( DLIList<Body*> &bodies, double lengthlimit ); 01745 01747 CubitStatus create_net_surface( DLIList<Surface*>& ref_face_list, BodySM *& new_body, 01748 DLIList<DLIList<CubitVector*>*> &vec_lists_u, 01749 DLIList<DLIList<CubitVector*>*> &vec_lists_v, 01750 double net_tol = 1e-3, 01751 CubitBoolean heal = CUBIT_TRUE ); 01752 01754 CubitStatus create_net_surface( DLIList<RefEdge*>& u_curves, 01755 DLIList<RefEdge*>& v_curves, 01756 double net_tol = 1e-3, 01757 CubitBoolean heal = CUBIT_TRUE ); 01758 01760 CubitStatus create_offset_surface( RefFace* ref_face_ptr, 01761 double offset_distance ); 01762 01770 01771 CubitStatus create_offset_sheet( DLIList<RefFace*> &ref_face_list, 01772 double offset_distance, 01773 DLIList<RefFace*> *add_ref_face_list_ptr, 01774 DLIList<double> *add_offset_list_ptr, 01775 DLIList<Body*> &new_body_list, 01776 CubitBoolean preview = CUBIT_FALSE ); 01777 01779 CubitStatus create_offset_body( Body *body_ptr, Body *&new_body, 01780 double offset_distance ); 01781 01783 CubitStatus create_skin_surface( DLIList<RefEdge*>& ref_edges, 01784 Body*& new_body, 01785 DLIList<RefEdge*>& guides); 01786 01788 CubitStatus loft_surfaces_to_body(DLIList<RefFace*> &surfaces, 01789 DLIList<double> &takeoff_factor_list, 01790 DLIList<RefFace*> &takeoff_vector_surface_list, 01791 DLIList<CubitVector> &surface_takeoff_vector_list, 01792 DLIList<RefEdge*> &takeoff_vector_curve_list, 01793 DLIList<CubitVector> &curve_takeoff_vector_list, 01794 DLIList<RefEdge*> &guides, 01795 DLIList<RefVertex*> &match_vertices_list, 01796 Body*& new_body, 01797 CubitBoolean global_guides, 01798 CubitBoolean closed, 01799 CubitBoolean show_matching_curves, 01800 CubitBoolean preview 01801 ); 01802 01803 01804 01805 01806 01807 CubitStatus create_surface_curve(DLIList<RefEntity*> curve_entity, 01808 DLIList<RefEntity*> target_entity, 01809 CubitVector sweep_direction = CubitVector (0,0,0), 01810 CubitBoolean distance_flag = CUBIT_FALSE); 01811 01812 Body* create_rectangle_surface( double width, double height, CubitVector plane ); 01813 01814 Body* create_parallelogram_surface( RefVertex *v1, 01815 RefVertex *v2, 01816 RefVertex *v3 ); 01817 01818 Body* create_circle_surface( double radius, CubitVector plane ); 01819 01820 Body* create_circle_surface( RefVertex *v1, 01821 RefVertex *v2, 01822 RefVertex *v3 ); 01823 01824 Body* create_circle_surface( RefVertex *v1, 01825 RefVertex *v2, 01826 CubitVector center_point ); 01827 01828 Body* create_ellipse_surface( RefVertex *v1, 01829 RefVertex *v2, 01830 CubitVector center_point ); 01831 01832 Body* create_ellipse_surface( double major_radius, 01833 double minor_radius, 01834 CubitVector plane ); 01835 01836 CubitStatus idealize_hole_slot_geometry(DLIList<RefEntity*> idealize_entity, 01837 DLIList<RefEntity*> exclude_entity, 01838 double arc_radius, 01839 double slot_arc_radius, 01840 double slot_length, 01841 CubitBoolean preview = CUBIT_FALSE); 01842 01843 CubitStatus idealize_fillet_geometry(DLIList<RefEntity*> idealize_entity, 01844 DLIList<RefEntity*> exclude_entity, 01845 double fillet_rad, 01846 CubitBoolean internal_flg, 01847 CubitBoolean external_flg, 01848 CubitBoolean preview = CUBIT_FALSE); 01849 01850 CubitStatus create_surface_doubler(DLIList<RefEntity*> doubler_entity, 01851 DLIList<RefEntity*> target_entity, 01852 DLIList<Body*> &body_list_out, 01853 CubitBoolean internal_flg = CUBIT_FALSE, 01854 CubitBoolean extend_flg = CUBIT_TRUE, 01855 CubitPlane *limit_plane = NULL, 01856 CubitVector sweep_direction = CubitVector(0,0,0), 01857 CubitBoolean preview = CUBIT_FALSE); 01858 01864 01865 CubitStatus create_surface( DLIList<CubitVector*>& vec_list, 01866 Body *&new_body, 01867 RefFace *ref_face_ptr, 01868 CubitBoolean project_points ); 01869 01870 CubitStatus create_surface( DLIList<RefVertex*> &vert_list, 01871 Body *&new_body, 01872 RefFace *on_surface = NULL); 01873 01874 01876 CubitStatus create_weld_surface( CubitVector &root, 01877 RefFace *ref_face1, 01878 double leg1, 01879 RefFace *ref_face2, 01880 double leg2, 01881 Body *&new_body ); 01882 01888 01889 CubitStatus create_solid_bodies_from_surfs( DLIList<RefFace*> &ref_face_list, 01890 DLIList<Body*> &new_bodies, 01891 CubitBoolean keep_old = CUBIT_FALSE, 01892 CubitBoolean heal = CUBIT_TRUE, 01893 CubitBoolean sheet = CUBIT_FALSE ) const; 01894 01896 CubitStatus surface_intersection( RefFace *ref_face1, 01897 RefFace *ref_face2, 01898 DLIList<RefEdge*> &ref_edge_list ); 01899 01900 RefEdge* create_arc(const CubitVector& position, 01901 double radius, 01902 double start_angle, 01903 double end_angle, 01904 CubitVector plane, 01905 CubitBoolean preview = CUBIT_FALSE); 01906 01907 RefEdge* create_arc_radius( RefVertex* ref_vertex1, 01908 RefVertex* ref_vertex2, 01909 const CubitVector &normal, 01910 double radius, 01911 CubitBoolean other_arc = CUBIT_FALSE , 01912 CubitBoolean full = CUBIT_FALSE, 01913 CubitBoolean preview = CUBIT_FALSE); 01915 RefEdge* create_arc_three( RefVertex* ref_vertex1, 01916 RefVertex* ref_vertex2, 01917 RefVertex* ref_vertex3, 01918 CubitBoolean full = CUBIT_FALSE, 01919 CubitBoolean preview = CUBIT_FALSE ); 01920 01922 RefEdge* create_arc_three( RefEdge* ref_edge1, 01923 RefEdge* ref_edge2, 01924 RefEdge* ref_edge3, 01925 CubitBoolean full = CUBIT_FALSE, 01926 CubitBoolean preview = CUBIT_FALSE ); 01927 01930 01931 RefEdge* create_arc_center_edge( RefVertex* ref_vertex1, 01932 RefVertex* ref_vertex2, 01933 RefVertex* ref_vertex3, 01934 const CubitVector &normal, 01935 double radius = CUBIT_DBL_MAX, 01936 CubitBoolean full = CUBIT_FALSE, 01937 CubitBoolean preview = CUBIT_FALSE ); 01938 01940 CubitStatus create_curve_combine( DLIList<RefEdge*>& ref_edge_list, 01941 RefEdge *&new_ref_edge_ptr ); 01942 01943 01944 CubitStatus create_curve_helix( CubitVector &location, 01945 CubitVector &direction, 01946 CubitVector &start_point, 01947 double &thread_distance, 01948 double &angle, 01949 bool right_handed, 01950 RefEdge *&new_ref_edge_ptr); 01951 01952 01954 static void set_sep_after_webcut_setting(CubitBoolean val) {sepAfterWebcut = val;} 01955 01957 static CubitBoolean get_sep_after_webcut_setting() {return sepAfterWebcut;} 01958 01961 01962 CubitBoolean same_modify_engine(DLIList<TopologyEntity*> &topo_list) const; 01963 01968 01969 01970 CubitBoolean same_modify_engine(DLIList<RefEntity*> &ref_entity_list, 01971 CubitBoolean check_children = CUBIT_FALSE) const; 01972 01973 01976 GeometryModifyEngine* common_modify_engine( DLIList<RefFace*>& faces, 01977 DLIList<RefEdge*>& edges, 01978 DLIList<Surface*>& surfaces, 01979 DLIList<Curve*>& curves, 01980 CubitBoolean allow_composites = CUBIT_FALSE) const; 01981 01982 01983 01984 CubitStatus unmerge_and_return_merge_partners(RefVertex *input_vertex, 01985 DLIList<DLIList<RefVertex*>*> &vert_merge_lists, 01986 DLIList<DLIList<RefEdge*>*> &curve_merge_lists, 01987 DLIList<DLIList<RefFace*>*> &surf_merge_lists); 01988 01990 void add_gme(GeometryModifyEngine *gme_ptr); 01991 01994 CubitStatus remove_gme(GeometryModifyEngine *gme_ptr); 01995 01997 void get_gme_list(DLIList<GeometryModifyEngine*> &gme_list); 01998 02000 GeometryModifyEngine *get_gme() const; 02001 02002 02004 GeometryModifyEngine *get_engine(TopologyBridge *tb_ptr) const; 02005 02007 GeometryModifyEngine *get_engine(TopologyEntity *te_ptr, 02008 TopologyBridge** bridge = 0) const; 02009 02020 02021 CubitStatus get_offset_intersections(RefEdge* ref_edge1, RefEdge* ref_edge2, 02022 DLIList<CubitVector> &intersection_list, 02023 double offset, CubitBoolean ext_first = CUBIT_TRUE ); 02024 02031 02032 CubitStatus get_offset_intersections( RefEdge* ref_edge_ptr, RefFace* ref_face_ptr, 02033 DLIList<CubitVector> &intersection_list, 02034 double offset = 0.0, 02035 CubitBoolean ext_surf = CUBIT_TRUE ); 02036 02038 CubitStatus get_mid_plane( RefFace *ref_face_1, 02039 RefFace *ref_face_2, 02040 Body *body_to_trim_to, 02041 DLIList<RefFace*> &mid_plane_surfs ) const; 02042 02045 CubitStatus get_mid_surface( RefFace *ref_face_1, 02046 RefFace *ref_face_2, 02047 Body *body_to_trim_to, 02048 DLIList<RefFace*> &mid_plane_surfs ) const; 02049 02051 CubitStatus set_default_gme(GeometryModifyEngine* GMEPtr); 02052 02060 GeometryModifyEngine* group_bodies_by_engine( DLIList<Body*>& remaining_bodies, 02061 DLIList<Body*>& engine_bodies, 02062 DLIList<BodySM*>& engine_body_sms ) const; 02063 02064 static CubitStatus prepare_for_copy( RefEntity *ref_ents, 02065 TopologyBridge *&top_bridge ); 02066 02067 static CubitStatus finish_copy( TopologyBridge *&new_bridge, 02068 TopologyBridge *old_bridge ); 02069 02070 static CubitStatus clean_up_from_copy_failure( TopologyBridge *old_bridge ); 02071 02072 bool contains_composites(DLIList<TopologyBridge*>& bridge_list ) const; 02073 bool contains_partitions(DLIList<TopologyBridge*>& bridge_list ) const; 02074 bool contains_partitions( DLIList<Body*>& list ) const; 02075 bool contains_composites( DLIList<Body*>& list ) const; 02076 02077 protected : 02078 02079 GeometryModifyTool(GeometryModifyEngine* GMEPtr); 02083 GeometryModifyEngine* make_RefEdge_common ( RefVertex* start_vertex, 02084 RefVertex* end_vertex, 02085 TBPoint*& start_point, 02086 TBPoint*& end_point, 02087 RefFace* ref_face = 0, 02088 Surface** surface = 0) const; 02089 //- Common code for misc. make_RefEdge functions. 02090 //- Input : start and end vertices and an optional RefFace pointer. 02091 //- Returns: The modify engine to use to create the curve. 02092 //- Output : points in the returned modify engine and if a refface 02093 //- was given, a surface in the modify engine. 02094 //- Determines which engine to use to create the curve and returns 02095 //- TopologyBridges owned by that surface. New Points are created 02096 //- if either the RefVertex already has a parent RefEdge or because 02097 //- a common modify engine could not be found for all the input 02098 //- entities. 02099 02100 CubitStatus okay_to_modify( DLIList<Body*>& bodies, const char* op ) const; 02101 02102 GeometryModifyEngine* common_modify_engine( DLIList<Body*>& bodies, 02103 DLIList<BodySM*>& bodysms ) const; 02104 02105 GeometryModifyEngine* common_modify_engine( DLIList<RefFace*>& faces, 02106 DLIList<Surface*>& surfaces, 02107 CubitBoolean allow_composites = CUBIT_FALSE ) const; 02108 GeometryModifyEngine* common_modify_engine( DLIList<RefEdge*>& edges, 02109 DLIList<Curve*>& curves, 02110 CubitBoolean allow_composites = CUBIT_FALSE ) const; 02111 GeometryModifyEngine* common_modify_engine( DLIList<RefVertex*>& vertices, 02112 DLIList<TBPoint*>& points, 02113 CubitBoolean allow_composites = CUBIT_FALSE ) const; 02114 02115 GeometryModifyEngine* common_modify_engine( DLIList<TopologyEntity*>& topology_list, 02116 DLIList<TopologyBridge*>& engine_bridges, 02117 CubitBoolean allow_composites 02118 = CUBIT_FALSE ) const; 02143 public: 02144 02146 CubitStatus finish_sm_op( DLIList<Body*>& input_bodies, 02147 DLIList<BodySM*>& new_bodies, 02148 DLIList<Body*>& result_bodies, 02149 bool print_info = true ) const; 02150 //- Common code for completion of solid model engine operations 02151 //- on a set of bodies. 02152 //I input_bodies 02153 //I- A list of potentially modified or deleted bodies that were 02154 //I- were passed as input to the solid modeling operation. 02155 //I new_bodies 02156 //I- New bodies created during the solid modeling operation. 02157 //I result_bodies 02158 //I- New Bodys created for the BodySMs in new_bodies. 02159 //I update_input_bodies 02160 //I- Update DAG for non-deleted input_bodies 02161 //I delete_old_first 02162 //I- Clean out all deactivated geometry from input_bodies 02163 //I- before generating any new entities. This has effect 02164 //I- on the resulting topology or IDs, but does affect the 02165 //I- names on new entities. 02166 02167 protected: 02168 02169 GeometryModifyEngine* tweak_setup( DLIList<RefFace*>& input_faces, 02170 const char* tweak_function_name, 02171 DLIList<Body*>& old_bodies_out, 02172 DLIList<Surface*>& surfaces_out, 02173 CubitBoolean allow_composites = CUBIT_FALSE); 02174 02175 GeometryModifyEngine* tweak_setup( DLIList<RefEdge*>& input_edges, 02176 const char* tweak_function_name, 02177 DLIList<Body*>& old_bodies_out, 02178 DLIList<Curve*>& curves_out, 02179 CubitBoolean allow_composites = CUBIT_FALSE ); 02180 02181 GeometryModifyEngine* tweak_setup( DLIList<RefVertex*> &input_vertices, 02182 const char* name, 02183 DLIList<Body*> &output_bodies, 02184 DLIList<TBPoint*> &output_points, 02185 CubitBoolean allow_composites = CUBIT_FALSE ); 02186 02187 CubitStatus sweep_setup ( const char* sweep_function_name, 02188 DLIList<RefEntity*>& entity_list, 02189 DLIList<Body*>& body_list, 02190 GeometryModifyEngine*& engine, 02191 CubitBoolean& changed_new_ids, 02192 DLIList<GeometryEntity*>& geom_list, 02193 bool keep_old, 02194 DLIList<RefEdge*>* edge_list = 0, 02195 DLIList<Curve*>* curve_list = 0 ); 02196 //- Common setup code for sweep functions 02197 //I sweep_function_name 02198 //I- Name to use in error messages. 02199 //I entity_list 02200 //I- Input entity list to be swept 02201 //O body_list 02202 //O- Existing bodies that could potentially be modified. 02203 //O engine 02204 //O- Engine to call sweep_* on. 02205 //O change_new_ids 02206 //O- Save this value and pass into sweep_finish to make sure 02207 //O- state of 'new ids' is restored. 02208 //O geom_list 02209 //O- TopologyBridges to pass to the sweep fuction of the ModifyEngine. 02210 //I edge_list 02211 //I- RefEdges describing sweep path 02212 //O curve_list 02213 //O- Curves corresponding to edges in edge_list. 02214 02215 CubitStatus imprint_singly( DLIList<Body*>& body_list, 02216 DLIList<Body*>& new_bodies, 02217 CubitBoolean keep_old ); 02218 //- Implementation of imprint(..) when group_imprint is false. 02219 02220 void remove_dead_entity_names( RefEntity* entity ) const; 02221 //- If the passed entity or any child entities are dead 02222 //- (have no TopologyBridges), remove entity names. 02223 02224 Body* update_body( Body* body ) const; 02225 //- Destroy or update modified body, as appropriate. 02226 02227 private : 02228 02230 static GeometryModifyTool* instance_; 02231 02233 static CubitBoolean groupImprint; 02234 02236 static CubitBoolean meshAutodelete; 02237 02240 static CubitBoolean meshAutodeleteRemesh; 02241 02243 static CubitBoolean newIds; 02244 02247 static CubitBoolean oldNames; 02248 02251 static CubitBoolean sepAfterWebcut; 02252 02258 static CubitBoolean allEdgesImprint; 02259 02261 static CubitBoolean booleanRegularize; 02262 02264 static CubitBoolean uniteMixedModels; 02265 02269 02270 static RefEntity *copyingEntity; 02271 02273 DLIList<GeometryModifyEngine*> gmeList; 02274 02275 void get_merged_curve_and_surface_ids( DLIList<Body*> &bodies, 02276 DLIList<int> &merged_surface_ids, 02277 DLIList<int> &merged_curve_ids ) const; 02278 02279 CubitStatus match_v1_to_c1(RefVertex *&v1, 02280 RefVertex *&v2, 02281 RefVertex *c1_v1, 02282 RefVertex *c1_v2, 02283 RefVertex *c2_v1, 02284 RefVertex *c2_v2); 02285 02286 CubitStatus find_best_curves_to_merge(DLIList<RefEdge*> *&curves_from_curve1, 02287 DLIList<RefEdge*> *&curves_from_curve2, 02288 RefEdge *&curve1, 02289 RefEdge *&curve2); 02290 02291 CubitStatus unmerge_and_return_merge_partners(RefEdge *input_curve, 02292 DLIList<DLIList<RefEdge*>*> &curve_merge_lists, 02293 DLIList<DLIList<RefFace*>*> &surf_merge_lists); 02294 02295 CubitStatus unmerge_input(RefEdge *curve1, 02296 RefEdge *curve2, 02297 DLIList<DLIList<RefEdge*>*> &curve_merge_lists, 02298 DLIList<DLIList<RefFace*>*> &surf_merge_lists); 02299 02300 CubitStatus calculate_split_points_for_merge(RefEdge* c1, 02301 RefEdge* c2, 02302 DLIList<RefVertex*> &verts_to_merge, 02303 double *merge_tolerance, 02304 DLIList<CubitVector> &merge_end_points_on_curve1, 02305 DLIList<CubitVector> &merge_end_points_on_curve2, 02306 DLIList<CubitBoolean> &split_flags_for_curve1, 02307 DLIList<CubitBoolean> &split_flags_for_curve2, 02308 double divergence_angle); 02309 CubitStatus find_overlap_region(RefEdge *c1, 02310 RefEdge *c2, 02311 RefVertex *v1, 02312 RefVertex *v2, 02313 bool forward_c1, 02314 bool forward_c2, 02315 bool &full_c1, 02316 bool &full_c2, 02317 double &c1_stop_param, 02318 double &c2_stop_param, 02319 double divergence_angle); 02320 CubitStatus separate_body_after_webcut (DLIList<Body*> &input_list, 02321 DLIList<Body*> &output_list) const; 02327 void fixup_merged_entities( DLIList<int> &merged_surface_ids, 02328 DLIList<int> &merged_curve_ids ) const; 02329 02330 bool contains_intermediate_geom(DLIList<Body*>& list) const; 02331 bool contains_intermediate_geom(DLIList<TopologyBridge*>& list) const; 02332 02333 void do_attribute_setup(void); 02334 void do_attribute_cleanup(void); 02335 void push_attributes_before_modify(DLIList<BodySM*> &old_sms); 02336 CubitStatus restore_vg_after_modify(DLIList<BodySM*> &new_sms, 02337 DLIList<Body*> &old_bodies, 02338 GeometryModifyEngine *gme); 02339 void remove_pushed_attributes(DLIList<BodySM*> &new_sms, 02340 DLIList<Body*> &old_bodies); 02341 void push_imprint_attributes_before_modify(DLIList<BodySM*> &old_sms); 02342 void push_named_attributes_to_curves_and_points(DLIList<TopologyBridge*> &tb_list, const char *name_in); 02343 void remove_imprint_attributes_after_modify(DLIList<BodySM*> &body_sms, 02344 DLIList<BodySM*> &new_sms); 02345 02347 static void plane_preview(DLIList<Body*> &body_list, 02348 const CubitVector &pt1, 02349 const CubitVector &pt2, 02350 const CubitVector &pt3); 02351 02352 void propagate_from_small_edge( RefEdge *edge, 02353 DLIList<RefEdge*> &small_edges, 02354 DLIList<RefFace*> &narrow_faces, 02355 DLIList<RefFace*> &processed_faces, 02356 double small_edge_length); 02357 void propagate_over_narrow_face( RefFace *narrow_face, 02358 RefEdge *edge, 02359 DLIList<RefFace*> &processed_faces, 02360 DLIList<RefEdge*> &small_edges, 02361 DLIList<RefFace*> &narrow_faces, 02362 double small_edge_length); 02363 02364 void propagate_merge_tolerance(DLIList<Body*> &body_list); 02365 void push_tolerance_attribute(DLIList<Body*> &body_list); 02366 02367 CubitStatus prepare_bc_for_webcut(); 02368 CubitStatus finish_bc_webcut(); 02369 02370 CubitStatus sweep_finish( const char* const sweep_function_name, 02371 DLIList<Body*>& input_body_list, 02372 DLIList<BodySM*>& new_body_list, 02373 DLIList<Body*>& output_body_list, 02374 CubitBoolean restore_newids ); 02375 //- Common cleanup code for sweep functions 02376 //I sweep_function_name 02377 //I- Name to use in error messages. 02378 //I input_body_list 02379 //I- Bodies that may need to be updated. 02380 //I new_body_list 02381 //I- SMbodies returned by GeometryModifyEngine 02382 //I output_body_list 02383 //I- ref_bodies returned by GeometryModifyEngine 02384 //I restore_newids 02385 //I- Passed back from sweep_setup -- restore setting state. 02386 02387 CubitStatus finish_webcut( DLIList<Body*>& input_bodies, 02388 DLIList<BodySM*>& webcut_results, 02389 CubitBoolean merge, 02390 CubitStatus webcut_status, 02391 DLIList<Body*>& new_bodies, 02392 DLIList<int> *merged_surface_ids = NULL, 02393 DLIList<int> *merged_curve_ids = NULL, 02394 CubitBoolean print_info = CUBIT_TRUE ) const; 02395 //- Helper function for all webcut functions. 02396 //- Finish up DAG update, merging, etc. after GME does webcut. 02397 //I input_bodies 02398 //I- The list of bodies that were webcut 02399 //I webcut_results 02400 //I- The new bodies returned by the GME webcut. 02401 //I merge 02402 //I- Merge after webcut 02403 //I webcut_status 02404 //I- The return value from the GME webcut function 02405 //O new_bodies 02406 //O- The new Bodies constructed from the passed BodySMs. 02407 //R CubitStatus 02408 //R- CUBIT_FAILURE on error, webcut_status on success. 02409 //- Does separate_body_after_webcut for all bodies if 02410 //- webcut_status == CUBIT_SUCCESS 02411 //- Merges bodies if webcut_status == CUBIT_SUCCESS AND merge == CUBIT_TRUE 02412 02413 CubitStatus tweak_remove( DLIList<RefFace*> &ref_face_list, 02414 DLIList<Body*> &new_body_list, 02415 CubitBoolean extend_adjoining = CUBIT_TRUE, 02416 CubitBoolean keep_surface = CUBIT_FALSE, 02417 CubitBoolean keep_old_body = CUBIT_FALSE, 02418 CubitBoolean preview = CUBIT_FALSE); 02424 void get_neighboring_bodies( DLIList<Body*> &input_bodies, 02425 DLIList<Body*> &neighboring_bodies ); 02426 02427 02428 CubitStatus unite_separately( GeometryModifyEngine *gme_ptr, 02429 DLIList<Body*> &body_list, 02430 DLIList<Body*> &new_body_list, 02431 bool keep_old ); 02432 CubitStatus unite_all( GeometryModifyEngine *gme_ptr, 02433 DLIList<Body*> &body_list, 02434 DLIList<Body*> &new_body_list, 02435 bool keep_old ); 02442 CubitStatus unite_private( GeometryModifyEngine *gme_ptr, 02443 DLIList<Body*> &body_list, 02444 DLIList<Body*> &new_body_list, 02445 bool keep_old ); 02449 GeometryModifyEngine * pull_common_surfs( DLIList<RefFace*> &ref_face_list, 02450 DLIList<RefFace*> &common_face_list, 02451 DLIList<Surface*> &common_surf_list ); 02459 void remove_bodies_outside_bounding_box( DLIList<Body*> &body_list, CubitVector v1, CubitVector v2, CubitVector v3 ); 02460 void remove_bodies_outside_bounding_box( DLIList<Body*> &body_list, CubitBox &tool_bounding_box ); 02461 CubitVector FindExtendedEndPt( double outer_rad , double inner_rad , CubitVector inner_AxisPt , 02462 CubitVector Axis , double Height ); 02463 02464 CubitVector FindExtendedStartPt( CubitBox box , double outer_rad , double inner_rad , CubitVector inner_AxisPt , 02465 CubitVector Axis , double &Height , double dTanAngle , double &dExtendedadius ); 02466 02467 void FindExtendedPoints( CubitVector AxisPt1 , CubitVector AxisPt2 , double outer_radius , double inner_radius , 02468 CubitVector axis,double Height , CubitBox bounding_box , double dTanAngle , CubitVector& start , 02469 CubitVector& end , double& dExtended_OuterRadius, double& dExtended_InnerRadius ); 02470 02471 void preview_align( CubitVector translation_to_origin, 02472 CubitVector origin_to_target, 02473 double angle_of_rotation, 02474 CubitVector axis_of_rotation, 02475 DLIList<RefEntity*> &entities ); 02476 02477 static CubitStatus create_old_to_new_ref_ent_map( 02478 TopologyBridge *old_top_level_bridge, 02479 TopologyBridge *new_top_level_bridge, 02480 std::map< RefEntity*, RefEntity* > &old_to_new_map, 02481 std::map< TopologyBridge*, TopologyBridge*> &old_tb_to_new_tb ); 02482 02483 }; 02484 02485 inline void GeometryModifyTool::set_all_edges_imprint( CubitBoolean flag ) 02486 {allEdgesImprint = flag;} 02487 inline CubitBoolean GeometryModifyTool::get_all_edges_imprint() 02488 {return allEdgesImprint;} 02489 02490 inline CubitBoolean GeometryModifyTool::boolean_regularize() 02491 {return booleanRegularize;} 02492 inline void GeometryModifyTool::boolean_regularize(CubitBoolean flag) 02493 {booleanRegularize = flag;} 02494 02495 inline CubitBoolean GeometryModifyTool::unite_mixed_models() 02496 {return uniteMixedModels;} 02497 inline void GeometryModifyTool::unite_mixed_models(CubitBoolean flag) 02498 {uniteMixedModels = flag;} 02499 02500 inline void GeometryModifyTool::add_gme(GeometryModifyEngine *gme_ptr) 02501 { 02502 assert(gme_ptr != 0); 02503 if (!gmeList.move_to(gme_ptr)) gmeList.append(gme_ptr); 02504 } 02508 inline void GeometryModifyTool::get_gme_list(DLIList<GeometryModifyEngine*> &gme_list) 02509 { 02510 gme_list += gmeList; 02511 } 02515 inline GeometryModifyEngine *GeometryModifyTool::get_gme() const 02516 { 02517 GeometryModifyEngine *gme = NULL; 02518 if (gmeList.size()) { 02519 const_cast<GeometryModifyTool*>(this)->gmeList.reset(); 02520 gme = gmeList.get(); 02521 } 02522 return gme; 02523 } 02524 02525 #endif 02526