| 1 | //------------------------------------------------------------------------- |
|---|
| 2 | // Filename : BridgeManager.hpp |
|---|
| 3 | // |
|---|
| 4 | // Purpose : Manages the TopologyBridges being used by |
|---|
| 5 | // a single TopologyEntity. Encapsulates the |
|---|
| 6 | // merging/unmerging of TopologyBridges into/from |
|---|
| 7 | // a TopologyEntity. |
|---|
| 8 | // |
|---|
| 9 | // Creator : Darryl Melander |
|---|
| 10 | // |
|---|
| 11 | // Creation Date : 02/20/99 |
|---|
| 12 | // |
|---|
| 13 | // Owner : Darryl Melander |
|---|
| 14 | //------------------------------------------------------------------------- |
|---|
| 15 | #ifndef BRIDGE_MANAGER_HPP |
|---|
| 16 | #define BRIDGE_MANAGER_HPP |
|---|
| 17 | |
|---|
| 18 | #include "CubitDefines.h" |
|---|
| 19 | #include "DLIList.hpp" |
|---|
| 20 | #include "TBOwner.hpp" |
|---|
| 21 | #include "TopologyBridge.hpp" |
|---|
| 22 | |
|---|
| 23 | #include <vector> |
|---|
| 24 | |
|---|
| 25 | class TopologyEntity; |
|---|
| 26 | class GeometryQueryEngine; |
|---|
| 27 | |
|---|
| 28 | class CUBIT_GEOM_EXPORT BridgeManager : public TBOwner |
|---|
| 29 | { |
|---|
| 30 | public: |
|---|
| 31 | // Constructor/Destructor |
|---|
| 32 | BridgeManager(TopologyEntity* owner); |
|---|
| 33 | virtual ~BridgeManager(); |
|---|
| 34 | |
|---|
| 35 | // Bridge Management Functions |
|---|
| 36 | virtual CubitStatus add_bridge(TopologyBridge* bridge); |
|---|
| 37 | CubitStatus add_bridge_as_representation(TopologyBridge* bridge); |
|---|
| 38 | virtual CubitStatus remove_bridge(TopologyBridge* bridge ); |
|---|
| 39 | virtual CubitStatus bridge_destroyed( TopologyBridge* bridge ); |
|---|
| 40 | CubitStatus remove_all_bridges(); |
|---|
| 41 | CubitStatus merge (BridgeManager* dead_manager, |
|---|
| 42 | CubitSense relative_sense ); |
|---|
| 43 | virtual CubitStatus swap_bridge( TopologyBridge* old_tb, |
|---|
| 44 | TopologyBridge* new_tb, |
|---|
| 45 | bool reversed ); |
|---|
| 46 | |
|---|
| 47 | // Bridge Query Functions |
|---|
| 48 | virtual CubitBoolean contains_bridge(TopologyBridge* bridge) const; |
|---|
| 49 | int get_bridge_list(DLIList<TopologyBridge*>& bridge_list) const; |
|---|
| 50 | TopologyBridge* topology_bridge() const |
|---|
| 51 | { |
|---|
| 52 | if(!mergeList.empty()) |
|---|
| 53 | return *(mergeList.begin()); |
|---|
| 54 | else |
|---|
| 55 | return 0; |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | //Bridge Query Functions, querying for bridges owned by |
|---|
| 59 | //a particular GeometryQueryEngine. |
|---|
| 60 | int get_bridge_list(DLIList<TopologyBridge*>& bridge_list, |
|---|
| 61 | GeometryQueryEngine* gme_ptr ) const; |
|---|
| 62 | TopologyBridge* topology_bridge( GeometryQueryEngine* gme_ptr ) const; |
|---|
| 63 | int number_of_bridges() const; |
|---|
| 64 | |
|---|
| 65 | // TE Query Function (Can't change TE after creation) |
|---|
| 66 | TopologyEntity* topology_entity() const |
|---|
| 67 | {return topologyEntity;} |
|---|
| 68 | |
|---|
| 69 | void reverse_bridge_senses(); |
|---|
| 70 | // Switch the relative sense of all TopologyBridges. |
|---|
| 71 | // If update_first is true, change the principal bridge |
|---|
| 72 | // to be one that has a forward relative sense, if there |
|---|
| 73 | // is one. |
|---|
| 74 | |
|---|
| 75 | virtual void notify_reversed( TopologyBridge* bridge ); |
|---|
| 76 | |
|---|
| 77 | private: |
|---|
| 78 | |
|---|
| 79 | TopologyEntity* const topologyEntity; |
|---|
| 80 | std::vector<TopologyBridge*> mergeList; |
|---|
| 81 | }; |
|---|
| 82 | |
|---|
| 83 | #endif |
|---|