![]() |
anatomist 6.0.4
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. | |
Protected Member Functions | |
| virtual void | cleanupObserver () |
| call this function from inherited classes destructors. | |
| virtual void | registerObservable (Observable *) |
| only called by Observable: don't use this function directly | |
| virtual void | unregisterObservable (Observable *) |
| Called when an observable is destroyed, only called by Observable: don't use this function directly. | |
| 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.
References Observable.
|
protectedvirtual |
Called when an observable is destroyed, only called by Observable: don't use this function directly.
Reimplemented in ALandmarkPicker, anatomist::AObject, anatomist::AWindow, anatomist::ConstraintEditorWindow, anatomist::Fusion2D, anatomist::NormalsSettingsPanel::NormalsObserver, anatomist::RoiDynSegmentAction, anatomist::RoiManagementActionSharedData, ChooseReferentialWindow, ErpWraper, FixedPointOfViewWindow, Fusion2DWindow, Fusion3DWindow, GraphLandmarkPicker, LightModelWindow, MaterialWindow, QAPaletteWin, QAWindowBlock, QGraphProperties, QSurfMatchWin, QTexturePanel, QTextureWin, RenderingWindow, Tools3DWindow, VectorFieldEditionWindow, and VolRenderPanel.
References Observable.
|
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 ALandmarkPicker, anatomist::AConnectivityMatrix, anatomist::AInterpoler, anatomist::AMTexture, anatomist::ANormalsMesh, anatomist::AObject, anatomist::ATexSurface, anatomist::ATexture, anatomist::AVolumeView< T >, anatomist::AWindow, anatomist::ClippedObject, anatomist::CommandWriter, anatomist::ConstraintEditorWindow, anatomist::CutMesh, anatomist::Fusion2D, anatomist::Fusion2DMesh, anatomist::Fusion3D, anatomist::GLMObject, anatomist::MiniPaletteGraphics, anatomist::MiniPaletteWidgetEdit, anatomist::MObject, anatomist::NormalsSettingsPanel::NormalsObserver, anatomist::NormalsSettingsPanel, anatomist::PaintActionSharedData, anatomist::PlanarFusion3D, anatomist::ReferentialObserver, anatomist::RoiDynSegmentAction, anatomist::RoiLevelSetActionSharedData, anatomist::RoiManagementActionSharedData, anatomist::Slice, anatomist::TesselatedMesh, anatomist::VectorField, anatomist::VolRender, anatomist::VolRenderShader, ChooseReferentialWindow, ErpWraper, FixedPointOfViewWindow, Fusion2DWindow, Fusion3DWindow, GraphLandmarkPicker, LightModelWindow, MaterialWindow, PaintActionView, QAPaletteWin, QAWindow, QAWindowBlock, QGraphProperties, QObjectBrowser, QSurfMatchWin, QTexturePanel, QTextureWin, RenderingWindow, RoiDynSegmentActionView, RoiHistoPlot, RoiLevelSetActionView, RoiManagementActionView, RoiMorphoMathActionView, Tools3DWindow, VectorFieldEditionWindow, and VolRenderPanel.
References Observable.
|
friend |
Definition at line 90 of file Observer.h.
References Observable.
Referenced by Observable, anatomist::NormalsSettingsPanel::NormalsObserver::registerObservable(), registerObservable(), anatomist::AObject::unregisterObservable(), anatomist::AWindow::unregisterObservable(), anatomist::NormalsSettingsPanel::NormalsObserver::unregisterObservable(), unregisterObservable(), anatomist::RoiManagementActionSharedData::unregisterObservable(), anatomist::AObject::update(), anatomist::AWindow::update(), anatomist::CommandWriter::update(), anatomist::MiniPaletteGraphics::update(), anatomist::MiniPaletteWidgetEdit::update(), anatomist::NormalsSettingsPanel::NormalsObserver::update(), anatomist::NormalsSettingsPanel::update(), update(), anatomist::PaintActionSharedData::update(), anatomist::ReferentialObserver::update(), anatomist::RoiLevelSetActionSharedData::update(), anatomist::RoiManagementActionSharedData::update(), and AWindow3D::update().