VTK
vtkRectilinearWipeRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRectilinearWipeRepresentation.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 =========================================================================*/
39 #ifndef vtkRectilinearWipeRepresentation_h
40 #define vtkRectilinearWipeRepresentation_h
41 
42 #include "vtkInteractionWidgetsModule.h" // For export macro
44 
46 class vtkImageActor;
47 class vtkPoints;
48 class vtkCellArray;
49 class vtkPolyData;
50 class vtkProperty2D;
52 class vtkActor2D;
53 
54 
55 class VTKINTERACTIONWIDGETS_EXPORT vtkRectilinearWipeRepresentation : public vtkWidgetRepresentation
56 {
57 public:
62 
64 
68  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
72 
75  void SetRectilinearWipe(vtkImageRectilinearWipe *wipe);
76  vtkGetObjectMacro(RectilinearWipe,vtkImageRectilinearWipe);
78 
80 
83  void SetImageActor(vtkImageActor *imageActor);
84  vtkGetObjectMacro(ImageActor,vtkImageActor);
86 
88 
93  vtkSetClampMacro(Tolerance,int,1,10);
94  vtkGetMacro(Tolerance,int);
96 
98 
102  vtkGetObjectMacro(Property,vtkProperty2D);
104 
106 
111  void BuildRepresentation() override;
112  void StartWidgetInteraction(double eventPos[2]) override;
113  void WidgetInteraction(double eventPos[2]) override;
114  int ComputeInteractionState(int X, int Y, int modify=0) override;
116 
117  // Enums define the state of the prop relative to the mouse pointer
118  // position. Used by ComputeInteractionState() to communicate with the
119  // widget.
121  {
122  Outside=0,
125  MovingCenter
126  };
127 
129 
132  void GetActors2D(vtkPropCollection *) override;
133  void ReleaseGraphicsResources(vtkWindow *) override;
134  int RenderOverlay(vtkViewport *viewport) override;
135  int RenderOpaqueGeometry(vtkViewport *viewport) override;
136  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
137  int HasTranslucentPolygonalGeometry() override;
139 
140 protected:
143 
144  // Instances that this class manipulates
147 
148  // The pick tolerance of the widget in pixels
150 
151  // This is used to track the beginning of interaction with the prop
152  double StartWipePosition[2];
153 
154  // Indicates which part of widget is currently active based on the
155  // state of the instance of the vtkImageRectilinearWipe.
157 
158  // Geometric structure of widget
159  vtkPoints *Points; // The nine points defining the widget geometry
160  vtkCellArray *Lines; // lines defining the boundary
165 
166  // These are used to track the coordinates (in display coordinate system)
167  // of the mid-edge and center point of the widget
168  double DP4[3];
169  double DP5[3];
170  double DP6[3];
171  double DP7[3];
172  double DP8[3];
173 
174  int Dims[3]; // Dimensions of the input image to the wipe
175  int I; //the i-j define the plane that is being displayed
176  int J;
177 
178 private:
180  void operator=(const vtkRectilinearWipeRepresentation&) = delete;
181 };
182 
183 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkWidgetRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
Definition: vtkWidgetRepresentation.h:136
vtkWidgetRepresentation.h
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:45
vtkRectilinearWipeRepresentation::WipeActor
vtkActor2D * WipeActor
Definition: vtkRectilinearWipeRepresentation.h:163
vtkRectilinearWipeRepresentation
represent a vtkRectilinearWipeWidget
Definition: vtkRectilinearWipeRepresentation.h:55
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:60
vtkImageRectilinearWipe
make a rectilinear combination of two images.
Definition: vtkImageRectilinearWipe.h:61
vtkRectilinearWipeRepresentation::ActiveParts
int ActiveParts
Definition: vtkRectilinearWipeRepresentation.h:156
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkWidgetRepresentation::GetActors2D
void GetActors2D(vtkPropCollection *) override
Definition: vtkWidgetRepresentation.h:218
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkRectilinearWipeRepresentation::RectilinearWipe
vtkImageRectilinearWipe * RectilinearWipe
Definition: vtkRectilinearWipeRepresentation.h:145
vtkWidgetRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:223
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:220
vtkRectilinearWipeRepresentation::Points
vtkPoints * Points
Definition: vtkRectilinearWipeRepresentation.h:159
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:137
vtkWidgetRepresentation::HasTranslucentPolygonalGeometry
int HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkWidgetRepresentation.h:225
vtkRectilinearWipeRepresentation::ImageActor
vtkImageActor * ImageActor
Definition: vtkRectilinearWipeRepresentation.h:146
vtkRectilinearWipeRepresentation::WipeMapper
vtkPolyDataMapper2D * WipeMapper
Definition: vtkRectilinearWipeRepresentation.h:162
vtkRectilinearWipeRepresentation::MovingHPane
Definition: vtkRectilinearWipeRepresentation.h:123
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:44
vtkRectilinearWipeRepresentation::MovingVPane
Definition: vtkRectilinearWipeRepresentation.h:124
vtkRectilinearWipeRepresentation::Property
vtkProperty2D * Property
Definition: vtkRectilinearWipeRepresentation.h:164
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkRectilinearWipeRepresentation::_InteractionState
_InteractionState
Definition: vtkRectilinearWipeRepresentation.h:120
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkWidgetRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:221
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:222
vtkRectilinearWipeRepresentation::J
int J
Definition: vtkRectilinearWipeRepresentation.h:176
vtkRectilinearWipeRepresentation::I
int I
Definition: vtkRectilinearWipeRepresentation.h:175
vtkRectilinearWipeRepresentation::Lines
vtkCellArray * Lines
Definition: vtkRectilinearWipeRepresentation.h:160
vtkImageActor
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:43
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkRectilinearWipeRepresentation::Wipe
vtkPolyData * Wipe
Definition: vtkRectilinearWipeRepresentation.h:161
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRectilinearWipeRepresentation::Tolerance
int Tolerance
Definition: vtkRectilinearWipeRepresentation.h:149