VTK  9.3.0
vtkRectilinearWipeRepresentation.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
39 #ifndef vtkRectilinearWipeRepresentation_h
40 #define vtkRectilinearWipeRepresentation_h
41 
42 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
43 #include "vtkInteractionWidgetsModule.h" // For export macro
44 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
46 
47 VTK_ABI_NAMESPACE_BEGIN
49 class vtkImageActor;
50 class vtkPoints;
51 class vtkCellArray;
52 class vtkPolyData;
53 class vtkProperty2D;
55 class vtkActor2D;
56 
57 class VTKINTERACTIONWIDGETS_EXPORT vtkRectilinearWipeRepresentation : public vtkWidgetRepresentation
58 {
59 public:
64 
66 
70  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
74 
78  vtkGetObjectMacro(RectilinearWipe, vtkImageRectilinearWipe);
80 
82 
85  void SetImageActor(vtkImageActor* imageActor);
86  vtkGetObjectMacro(ImageActor, vtkImageActor);
88 
90 
95  vtkSetClampMacro(Tolerance, int, 1, 10);
96  vtkGetMacro(Tolerance, int);
98 
100 
104  vtkGetObjectMacro(Property, vtkProperty2D);
106 
108 
113  void BuildRepresentation() override;
114  void StartWidgetInteraction(double eventPos[2]) override;
115  void WidgetInteraction(double eventPos[2]) override;
116  int ComputeInteractionState(int X, int Y, int modify = 0) override;
118 
119  // Enums define the state of the prop relative to the mouse pointer
120  // position. Used by ComputeInteractionState() to communicate with the
121  // widget.
123  {
124  Outside = 0,
127  MovingCenter
128  };
129 #if !defined(VTK_LEGACY_REMOVE)
130  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
132 #endif
133 
135 
140  int RenderOverlay(vtkViewport* viewport) override;
141  int RenderOpaqueGeometry(vtkViewport* viewport) override;
145 
146 protected:
149 
150  // Instances that this class manipulates
153 
154  // The pick tolerance of the widget in pixels
156 
157  // This is used to track the beginning of interaction with the prop
158  double StartWipePosition[2];
159 
160  // Indicates which part of widget is currently active based on the
161  // state of the instance of the vtkImageRectilinearWipe.
163 
164  // Geometric structure of widget
165  vtkPoints* Points; // The nine points defining the widget geometry
166  vtkCellArray* Lines; // lines defining the boundary
171 
172  // These are used to track the coordinates (in display coordinate system)
173  // of the mid-edge and center point of the widget
174  double DP4[3];
175  double DP5[3];
176  double DP6[3];
177  double DP7[3];
178  double DP8[3];
179 
180  int Dims[3]; // Dimensions of the input image to the wipe
181  int I; // the i-j define the plane that is being displayed
182  int J;
183 
184 private:
186  void operator=(const vtkRectilinearWipeRepresentation&) = delete;
187 };
188 
189 VTK_ABI_NAMESPACE_END
190 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:44
object to represent cell connectivity
Definition: vtkCellArray.h:185
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:47
make a rectilinear combination of two images.
a simple class to control print indentation
Definition: vtkIndent.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:38
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
represent a vtkRectilinearWipeWidget
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
void WidgetInteraction(double eventPos[2]) override
Subclasses of vtkRectilinearWipeRepresentation must implement these methods.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
int ComputeInteractionState(int X, int Y, int modify=0) override
Subclasses of vtkRectilinearWipeRepresentation must implement these methods.
int RenderOverlay(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void SetRectilinearWipe(vtkImageRectilinearWipe *wipe)
Specify an instance of vtkImageRectilinearWipe to manipulate.
void SetImageActor(vtkImageActor *imageActor)
Specify an instance of vtkImageActor to decorate.
void BuildRepresentation() override
Subclasses of vtkRectilinearWipeRepresentation must implement these methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void StartWidgetInteraction(double eventPos[2]) override
Subclasses of vtkRectilinearWipeRepresentation must implement these methods.
static vtkRectilinearWipeRepresentation * New()
Instantiate this class.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void GetActors2D(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
abstract specification for Viewports
Definition: vtkViewport.h:54
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DEPRECATED_IN_9_2_0(reason)