![]() |
anatomist
5.0.5
3D neuroimaging data viewer
|
A class can implement the Observer interface when it wants to be informed of changes in observable objects. More...
#include <anatomist/observer/Observer.h>
Public Member Functions | |
virtual | ~Observer () |
virtual void | update (const Observable *observable, void *arg)=0 |
This method is called whenever the observed object is changed. More... | |
Protected Member Functions | |
virtual void | cleanupObserver () |
call this function from inherited classes destructors. More... | |
virtual void | registerObservable (Observable *) |
only called by Observable: don't use this function directly More... | |
virtual void | unregisterObservable (Observable *) |
Called when an observable is destroyed, only called by Observable: don't use this function directly. More... | |
const std::set< Observable * > & | observed () const |
Friends | |
class | Observable |
A class can implement the Observer interface when it wants to be informed of changes in observable objects.
Definition at line 54 of file Observer.h.
|
virtual |
|
protectedvirtual |
call this function from inherited classes destructors.
Derived classes may have to manually call it, especially if they have overloaded unregisterObservable()
otherwise it may be called by the destructor of a base class which will not be able to access the correct overloaded functions anymore.
It's not an error to call cleanupObserver()
several times: basically each destructor in the inheritance tree of a derived class will call it, but only the first call will have any effect.
|
inlineprotected |
Definition at line 85 of file Observer.h.
|
protectedvirtual |
only called by Observable: don't use this function directly
Reimplemented in anatomist::NormalsSettingsPanel::NormalsObserver.
|
protectedvirtual |
Called when an observable is destroyed, only called by Observable: don't use this function directly.
Reimplemented in anatomist::AObject, anatomist::AWindow, anatomist::RoiManagementActionSharedData, anatomist::Fusion2D, QAPaletteWin, anatomist::RoiDynSegmentAction, RenderingWindow, ALandmarkPicker, VectorFieldEditionWindow, QSurfMatchWin, QTexturePanel, MaterialWindow, ErpWraper, GraphLandmarkPicker, LightModelWindow, QGraphProperties, ChooseReferentialWindow, Tools3DWindow, anatomist::ConstraintEditorWindow, VolRenderPanel, FixedPointOfViewWindow, QTextureWin, Fusion3DWindow, anatomist::NormalsSettingsPanel::NormalsObserver, and Fusion2DWindow.
Referenced by anatomist::RoiLevelSetAction::viewableAction().
|
pure virtual |
This method is called whenever the observed object is changed.
The programmer calls an observable object's notifyObservers method to have all the object's observers notified of the change.
observable | the observable object |
Implemented in anatomist::AObject, anatomist::PaintActionSharedData, anatomist::MObject, RoiDynSegmentActionView, anatomist::AWindow, anatomist::RoiManagementActionSharedData, RoiLevelSetActionView, anatomist::ATexSurface, RoiMorphoMathActionView, anatomist::CommandWriter, anatomist::Fusion2D, anatomist::Fusion3D, anatomist::AMTexture, RoiManagementActionView, anatomist::ATexture, anatomist::AVolumeView< T >, anatomist::VolRenderShader, anatomist::VolRender, QObjectBrowser, anatomist::AInterpoler, anatomist::AConnectivityMatrix, PaintActionView, anatomist::Fusion2DMesh, QTexturePanel, GraphLandmarkPicker, anatomist::VectorField, anatomist::NormalsSettingsPanel, ErpWraper, anatomist::ReferentialObserver, anatomist::PlanarFusion3D, ChooseReferentialWindow, VolRenderPanel, RenderingWindow, anatomist::ClippedObject, anatomist::Slice, ALandmarkPicker, anatomist::RoiDynSegmentAction, MaterialWindow, anatomist::RoiLevelSetActionSharedData, anatomist::CutMesh, anatomist::TesselatedMesh, QAPaletteWin, anatomist::NormalsSettingsPanel::NormalsObserver, VectorFieldEditionWindow, QTextureWin, anatomist::GLMObject, anatomist::ANormalsMesh, anatomist::ConstraintEditorWindow, QSurfMatchWin, QGraphProperties, FixedPointOfViewWindow, LightModelWindow, Fusion3DWindow, Fusion2DWindow, RoiHistoPlot, and Tools3DWindow.
|
friend |
Definition at line 90 of file Observer.h.