VTK  9.3.20240328
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
49 #ifndef vtkRectilinearWipeRepresentation_h
50 #define vtkRectilinearWipeRepresentation_h
51 
52 #include "vtkInteractionWidgetsModule.h" // For export macro
54 
55 VTK_ABI_NAMESPACE_BEGIN
57 class vtkImageActor;
58 class vtkPoints;
59 class vtkCellArray;
60 class vtkPolyData;
61 class vtkProperty2D;
63 class vtkActor2D;
64 
65 class VTKINTERACTIONWIDGETS_EXPORT vtkRectilinearWipeRepresentation : public vtkWidgetRepresentation
66 {
67 public:
72 
74 
78  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
82 
86  vtkGetObjectMacro(RectilinearWipe, vtkImageRectilinearWipe);
88 
90 
93  void SetImageActor(vtkImageActor* imageActor);
94  vtkGetObjectMacro(ImageActor, vtkImageActor);
96 
98 
103  vtkSetClampMacro(Tolerance, int, 1, 10);
104  vtkGetMacro(Tolerance, int);
106 
108 
112  vtkGetObjectMacro(Property, vtkProperty2D);
114 
116 
121  void BuildRepresentation() override;
122  void StartWidgetInteraction(double eventPos[2]) override;
123  void WidgetInteraction(double eventPos[2]) override;
124  int ComputeInteractionState(int X, int Y, int modify = 0) override;
126 
127  // Enums define the state of the prop relative to the mouse pointer
128  // position. Used by ComputeInteractionState() to communicate with the
129  // widget.
131  {
132  Outside = 0,
135  MovingCenter
136  };
137 
139 
144  int RenderOverlay(vtkViewport* viewport) override;
145  int RenderOpaqueGeometry(vtkViewport* viewport) override;
149 
150 protected:
153 
154  // Instances that this class manipulates
157 
158  // The pick tolerance of the widget in pixels
160 
161  // This is used to track the beginning of interaction with the prop
162  double StartWipePosition[2];
163 
164  // Indicates which part of widget is currently active based on the
165  // state of the instance of the vtkImageRectilinearWipe.
167 
168  // Geometric structure of widget
169  vtkPoints* Points; // The nine points defining the widget geometry
170  vtkCellArray* Lines; // lines defining the boundary
175 
176  // These are used to track the coordinates (in display coordinate system)
177  // of the mid-edge and center point of the widget
178  double DP4[3];
179  double DP5[3];
180  double DP6[3];
181  double DP7[3];
182  double DP8[3];
183 
184  int Dims[3]; // Dimensions of the input image to the wipe
185  int I; // the i-j define the plane that is being displayed
186  int J;
187 
188 private:
190  void operator=(const vtkRectilinearWipeRepresentation&) = delete;
191 };
192 
193 VTK_ABI_NAMESPACE_END
194 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:144
object to represent cell connectivity
Definition: vtkCellArray.h:285
draw an image in a rendered 3D scene
make a rectilinear combination of two images.
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 3D points
Definition: vtkPoints.h:138
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
an ordered list of Props
represent surface properties of a 2D image
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:64
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
int vtkTypeBool
Definition: vtkABI.h:64