VTK
dox/Interaction/Image/vtkResliceImageViewerMeasurements.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkResliceImageViewerMeasurements.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00025 #ifndef __vtkResliceImageViewerMeasurements_h
00026 #define __vtkResliceImageViewerMeasurements_h
00027 
00028 #include "vtkInteractionImageModule.h" // For export macro
00029 #include "vtkObject.h"
00030 
00031 class vtkResliceImageViewer;
00032 class vtkAbstractWidget;
00033 class vtkCallbackCommand;
00034 class vtkCollection;
00035 class vtkDistanceWidget;
00036 class vtkAngleWidget;
00037 class vtkBiDimensionalWidget;
00038 class vtkHandleRepresentation;
00039 class vtkHandleWidget;
00040 class vtkCaptionWidget;
00041 class vtkContourWidget;
00042 class vtkSeedWidget;
00043 
00044 class VTKINTERACTIONIMAGE_EXPORT vtkResliceImageViewerMeasurements : public vtkObject
00045 {
00046 public:
00047 
00049 
00050   static vtkResliceImageViewerMeasurements *New();
00051   vtkTypeMacro(vtkResliceImageViewerMeasurements,vtkObject);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056   virtual void Render();
00057 
00059 
00060   virtual void AddItem(vtkAbstractWidget *);
00061   virtual void RemoveItem(vtkAbstractWidget *);
00062   virtual void RemoveAllItems();
00064 
00066 
00070   vtkSetClampMacro(ProcessEvents, int, 0, 1);
00071   vtkGetMacro(ProcessEvents, int);
00072   vtkBooleanMacro(ProcessEvents, int);
00074 
00076 
00077   vtkSetMacro( Tolerance, double );
00078   vtkGetMacro( Tolerance, double );
00080 
00082 
00084   virtual void SetResliceImageViewer( vtkResliceImageViewer * );
00085   vtkGetObjectMacro( ResliceImageViewer, vtkResliceImageViewer );
00087 
00090   virtual void Update();
00091 
00092 protected:
00093   vtkResliceImageViewerMeasurements();
00094   ~vtkResliceImageViewerMeasurements();
00095 
00097 
00098   bool IsItemOnReslicedPlane( vtkAbstractWidget * w );
00099   bool IsWidgetOnReslicedPlane( vtkDistanceWidget * w );
00100   bool IsWidgetOnReslicedPlane( vtkAngleWidget * w );
00101   bool IsWidgetOnReslicedPlane( vtkBiDimensionalWidget * w );
00102   bool IsWidgetOnReslicedPlane( vtkCaptionWidget * w );
00103   bool IsWidgetOnReslicedPlane( vtkContourWidget * w );
00104   bool IsWidgetOnReslicedPlane( vtkSeedWidget * w );
00105   bool IsWidgetOnReslicedPlane( vtkHandleWidget * w );
00106   bool IsPointOnReslicedPlane( vtkHandleRepresentation * h );
00107   bool IsPositionOnReslicedPlane( double p[3] );
00109 
00110   // Handles the events; centralized here for all widgets.
00111   static void ProcessEventsHandler(vtkObject* object, unsigned long event,
00112                             void* clientdata, void* calldata);
00113 
00114   vtkResliceImageViewer * ResliceImageViewer;
00115   vtkCollection         * WidgetCollection;
00116 
00117   // Handle the visibility of the measurements.
00118   vtkCallbackCommand    * EventCallbackCommand; //
00119 
00120   // Flag indicating if we should handle events.
00121   // On by default.
00122   int ProcessEvents;
00123 
00124   // Tolerance for Point-in-plane computation
00125   double Tolerance;
00126 
00127 private:
00128   vtkResliceImageViewerMeasurements(const vtkResliceImageViewerMeasurements&);  // Not implemented.
00129   void operator=(const vtkResliceImageViewerMeasurements&);  // Not implemented.
00130 };
00131 
00132 #endif