cgma
|
00001 //--------------------------------------------------------------------------- 00002 //- Filename: CollapseAngleTool 00003 //- Purpose: To collapse small angle for preparing for mesh 00004 //- 00005 //- Creator: Jiangtao Hu 00006 //- Creation date: 02/09/2005 00007 //---------------------------------------------------------------------------- 00008 00009 #ifndef COLLAPSEANGLETOOL_HPP 00010 #define COLLAPSEANGLETOOL_HPP 00011 00012 #include "DLIList.hpp" 00013 class RefVertex; 00014 class RefEdge; 00015 class RefFace; 00016 class CubitVector; 00017 template<class X> class DLIList; 00018 00019 class CollapseAngleTool 00020 { 00021 public: 00022 static CollapseAngleTool *instance(); 00023 // return a static instance pointer 00024 00025 CubitStatus auto_collapse (double length, 00026 double angle, 00027 CubitBoolean preview, 00028 CubitBoolean if_comp_vertex, 00029 double max_angle); 00030 00031 void collapse_one_angle(RefVertex *vex_ptr, 00032 RefEdge *edge_to_remove, 00033 RefEdge *the_other_edge, 00034 double length1, 00035 double length2, 00036 CubitBoolean get_position, 00037 CubitVector &position, 00038 CubitBoolean preview, 00039 CubitBoolean if_comp_vertex, 00040 double angle); 00041 00042 private: 00043 CollapseAngleTool(); 00044 // Constructor 00045 00046 ~CollapseAngleTool(); 00047 // Destructor 00048 00049 static CollapseAngleTool *instance_; 00050 // the static instance pointer 00051 00052 DLIList <RefEdge *> partly_drawn_curve; 00053 CubitStatus partition_curve(RefEdge *&edge, 00054 RefVertex *root_vertex, 00055 CubitVector &position, 00056 RefVertex *&new_vertex); 00057 00058 CubitBoolean if_partition_surf(RefVertex *vex_ptr, 00059 RefEdge *edge_to_remove, 00060 RefFace *common_face); 00061 00062 CubitStatus partition_curve(RefEdge *&edge, 00063 RefVertex *root_vertex, 00064 double arc_length, 00065 RefVertex *&new_vertex); 00066 00067 CubitStatus partition_surface(RefFace *common_face, 00068 RefEdge *& edge, 00069 RefVertex * root, 00070 RefVertex *vertex1, 00071 RefVertex *veretx2, 00072 RefFace *&result_face); 00073 00074 CubitStatus collapse_angle(RefVertex *vex_ptr, 00075 RefEdge *edge_to_remove, 00076 RefEdge *the_other_edge, 00077 double length1, 00078 double length2, 00079 CubitBoolean get_position, 00080 CubitVector &position); 00081 00082 CubitStatus draw_preview(RefVertex *vex_ptr, 00083 RefEdge *edge_to_remove, 00084 RefEdge *the_other_edge, 00085 double length1, 00086 double length2, 00087 CubitBoolean get_position, 00088 CubitVector &position); 00089 00090 void exchange_edges(RefEdge *&edge, 00091 RefEdge *&the_other_edge); 00092 00093 double the_surface_angle(RefEdge *edge, 00094 RefVertex *root_vertex, 00095 double length); 00096 00097 CubitStatus position_from_length(RefEdge *edge, 00098 RefVertex *root_vertex, 00099 double arc_length, 00100 CubitVector& v_new); 00101 }; 00102 00103 #endif 00104