VTK
vtkResliceImageViewerMeasurements.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkResliceImageViewerMeasurements.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef __vtkResliceImageViewerMeasurements_h
26 #define __vtkResliceImageViewerMeasurements_h
27 
28 #include "vtkObject.h"
29 
31 class vtkAbstractWidget;
32 class vtkCallbackCommand;
33 class vtkCollection;
34 class vtkDistanceWidget;
35 class vtkAngleWidget;
38 class vtkHandleWidget;
39 class vtkCaptionWidget;
40 class vtkContourWidget;
41 class vtkSeedWidget;
42 
44 {
45 public:
46 
48 
51  void PrintSelf(ostream& os, vtkIndent indent);
53 
55  virtual void Render();
56 
58 
59  virtual void AddItem(vtkAbstractWidget *);
60  virtual void RemoveItem(vtkAbstractWidget *);
61  virtual void RemoveAllItems();
63 
65 
69  vtkSetClampMacro(ProcessEvents, int, 0, 1);
70  vtkGetMacro(ProcessEvents, int);
71  vtkBooleanMacro(ProcessEvents, int);
73 
75 
76  vtkSetMacro( Tolerance, double );
77  vtkGetMacro( Tolerance, double );
79 
81 
83  virtual void SetResliceImageViewer( vtkResliceImageViewer * );
84  vtkGetObjectMacro( ResliceImageViewer, vtkResliceImageViewer );
86 
89  virtual void Update();
90 
91 protected:
94 
96 
97  bool IsItemOnReslicedPlane( vtkAbstractWidget * w );
98  bool IsWidgetOnReslicedPlane( vtkDistanceWidget * w );
99  bool IsWidgetOnReslicedPlane( vtkAngleWidget * w );
100  bool IsWidgetOnReslicedPlane( vtkBiDimensionalWidget * w );
101  bool IsWidgetOnReslicedPlane( vtkCaptionWidget * w );
102  bool IsWidgetOnReslicedPlane( vtkContourWidget * w );
103  bool IsWidgetOnReslicedPlane( vtkSeedWidget * w );
104  bool IsWidgetOnReslicedPlane( vtkHandleWidget * w );
105  bool IsPointOnReslicedPlane( vtkHandleRepresentation * h );
106  bool IsPositionOnReslicedPlane( double p[3] );
108 
109  // Handles the events; centralized here for all widgets.
110  static void ProcessEventsHandler(vtkObject* object, unsigned long event,
111  void* clientdata, void* calldata);
112 
115 
116  // Handle the visibility of the measurements.
118 
119  // Flag indicating if we should handle events.
120  // On by default.
122 
123  // Tolerance for Point-in-plane computation
124  double Tolerance;
125 
126 private:
128  void operator=(const vtkResliceImageViewerMeasurements&); // Not implemented.
129 };
130 
131 #endif