cgma
GeomDataObserver Class Reference

#include <GeomDataObserver.hpp>

Inheritance diagram for GeomDataObserver:
CubitObserver

List of all members.

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 GeomDataObserverget (RefEntity *on_this)
static GeomDataObservercreate (RefEntity *on_this)

Private Member Functions

 GeomDataObserver (RefEntity *watched)

Private Attributes

RefEntitymyRefEntity
double myMeasure
CubitBoolean measureSet

Detailed Description

Definition at line 19 of file GeomDataObserver.hpp.


Constructor & Destructor Documentation

Definition at line 13 of file GeomDataObserver.cpp.

    : myRefEntity(watched)
{
  measureSet = CUBIT_FALSE;
    //initialize to something weird.
  myMeasure = -CUBIT_DBL_MAX;
}

Member Function Documentation

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;
}

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;}

Sets the measure value.

Definition at line 50 of file GeomDataObserver.hpp.

    {return measureSet;}
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.


Member Data Documentation

Definition at line 58 of file GeomDataObserver.hpp.

double GeomDataObserver::myMeasure [private]

Definition at line 57 of file GeomDataObserver.hpp.

Definition at line 56 of file GeomDataObserver.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines