cgma
|
#include <GeomDataObserver.hpp>
Public Member Functions | |
virtual void | notify_observer (const CubitEvent *event) |
virtual | ~GeomDataObserver () |
double | get_measure () |
void | set_measure (double val) |
CubitBoolean | is_measure_set () |
Static Public Member Functions | |
static GeomDataObserver * | get (RefEntity *on_this) |
static GeomDataObserver * | create (RefEntity *on_this) |
Private Member Functions | |
GeomDataObserver (RefEntity *watched) | |
Private Attributes | |
RefEntity * | myRefEntity |
double | myMeasure |
CubitBoolean | measureSet |
Definition at line 19 of file GeomDataObserver.hpp.
GeomDataObserver::~GeomDataObserver | ( | ) | [virtual] |
Definition at line 21 of file GeomDataObserver.cpp.
{ unregister_observable( myRefEntity ); }
GeomDataObserver::GeomDataObserver | ( | RefEntity * | watched | ) | [private] |
Definition at line 13 of file GeomDataObserver.cpp.
: myRefEntity(watched) { measureSet = CUBIT_FALSE; //initialize to something weird. myMeasure = -CUBIT_DBL_MAX; }
GeomDataObserver * GeomDataObserver::create | ( | RefEntity * | on_this | ) | [static] |
Definition at line 40 of file GeomDataObserver.cpp.
{ GeomDataObserver* eo = get(on_this); if (eo) return eo; eo = new GeomDataObserver(on_this); eo->register_observable(on_this); return eo; }
GeomDataObserver * GeomDataObserver::get | ( | RefEntity * | on_this | ) | [static] |
The following are specific functions for making this a dynamic observer.
Definition at line 26 of file GeomDataObserver.cpp.
{ DLIList<CubitObserver*> list; GeomDataObserver* eo = NULL; on_this->get_observer_list(list); for (int i = list.size(); i--; ) { if ( (eo = dynamic_cast<GeomDataObserver*>(list.step_and_get()) )) break; } return eo; }
double GeomDataObserver::get_measure | ( | ) | [inline] |
Now the reset are more specific to the GeomDataObserver.
Definition at line 37 of file GeomDataObserver.hpp.
{return myMeasure;}
CubitBoolean GeomDataObserver::is_measure_set | ( | ) | [inline] |
void GeomDataObserver::notify_observer | ( | const CubitEvent * | event | ) | [virtual] |
Implements CubitObserver.
Definition at line 50 of file GeomDataObserver.cpp.
{ const GeometryEvent* geom_event = dynamic_cast<const GeometryEvent*>(event); if(geom_event) { assert(geom_event->get_entity() == myRefEntity); switch (geom_event->get_type()) { case GeometryEvent::GEOMETRY_TOPOLOGY_MODIFIED: case GeometryEvent::TOPOLOGY_MODIFIED: case GeometryEvent::GEOMETRY_MODIFIED: case GeometryEvent::TOPOLOGY_ENTITY_DESTRUCTED: break; default: return; } /* don't call virtual functions or access class data after this! */ delete this; } }
void GeomDataObserver::set_measure | ( | double | val | ) | [inline] |
Returns the cached measurment for the RefEntity.
Definition at line 43 of file GeomDataObserver.hpp.
{ measureSet = CUBIT_TRUE; myMeasure = val;}
CubitBoolean GeomDataObserver::measureSet [private] |
Definition at line 58 of file GeomDataObserver.hpp.
double GeomDataObserver::myMeasure [private] |
Definition at line 57 of file GeomDataObserver.hpp.
RefEntity* GeomDataObserver::myRefEntity [private] |
Definition at line 56 of file GeomDataObserver.hpp.