cgma
|
#include <TopologyEntity.hpp>
Definition at line 56 of file TopologyEntity.hpp.
Definition at line 100 of file TopologyEntity.cpp.
: deactivatedStatus_(CUBIT_FALSE), encountered_(CUBIT_FALSE), bridgeMan() { bridgeMan.set_entity(this); }
TopologyEntity::~TopologyEntity | ( | ) | [virtual] |
Definition at line 118 of file TopologyEntity.cpp.
{ // Make sure that the TopologyEntity class does not have a pointer to this // TopologyEntity in its list. If it does, then remove the instances // of the pointer DAG::instance()->remove(this); }
TopologyEntity::TopologyEntity | ( | const TopologyEntity & | ) | [private] |
CubitStatus TopologyEntity::bodies | ( | DLIList< Body * > & | body_list | ) |
Body * TopologyEntity::body | ( | ) |
Definition at line 185 of file TopologyEntity.cpp.
{ DLIList<Body*> these_bodies; this->bodies(these_bodies); if (these_bodies.size() > 0) return these_bodies.get(); else return NULL; }
const BridgeManager* TopologyEntity::bridge_manager | ( | ) | const [inline] |
Definition at line 128 of file TopologyEntity.hpp.
{ return &bridgeMan; }
BridgeManager* TopologyEntity::bridge_manager | ( | ) | [inline] |
Definition at line 130 of file TopologyEntity.hpp.
{ return &bridgeMan; }
CubitStatus TopologyEntity::chains | ( | DLIList< Chain * > & | chain_list | ) |
virtual const char* TopologyEntity::class_name | ( | ) | const [inline, virtual] |
Reimplemented in RefFace, BasicTopologyEntity, RefVolume, Body, RefEdge, and RefVertex.
Definition at line 70 of file TopologyEntity.hpp.
{ return get_class_name(); }
Definition at line 194 of file TopologyEntity.cpp.
{ DLIList<CoEdge*> these_co_edges; co_edges(these_co_edges); if (these_co_edges.size() > 0) return these_co_edges.get(); else return NULL; }
CubitStatus TopologyEntity::co_edges | ( | DLIList< CoEdge * > & | co_edge_list | ) |
CubitStatus TopologyEntity::co_faces | ( | DLIList< CoFace * > & | co_face_list | ) |
CubitStatus TopologyEntity::co_vertices | ( | DLIList< CoVertex * > & | co_vertex_list | ) |
CubitStatus TopologyEntity::co_volumes | ( | DLIList< CoVolume * > & | co_volume_list | ) |
virtual DagType TopologyEntity::dag_type | ( | ) | const [pure virtual] |
void TopologyEntity::deactivated | ( | CubitBoolean | flag | ) |
Definition at line 386 of file TopologyEntity.cpp.
{ if (deactivatedStatus_ != flag) { deactivatedStatus_ = flag ; if (flag == CUBIT_TRUE) { DAG::instance()->add_deactivated_DAG_node(this) ; } else { DAG::instance()->remove_deactivated_DAG_node(this) ; } } }
CubitBoolean TopologyEntity::deactivated | ( | ) | const |
Definition at line 402 of file TopologyEntity.cpp.
{ return (CubitBoolean)deactivatedStatus_ ; }
virtual CubitStatus TopologyEntity::disconnect_all_children | ( | DLIList< TopologyEntity * > * | children = 0 | ) | [pure virtual] |
Implemented in BasicTopologyEntity, GroupingEntity, and SenseEntity.
virtual CubitStatus TopologyEntity::disconnect_all_parents | ( | DLIList< TopologyEntity * > * | parents = 0 | ) | [pure virtual] |
Implemented in BasicTopologyEntity, GroupingEntity, and SenseEntity.
void TopologyEntity::disconnect_from_DAG | ( | ) |
Definition at line 367 of file TopologyEntity.cpp.
{ // disconnects this entity from any others // to which it is connected in the DAG; does not delete the DAGNode disconnect_all_children(); disconnect_all_parents(); }
virtual int TopologyEntity::get_children | ( | DLIList< TopologyEntity * > * | list = 0 | ) | const [pure virtual] |
Implemented in BasicTopologyEntity, GroupingEntity, and SenseEntity.
static const char* TopologyEntity::get_class_name | ( | ) | [inline, static] |
Reimplemented in RefFace, BasicTopologyEntity, RefVolume, Body, RefEdge, and RefVertex.
Definition at line 67 of file TopologyEntity.hpp.
{ return "TopologyEntity"; }
Definition at line 128 of file TopologyEntity.cpp.
{ TopologyBridge* bridge = const_cast<TopologyEntity*>(this)->bridgeMan.topology_bridge(); if (bridge) return bridge->get_geometry_query_engine(); else return NULL; }
virtual int TopologyEntity::get_parents | ( | DLIList< TopologyEntity * > * | list = 0 | ) | const [pure virtual] |
Implemented in BasicTopologyEntity, GroupingEntity, and SenseEntity.
Definition at line 241 of file TopologyEntity.cpp.
{ // NULL? if ( !entity ) return CUBIT_FALSE; // self? if (entity == this) return CUBIT_TRUE; // same type but not self? if ( dag_type() == entity->dag_type() ) return CUBIT_FALSE; // Get the entities of the right type. DLIList<TopologyEntity*> kin_folk; CubitStatus result = ModelQueryEngine::instance()-> query_model( *this, entity->dag_type(), kin_folk ); //only fails if types are the same, caught above. assert(result != CUBIT_FAILURE); if (CUBIT_FAILURE == result) { PRINT_ERROR("ModelQueryEngine::query_model failed.\n"); return CUBIT_FALSE; } // Search entities for passed in entity. TopologyEntity* model_entity = CAST_TO(entity, TopologyEntity) ; return kin_folk.is_in_list( model_entity ); }
CubitStatus TopologyEntity::loops | ( | DLIList< Loop * > & | loop_list | ) |
int TopologyEntity::num_loops | ( | ) |
Definition at line 202 of file TopologyEntity.cpp.
{ DLIList<Loop*> these_loops; loops(these_loops); return these_loops.size(); }
int TopologyEntity::num_ref_edges | ( | ) |
Definition at line 224 of file TopologyEntity.cpp.
{ DLIList<RefEdge*> these_ref_edges; ref_edges(these_ref_edges); return these_ref_edges.size(); }
int TopologyEntity::num_ref_faces | ( | ) |
Definition at line 217 of file TopologyEntity.cpp.
{ DLIList<RefFace*> these_ref_faces; ref_faces(these_ref_faces); return these_ref_faces.size(); }
int TopologyEntity::num_ref_vertices | ( | ) |
Definition at line 231 of file TopologyEntity.cpp.
{ DLIList<RefVertex*> these_ref_vertices; ref_vertices(these_ref_vertices); return these_ref_vertices.size(); }
int TopologyEntity::num_ref_volumes | ( | ) |
Definition at line 210 of file TopologyEntity.cpp.
{ DLIList<RefVolume*> these_ref_volumes; ref_volumes(these_ref_volumes); return these_ref_volumes.size(); }
void TopologyEntity::operator= | ( | const TopologyEntity & | ) | [private] |
virtual CubitBoolean TopologyEntity::query_append_children | ( | DLIList< TopologyEntity * > & | list | ) | [protected, pure virtual] |
Implemented in BasicTopologyEntity, GroupingEntity, and SenseEntity.
virtual CubitBoolean TopologyEntity::query_append_parents | ( | DLIList< TopologyEntity * > & | list | ) | [protected, pure virtual] |
Implemented in BasicTopologyEntity, GroupingEntity, and SenseEntity.
Definition at line 161 of file TopologyEntity.cpp.
{ DLIList<RefEdge*> edges; ref_edges(edges); if (edges.size() > 0) return edges.get(); else return NULL; }
CubitStatus TopologyEntity::ref_edges | ( | DLIList< RefEdge * > & | ref_edge_list | ) |
Definition at line 169 of file TopologyEntity.cpp.
{ DLIList<RefFace*> faces; ref_faces(faces); if (faces.size() > 0) return faces.get(); else return NULL; }
CubitStatus TopologyEntity::ref_faces | ( | DLIList< RefFace * > & | ref_face_list | ) |
Definition at line 153 of file TopologyEntity.cpp.
{ DLIList<RefVertex*> verts; ref_vertices(verts); if (verts.size() > 0) return verts.get(); else return NULL; }
CubitStatus TopologyEntity::ref_vertices | ( | DLIList< RefVertex * > & | ref_vertex_list | ) |
Reimplemented in RefFace.
Definition at line 177 of file TopologyEntity.cpp.
{ DLIList<RefVolume*> volumes; ref_volumes(volumes); if (volumes.size() > 0) return volumes.get(); else return NULL; }
CubitStatus TopologyEntity::ref_volumes | ( | DLIList< RefVolume * > & | ref_volume_list | ) |
virtual CubitStatus TopologyEntity::remove_child_link | ( | TopologyEntity * | child_ptr | ) | [pure virtual] |
Implemented in BasicTopologyEntity, GroupingEntity, and SenseEntity.
CubitStatus TopologyEntity::remove_from_DAG | ( | CubitBoolean | recursive_flag = CUBIT_FALSE | ) |
Definition at line 283 of file TopologyEntity.cpp.
{ // This counter will be used in the recursion to test whether // the call is from outside or from the function itself. When // the call comes from outside, the counter should always be // zero. CubitBoolean this_recurse = recurse_flag; if (recurse_flag == CUBIT_FALSE) recurse_flag = CUBIT_TRUE; DLIList<TopologyEntity*> childModEntList; // Check to see if there are no parents of this object. if ( get_parents() == 0 ) { if (this_recurse == CUBIT_FALSE) { // Since we are not recursing, this is a top-level entity. // Notify the static observers that a top-level entity is being // destructed. This must be done before children are disconnected. CubitObservable *top_level = CAST_TO(this, CubitObservable); AppUtil::instance()->send_event(GeometryEvent(GeometryEvent::TOP_LEVEL_ENTITY_DESTRUCTED, dynamic_cast<RefEntity*>(top_level))); } // Go through all the children and remove their link to // the current object. TopologyEntity* tempModEntPtr = NULL ; TopologyEntity* childModEntPtr = NULL ; childModEntList.clean_out(); disconnect_all_children(&childModEntList); // The following while conditional may not work...it depends on // what is_at_end does when you step over the end...CHECK THIS int i; for( i = 0 ; i < childModEntList.size() ; i++ ) { // Get the next ModelEnti in the child list and make sure its // pointer to its parent is removed. tempModEntPtr = childModEntList.get_and_step(); // Try remove() on the child ModEnt. If it comes back with // a success, then delete it. childModEntPtr = tempModEntPtr; if ( childModEntPtr->remove_from_DAG(recurse_flag) == CUBIT_SUCCESS ) { // Now deactivate the child ModEnt childModEntPtr->deactivated(CUBIT_TRUE) ; // remove it from observables, just before we go to delete it CubitObservable *observable = CAST_TO(childModEntPtr, CubitObservable); if (observable) { AppUtil::instance()->send_event(GeometryEvent(GeometryEvent::TOPOLOGY_ENTITY_DESTRUCTED, dynamic_cast<RefEntity*>(observable))); } } } // If this is the top of the recursion, then clean out all the deactivated // entities. if (this_recurse == CUBIT_FALSE) { this->deactivated(CUBIT_TRUE) ; // remove it from observables, just before we go to delete it CubitObservable *observable = CAST_TO(childModEntPtr, CubitObservable); if (observable) { AppUtil::instance()->send_event(GeometryEvent(GeometryEvent::TOPOLOGY_ENTITY_DESTRUCTED, dynamic_cast<RefEntity*>(observable))); } GeometryQueryTool::instance()->cleanout_deactivated_geometry() ; } return CUBIT_SUCCESS ; } else { return CUBIT_FAILURE ; } }
virtual void TopologyEntity::reverse_topology | ( | ) | [inline, virtual] |
CubitStatus TopologyEntity::set_topology_bridge | ( | TopologyBridge * | TB_ptr | ) | [protected] |
Definition at line 271 of file TopologyEntity.cpp.
{ assert (TB_ptr != NULL); CubitStatus rv = CUBIT_SUCCESS; BridgeManager* bridges = bridge_manager(); bridges->remove_all_bridges(); bridges->add_bridge(TB_ptr); return rv; }
CubitStatus TopologyEntity::shells | ( | DLIList< Shell * > & | shell_list | ) |
friend class ModelQueryEngine [friend] |
Definition at line 169 of file TopologyEntity.hpp.
BridgeManager TopologyEntity::bridgeMan [private] |
Definition at line 184 of file TopologyEntity.hpp.
cBit TopologyEntity::deactivatedStatus_ [protected] |
Definition at line 175 of file TopologyEntity.hpp.
cBit TopologyEntity::encountered_ [protected] |
Definition at line 178 of file TopologyEntity.hpp.