00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef MECHSYS_UPDATEPLANECALLBACK_H
00023 #define MECHSYS_UPDATEPLANECALLBACK_H
00024
00025
00026 #include "vtkCommand.h"
00027 #include "vtkPlane.h"
00028 #include "vtkObject.h"
00029 #include "vtkImplicitPlaneWidget2.h"
00030 #include "vtkImplicitPlaneRepresentation.h"
00031
00032 class UpdatePlaneCallBack : public vtkCommand
00033 {
00034 public:
00035
00036 UpdatePlaneCallBack() : _plane(NULL), _actor(NULL) {}
00037
00038
00039 void SetPlane(vtkPlane * ThePlane) { _plane = ThePlane; }
00040 void SetActor(vtkActor * TheActor) { _actor = TheActor; }
00041 virtual void Execute(vtkObject * Caller, unsigned long eventId, void *)
00042 {
00043 vtkImplicitPlaneWidget2 * wid = reinterpret_cast<vtkImplicitPlaneWidget2*> (Caller);
00044 vtkImplicitPlaneRepresentation * rep = reinterpret_cast<vtkImplicitPlaneRepresentation*> (wid->GetRepresentation());
00045 rep -> GetPlane(_plane);
00046 if (_actor!=NULL) _actor->VisibilityOn();
00047 }
00048
00049
00050 static UpdatePlaneCallBack * New() { return new UpdatePlaneCallBack; }
00051
00052 private:
00053
00054 vtkPlane * _plane;
00055 vtkActor * _actor;
00056
00057 };
00058
00059 #endif // MECHSYS_UPDATEPLANECALLBACK_H
00060
00061