VTK  9.3.1
vtkResliceImageViewerMeasurements.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkResliceImageViewerMeasurements_h
15 #define vtkResliceImageViewerMeasurements_h
16 
17 #include "vtkInteractionImageModule.h" // For export macro
18 #include "vtkObject.h"
19 
20 VTK_ABI_NAMESPACE_BEGIN
22 class vtkAbstractWidget;
23 class vtkCallbackCommand;
24 class vtkCollection;
25 class vtkDistanceWidget;
26 class vtkAngleWidget;
29 class vtkHandleWidget;
30 class vtkCaptionWidget;
31 class vtkContourWidget;
32 class vtkSeedWidget;
33 
34 class VTKINTERACTIONIMAGE_EXPORT vtkResliceImageViewerMeasurements : public vtkObject
35 {
36 public:
38 
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
49  virtual void Render();
50 
52 
55  virtual void AddItem(vtkAbstractWidget*);
56  virtual void RemoveItem(vtkAbstractWidget*);
57  virtual void RemoveAllItems();
59 
61 
67  vtkSetClampMacro(ProcessEvents, vtkTypeBool, 0, 1);
68  vtkGetMacro(ProcessEvents, vtkTypeBool);
69  vtkBooleanMacro(ProcessEvents, vtkTypeBool);
71 
73 
76  vtkSetMacro(Tolerance, double);
77  vtkGetMacro(Tolerance, double);
79 
81 
85  virtual void SetResliceImageViewer(vtkResliceImageViewer*);
86  vtkGetObjectMacro(ResliceImageViewer, vtkResliceImageViewer);
88 
93  virtual void Update();
94 
95 protected:
98 
100 
103  bool IsItemOnReslicedPlane(vtkAbstractWidget* w);
104  bool IsWidgetOnReslicedPlane(vtkDistanceWidget* w);
105  bool IsWidgetOnReslicedPlane(vtkAngleWidget* w);
106  bool IsWidgetOnReslicedPlane(vtkBiDimensionalWidget* w);
107  bool IsWidgetOnReslicedPlane(vtkCaptionWidget* w);
108  bool IsWidgetOnReslicedPlane(vtkContourWidget* w);
109  bool IsWidgetOnReslicedPlane(vtkSeedWidget* w);
110  bool IsWidgetOnReslicedPlane(vtkHandleWidget* w);
111  bool IsPointOnReslicedPlane(vtkHandleRepresentation* h);
112  bool IsPositionOnReslicedPlane(double p[3]);
114 
115  // Handles the events; centralized here for all widgets.
116  static void ProcessEventsHandler(
117  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
118 
121 
122  // Handle the visibility of the measurements.
124 
125  // Flag indicating if we should handle events.
126  // On by default.
128 
129  // Tolerance for Point-in-plane computation
130  double Tolerance;
131 
132 private:
134  void operator=(const vtkResliceImageViewerMeasurements&) = delete;
135 };
136 
137 VTK_ABI_NAMESPACE_END
138 #endif
measure the bi-dimensional lengths of an object
widget for placing a caption (text plus leader)
abstract base class for most VTK objects
Definition: vtkObject.h:51
abstract class for representing widget handles
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
measure the distance between two points
a general widget for moving handles
place multiple seed points
Definition: vtkSeedWidget.h:76
int vtkTypeBool
Definition: vtkABI.h:64
Manage measurements on a resliced image.
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:28
measure the angle between two rays (defined by three points)
define the API for widget / widget representation
create a contour with a set of points
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
Display an image along with a reslice cursor.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...