|
cgma
|
#include <ModelEntity.hpp>
Definition at line 56 of file ModelEntity.hpp.
Definition at line 65 of file ModelEntity.cpp.
| ModelEntity::~ModelEntity | ( | ) | [virtual] |
Definition at line 81 of file ModelEntity.cpp.
{
// Make sure that the ModelEntity class does not have a pointer to this
// ModelEntity in its list. If it does, then remove the instances
// of the pointer
DAG::instance()->remove(this);
}
| ModelEntity::ModelEntity | ( | const ModelEntity & | aModEnt | ) | [private] |
| virtual DagType ModelEntity::dag_type | ( | ) | const [pure virtual] |
| void ModelEntity::deactivated | ( | CubitBoolean | flag | ) |
Definition at line 209 of file ModelEntity.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 ModelEntity::deactivated | ( | ) | const |
Definition at line 225 of file ModelEntity.cpp.
{
return (CubitBoolean)deactivatedStatus_ ;
}
| virtual CubitStatus ModelEntity::disconnect_all_children | ( | DLIList< ModelEntity * > * | children = 0 | ) | [pure virtual] |
| virtual CubitStatus ModelEntity::disconnect_all_parents | ( | DLIList< ModelEntity * > * | parents = 0 | ) | [pure virtual] |
| void ModelEntity::disconnect_from_DAG | ( | ) |
Definition at line 190 of file ModelEntity.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 ModelEntity::get_children | ( | DLIList< ModelEntity * > * | list = 0 | ) | const [pure virtual] |
| virtual int ModelEntity::get_parents | ( | DLIList< ModelEntity * > * | list = 0 | ) | const [pure virtual] |
| ModelEntity const& ModelEntity::operator= | ( | ModelEntity const & | aModEnt | ) | [private] |
| virtual CubitBoolean ModelEntity::query_append_children | ( | DLIList< ModelEntity * > & | list | ) | [protected, pure virtual] |
| virtual CubitBoolean ModelEntity::query_append_parents | ( | DLIList< ModelEntity * > & | list | ) | [protected, pure virtual] |
| virtual CubitStatus ModelEntity::remove_child_link | ( | ModelEntity * | child_ptr | ) | [pure virtual] |
| CubitStatus ModelEntity::remove_from_DAG | ( | CubitBoolean | recursive_flag = CUBIT_FALSE | ) |
Definition at line 106 of file ModelEntity.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<ModelEntity*> 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(top_level, TOP_LEVEL_ENTITY_DESTRUCTED);
}
// Go through all the children and remove their link to
// the current object.
ModelEntity* tempModEntPtr = NULL ;
ModelEntity* 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(observable, MODEL_ENTITY_DESTRUCTED );
}
}
}
// 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(observable, MODEL_ENTITY_DESTRUCTED );
}
GeometryQueryTool::instance()->cleanout_deactivated_geometry() ;
}
return CUBIT_SUCCESS ;
}
else
{
return CUBIT_FAILURE ;
}
}
friend class GroupingEntity [friend] |
Definition at line 62 of file ModelEntity.hpp.
friend class ModelQueryEngine [friend] |
Definition at line 61 of file ModelEntity.hpp.
cBit ModelEntity::deactivatedStatus_ [protected] |
Definition at line 98 of file ModelEntity.hpp.
cBit ModelEntity::encountered_ [protected] |
Definition at line 101 of file ModelEntity.hpp.