cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : BridgeManager.hpp 00003 // 00004 // Purpose : Manages the TopologyBridges being used by 00005 // a single TopologyEntity. Encapsulates the 00006 // merging/unmerging of TopologyBridges into/from 00007 // a TopologyEntity. 00008 // 00009 // Creator : Darryl Melander 00010 // 00011 // Creation Date : 02/20/99 00012 // 00013 // Owner : Darryl Melander 00014 //------------------------------------------------------------------------- 00015 #ifndef BRIDGE_MANAGER_HPP 00016 #define BRIDGE_MANAGER_HPP 00017 00018 #include "CubitDefines.h" 00019 #include "DLIList.hpp" 00020 #include "TBOwner.hpp" 00021 #include "TopologyBridge.hpp" 00022 00023 #include <vector> 00024 00025 class TopologyEntity; 00026 class GeometryQueryEngine; 00027 00028 class CUBIT_GEOM_EXPORT BridgeManager : public TBOwner 00029 { 00030 public: 00031 // Constructor/Destructor 00032 BridgeManager(); 00033 virtual ~BridgeManager(); 00034 00035 void set_entity(TopologyEntity* ent); 00036 00037 // Bridge Management Functions 00038 virtual CubitStatus add_bridge(TopologyBridge* bridge); 00039 CubitStatus add_bridge_as_representation(TopologyBridge* bridge); 00040 virtual CubitStatus remove_bridge(TopologyBridge* bridge ); 00041 virtual CubitStatus bridge_destroyed( TopologyBridge* bridge ); 00042 CubitStatus remove_all_bridges(); 00043 CubitStatus merge (BridgeManager* dead_manager, 00044 CubitSense relative_sense ); 00045 virtual CubitStatus swap_bridge( TopologyBridge* old_tb, 00046 TopologyBridge* new_tb, 00047 bool reversed ); 00048 00049 // Bridge Query Functions 00050 virtual CubitBoolean contains_bridge(TopologyBridge* bridge) const; 00051 int get_bridge_list(DLIList<TopologyBridge*>& bridge_list) const; 00052 TopologyBridge* topology_bridge() const 00053 { 00054 if(!mergeList.empty()) 00055 return *(mergeList.begin()); 00056 else 00057 return 0; 00058 } 00059 00060 //Bridge Query Functions, querying for bridges owned by 00061 //a particular GeometryQueryEngine. 00062 int get_bridge_list(DLIList<TopologyBridge*>& bridge_list, 00063 GeometryQueryEngine* gme_ptr ) const; 00064 TopologyBridge* topology_bridge( GeometryQueryEngine* gme_ptr ) const; 00065 int number_of_bridges() const; 00066 00067 // TE Query Function (Can't change TE after creation) 00068 TopologyEntity* topology_entity() const 00069 {return topologyEntity;} 00070 00071 void reverse_bridge_senses(); 00072 // Switch the relative sense of all TopologyBridges. 00073 // If update_first is true, change the principal bridge 00074 // to be one that has a forward relative sense, if there 00075 // is one. 00076 00077 virtual void notify_reversed( TopologyBridge* bridge ); 00078 00079 private: 00080 00081 TopologyEntity* topologyEntity; 00082 std::vector<TopologyBridge*> mergeList; 00083 }; 00084 00085 #endif 00086