58#ifndef _SO_FIELD_SENSOR_
59#define _SO_FIELD_SENSOR_
137 static void sensorCB(
void * data,
SoSensor* sensor) {
143template<
class Object,
class Method>
149 _object(object), _method(method)
156 (_object->*_method)(theField);
165template<
class Object,
class Method>
175#define SO_NODE_ADD_FIELD_CALLBACK(field, method) \
176 this->addManagedSensor(SoCreateFieldSensor(this, &InventorThisClass::method, field));
180#define SO_NODE_ADD_FIELD_CALLBACK_WITH_PRIORITY(field, method, priority) \
181 { SoFieldSensor* invInternalSen = SoCreateFieldSensor(this, &InventorThisClass::method, field); \
182 invInternalSen->setPriority(priority); \
183 this->addManagedSensor(invInternalSen); \
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
SoFieldSensor * SoCreateFieldSensor(Object *object, Method method, SoField &field)
Helper method to create a field sensor by type inference.
void SoSensorCB(void *data, SoSensor *sensor)
This typedef defines the calling sequence for all callbacks from sensors.
Abstract base class for sensors attached to parts of a scene.
virtual void dyingReference()=0
This is called when the base (path, field, node, whatever) is deleted.
virtual void notify(SoNotList *list)
Propagates modification notification through an instance.
Abstract base class for objects that contain fields.
Base class for typed field sensor callbacks.
virtual void call(SoField *theField)=0
called when the SoFieldSensor is triggered.
Sensor class that can be attached to Inventor fields.
SoFieldSensor(SoSensorCB *func, void *data)
Creation methods.
void detach()
Unschedules this sensor (if it is scheduled) and makes it ignore changes to the scene graph.
virtual void trigger()
Override trigger to evaluate the field we're connected to, just in case the trigger method doesn't ge...
virtual ~SoFieldSensor()
Destroys the sensor, freeing up any memory associated with it after unscheduling it.
void attach(SoField *field)
Makes this sensor detect changes to the given field.
SoField * getAttachedField() const
Returns the field that this sensor is sensing, or NULL if it is not attached to any field.
SoFieldSensor()
Creation methods.
Base class for all fields.
Holds a list of SoNotRec notification records.
Abstract base class for Inventor sensors.
Typed field sensor that called given member function on object when triggered.
~SoTypedFieldSensorCallback()
SoTypedFieldSensorCallback(Object *object, Method method)
virtual void call(SoField *theField)
called when the SoFieldSensor is triggered.