cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : MergeToolAssistant.hpp 00003 // 00004 // Purpose : Abstract class defining methods for doing other 00005 // other operations as a part of merging, for example 00006 // handling mesh. 00007 // 00008 // Special Notes : Creating an instance of this class automagically 00009 // registers it with MergeTool. Similarly destroying 00010 // the instance will unregister it, and destroying 00011 // the MergeTool instance will destroy all registered 00012 // MergeToolAssistants. 00013 // 00014 // Creator : Jason Kraftcheck 00015 // 00016 // Creation Date : 04/26/01 00017 //------------------------------------------------------------------------- 00018 00019 #ifndef MERGE_TOOL_ASSISTANT_HPP 00020 #define MERGE_TOOL_ASSISTANT_HPP 00021 00022 #include "CubitDefines.h" 00023 #include "CubitString.hpp" 00024 #include "CGMGeomConfigure.h" 00025 00026 class RefEntity; 00027 class RefFace; 00028 class RefEdge; 00029 class RefVertex; 00030 00031 class CUBIT_GEOM_EXPORT MergeToolAssistant 00032 { 00033 00034 public: 00035 00036 MergeToolAssistant(); 00037 //- Constructor 00038 //- Registers this assistant with MergeTool. 00039 00040 00041 virtual ~MergeToolAssistant(); 00042 //- Destructor 00043 //- Unregister this assistant with MergeTool. 00044 00045 00046 virtual CubitString class_identifier() = 0; 00047 //- Return a CubitString for MergeTool to use in error messages. 00048 00049 virtual CubitBoolean 00050 can_merge( RefFace* keep_face_ptr, RefFace* dead_face_ptr ) = 0; 00051 //- Allow MergeToolAssistant to abort the merge. The 00052 //- implementation of MergeToolAssistant is expected 00053 //- to check the mergeability of all child RefEdges and 00054 //- RefVertices as well. The merge partner for each 00055 //- child entity can be determined by calling 00056 //- RefEntity::get_compare_partner(). If get_compare_partner() 00057 //- returns NULL, this should indicate that the child entities 00058 //- are already merged. 00059 00060 virtual CubitBoolean 00061 can_merge( RefEdge* keep_edge_ptr, RefEdge* dead_edge_ptr ) = 0; 00062 //- Allow MergeToolAssistant to abort the merge. The 00063 //- implementation of MergeToolAssistant is expected 00064 //- to check the mergeability of all child RefVertices. 00065 //- The merge partner for each child entity can be determined 00066 //- by calling RefEntity::get_compare_partner(). If 00067 //- get_compare_partner() returns NULL, this should indicate 00068 //- that the child entities are already merged. 00069 00070 virtual CubitBoolean 00071 can_merge( RefVertex* keep_vtx_ptr, RefVertex* dead_vtx_ptr ) = 0; 00072 //- Allow MergeToolAssistant to abort the merge. 00073 00074 virtual void 00075 merging( RefEntity* keep_entity_ptr, 00076 RefEntity* dead_entity_ptr, 00077 CubitBoolean opposite_sense ) = 0; 00078 //- This method is called to notify an assistant of a merge in 00079 //- progress. This method is called for each RefEntity merged. 00080 //- For example when merging two RefEdges, this method will 00081 //- first be called for each RefVertex as it is merged, and 00082 //- then for the RefEdge. This method is called after all 00083 //- child entities have been merged, but just prior to merging 00084 //- the passed entites. For example if two RefFaces are being 00085 //- merged, when this method is called for those RefFaces, all 00086 //- child RefEdges, CoEdges and Loops have already been merged. 00087 //- The RefFaces will SHARE A COMMON SET OF LOOPS. 00088 00089 virtual void 00090 unmerged( RefEntity* old_entity_ptr, 00091 RefEntity* new_entity_ptr, 00092 CubitBoolean reversed ) = 0; 00093 //I old_entity_ptr 00094 //I- A pointer to the RefEntity that existed prior to the unmerge. 00095 //I new_entity_ptr 00096 //I- A pointer to the new RefEntity created as a 00097 //I- GeometryEntity was split off of old_entity_ptr. 00098 //I old_sense_switched 00099 //I- True of the geometric sense of the old entity was changed 00100 //I- as a part of the unmerge. 00101 //I new_sense_switched 00102 //I- True if the geometric sense of the old entity was not changed 00103 //I- and the new entity has the opposite sense of the old. 00104 //- Notifies MergeToolAssistant that an unmerge has occured. 00105 //- This method will be called for all unmerged RefEntities. For 00106 //- example, when a RefEdge is unmerged, the method will first be 00107 //- called for the RefEdge while the child vertices are still 00108 //- merged. It will then be called for the child RefVertices 00109 //- if/when they are unmerged. 00110 00111 virtual void finish_merge() = 0; 00112 //- Let assisitant know that merge operation is completed 00113 //- in case any temporary data neds to be cleaned up. 00114 00115 virtual void finish_unmerge() = 0; 00116 //- Final call to clean up any data. Called just before 00117 //- MergeTool returns control to its caller. 00118 00119 }; 00120 00121 #endif 00122