VTK  9.3.1
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
30 #ifndef vtkRectilinearWipeRepresentation_h
31 #define vtkRectilinearWipeRepresentation_h
32 
33 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
34 #include "vtkInteractionWidgetsModule.h" // For export macro
35 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkImageActor;
41 class vtkPoints;
42 class vtkCellArray;
43 class vtkPolyData;
44 class vtkProperty2D;
46 class vtkActor2D;
47 
48 class VTKINTERACTIONWIDGETS_EXPORT vtkRectilinearWipeRepresentation : public vtkWidgetRepresentation
49 {
50 public:
55 
57 
61  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65 
68  void SetRectilinearWipe(vtkImageRectilinearWipe* wipe);
69  vtkGetObjectMacro(RectilinearWipe, vtkImageRectilinearWipe);
71 
73 
76  void SetImageActor(vtkImageActor* imageActor);
77  vtkGetObjectMacro(ImageActor, vtkImageActor);
79 
81 
86  vtkSetClampMacro(Tolerance, int, 1, 10);
87  vtkGetMacro(Tolerance, int);
89 
91 
95  vtkGetObjectMacro(Property, vtkProperty2D);
97 
99 
104  void BuildRepresentation() override;
105  void StartWidgetInteraction(double eventPos[2]) override;
106  void WidgetInteraction(double eventPos[2]) override;
107  int ComputeInteractionState(int X, int Y, int modify = 0) override;
109 
110  // Enums define the state of the prop relative to the mouse pointer
111  // position. Used by ComputeInteractionState() to communicate with the
112  // widget.
114  {
115  Outside = 0,
118  MovingCenter
119  };
120 #if !defined(VTK_LEGACY_REMOVE)
121  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
123 #endif
124 
126 
129  void GetActors2D(vtkPropCollection*) override;
130  void ReleaseGraphicsResources(vtkWindow*) override;
131  int RenderOverlay(vtkViewport* viewport) override;
132  int RenderOpaqueGeometry(vtkViewport* viewport) override;
133  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
136 
137 protected:
140 
141  // Instances that this class manipulates
144 
145  // The pick tolerance of the widget in pixels
147 
148  // This is used to track the beginning of interaction with the prop
149  double StartWipePosition[2];
150 
151  // Indicates which part of widget is currently active based on the
152  // state of the instance of the vtkImageRectilinearWipe.
154 
155  // Geometric structure of widget
156  vtkPoints* Points; // The nine points defining the widget geometry
157  vtkCellArray* Lines; // lines defining the boundary
162 
163  // These are used to track the coordinates (in display coordinate system)
164  // of the mid-edge and center point of the widget
165  double DP4[3];
166  double DP5[3];
167  double DP6[3];
168  double DP7[3];
169  double DP8[3];
170 
171  int Dims[3]; // Dimensions of the input image to the wipe
172  int I; // the i-j define the plane that is being displayed
173  int J;
174 
175 private:
177  void operator=(const vtkRectilinearWipeRepresentation&) = delete;
178 };
179 
180 VTK_ABI_NAMESPACE_END
181 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:44
void GetActors2D(vtkPropCollection *) override
virtual void StartWidgetInteraction(double eventPos[2])
#define VTK_DEPRECATED_IN_9_2_0(reason)
a actor that draws 2D data
Definition: vtkActor2D.h:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:37
a simple class to control print indentation
Definition: vtkIndent.h:28
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
make a rectilinear combination of two images.
virtual void WidgetInteraction(double newEventPos[2])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
object to represent cell connectivity
Definition: vtkCellArray.h:175
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
represent surface properties of a 2D image
Definition: vtkProperty2D.h:29
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent a vtkRectilinearWipeWidget
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:28