cgma
|
#include <BridgeManager.hpp>
Definition at line 28 of file BridgeManager.hpp.
Definition at line 23 of file BridgeManager.cpp.
: topologyEntity(NULL) { }
BridgeManager::~BridgeManager | ( | ) | [virtual] |
Definition at line 29 of file BridgeManager.cpp.
CubitStatus BridgeManager::add_bridge | ( | TopologyBridge * | bridge | ) | [virtual] |
Definition at line 49 of file BridgeManager.cpp.
{ if( !bridge || bridge->owner() ) { assert( bridge && !bridge->owner() ); return CUBIT_FAILURE; } mergeList.push_back(bridge); bridge->owner(this); return CUBIT_SUCCESS; }
Definition at line 64 of file BridgeManager.cpp.
{ // Make sure bridge isn't already owned by someone else if( !bridge || bridge->owner() ) { assert( bridge && !bridge->owner() ); return CUBIT_FAILURE; } // Add the bridge to the beginning of the list mergeList.insert(mergeList.begin(), bridge ); bridge->owner(this); return CUBIT_SUCCESS; }
CubitStatus BridgeManager::bridge_destroyed | ( | TopologyBridge * | bridge | ) | [virtual] |
Reimplemented from TBOwner.
Definition at line 95 of file BridgeManager.cpp.
{ // if( firstBridge == bridge && // bridge->next_bridge() && // bridge->next_bridge()->bridge_sense() != bridge->bridge_sense() ) // topologyEntity->reverse_topology(); return remove_bridge( bridge ); }
CubitBoolean BridgeManager::contains_bridge | ( | TopologyBridge * | bridge | ) | const [virtual] |
Reimplemented from TBOwner.
Definition at line 154 of file BridgeManager.cpp.
int BridgeManager::get_bridge_list | ( | DLIList< TopologyBridge * > & | bridge_list | ) | const |
int BridgeManager::get_bridge_list | ( | DLIList< TopologyBridge * > & | bridge_list, |
GeometryQueryEngine * | gme_ptr | ||
) | const |
Definition at line 176 of file BridgeManager.cpp.
{ std::vector<TopologyBridge*>::const_iterator iter; for (iter=mergeList.begin(); iter!=mergeList.end(); iter++) { if ( (*iter)->get_geometry_query_engine() == gqe_ptr ) bridge_list.append(*iter); } return bridge_list.size(); // TODO - BWH - return on this function should be consistent with other bridge list function }
CubitStatus BridgeManager::merge | ( | BridgeManager * | dead_manager, |
CubitSense | relative_sense | ||
) |
Definition at line 127 of file BridgeManager.cpp.
{ if (dead_manager->mergeList.empty()) return CUBIT_SUCCESS; // Remove bridge list from dead BridgeManager std::vector<TopologyBridge*> dead_list = dead_manager->mergeList; dead_manager->mergeList.clear(); // Set owner and reverse sense if necessary // for all bridges in merge list. std::vector<TopologyBridge*>::iterator iter; for (iter = dead_list.begin(); iter != dead_list.end(); iter++) { (*iter)->owner(this); if( relative_sense == CUBIT_REVERSED ) (*iter)->reverse_bridge_sense(); } // append merge list to end of this manager's bridge list mergeList.insert(mergeList.end(), dead_list.begin(), dead_list.end()); return CUBIT_SUCCESS; }
void BridgeManager::notify_reversed | ( | TopologyBridge * | bridge | ) | [virtual] |
Implements TBOwner.
Definition at line 260 of file BridgeManager.cpp.
{ bridge->reverse_bridge_sense(); }
int BridgeManager::number_of_bridges | ( | ) | const |
Definition at line 255 of file BridgeManager.cpp.
{ return mergeList.size(); }
Definition at line 105 of file BridgeManager.cpp.
{ if (mergeList.empty()) return CUBIT_SUCCESS; std::vector<TopologyBridge*>::iterator iter; std::vector<TopologyBridge*> temp_list; // make a copy of the list so we can modify the real one temp_list = mergeList; for (iter=temp_list.begin(); iter!=temp_list.end(); iter++) { if (!remove_bridge( *iter )) break; } return mergeList.empty() ? CUBIT_SUCCESS : CUBIT_FAILURE; }
CubitStatus BridgeManager::remove_bridge | ( | TopologyBridge * | bridge | ) | [virtual] |
Implements TBOwner.
Definition at line 82 of file BridgeManager.cpp.
{ std::vector<TopologyBridge*>::iterator iter; iter = std::find(mergeList.begin(), mergeList.end(), bridge); if (iter != mergeList.end()) mergeList.erase(iter); else return CUBIT_FAILURE; bridge->owner(0); return CUBIT_SUCCESS; }
void BridgeManager::reverse_bridge_senses | ( | ) |
Definition at line 204 of file BridgeManager.cpp.
void BridgeManager::set_entity | ( | TopologyEntity * | ent | ) |
Definition at line 39 of file BridgeManager.cpp.
{ topologyEntity = ent; }
CubitStatus BridgeManager::swap_bridge | ( | TopologyBridge * | old_tb, |
TopologyBridge * | new_tb, | ||
bool | reversed | ||
) | [virtual] |
Implements TBOwner.
Definition at line 213 of file BridgeManager.cpp.
{ // make sure new_tb isn't already owned by someone else if( new_tb->owner() != NULL ) { assert( new_tb->owner() == 0 ); return CUBIT_FAILURE; } // Replace old bridge with new bridge at same location // in linked list. std::vector<TopologyBridge*>::iterator iter; iter = std::find(mergeList.begin(), mergeList.end(), old_tb); if (iter != mergeList.end()) { iter = mergeList.erase(iter); mergeList.insert(iter, new_tb); } else { assert(false); return CUBIT_FAILURE; } // Update owner pointers new_tb->owner(this); old_tb->owner(0); // If 'reversed == true' then make sure bridges have // opposite sense. bool same_sense = new_tb->bridge_sense() == old_tb->bridge_sense(); if (reversed == same_sense) // if (reversed XOR same_sense) new_tb->reverse_bridge_sense(); return CUBIT_SUCCESS; }
TopologyBridge* BridgeManager::topology_bridge | ( | ) | const [inline] |
Definition at line 52 of file BridgeManager.hpp.
TopologyBridge * BridgeManager::topology_bridge | ( | GeometryQueryEngine * | gme_ptr | ) | const |
Definition at line 190 of file BridgeManager.cpp.
TopologyEntity* BridgeManager::topology_entity | ( | ) | const [inline] |
Definition at line 68 of file BridgeManager.hpp.
{return topologyEntity;}
std::vector<TopologyBridge*> BridgeManager::mergeList [private] |
Definition at line 82 of file BridgeManager.hpp.
TopologyEntity* BridgeManager::topologyEntity [private] |
Definition at line 81 of file BridgeManager.hpp.