VTK  9.1.20211230
vtkOrientedGlyphFocalPlaneContourRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOrientedGlyphFocalPlaneContourRepresentation.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 =========================================================================*/
31 #ifndef vtkOrientedGlyphFocalPlaneContourRepresentation_h
32 #define vtkOrientedGlyphFocalPlaneContourRepresentation_h
33 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
36 
37 class vtkProperty2D;
38 class vtkActor2D;
40 class vtkPolyData;
41 class vtkGlyph2D;
42 class vtkPoints;
43 class vtkPolyData;
44 
45 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphFocalPlaneContourRepresentation
47 {
48 public:
53 
55 
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
68  void SetCursorShape(vtkPolyData* cursorShape);
71 
73 
78  void SetActiveCursorShape(vtkPolyData* activeShape);
81 
83 
87  vtkGetObjectMacro(Property, vtkProperty2D);
89 
91 
95  vtkGetObjectMacro(ActiveProperty, vtkProperty2D);
97 
99 
102  vtkGetObjectMacro(LinesProperty, vtkProperty2D);
104 
106 
111  void SetRenderer(vtkRenderer* ren) override;
112  void BuildRepresentation() override;
113  void StartWidgetInteraction(double eventPos[2]) override;
114  void WidgetInteraction(double eventPos[2]) override;
115  int ComputeInteractionState(int X, int Y, int modified = 0) override;
117 
119 
124  int RenderOverlay(vtkViewport* viewport) override;
125  int RenderOpaqueGeometry(vtkViewport* viewport) override;
129 
134 
143 
144 protected:
147 
148  // Render the cursor
161 
162  // The polydata represents the contour in display co-ordinates.
166 
167  // The polydata represents the contour in world coordinates. It is updated
168  // (kept in sync with Lines) every time the GetContourRepresentationAsPolyData()
169  // method is called.
171 
172  // Support picking
173  double LastPickPosition[3];
174  double LastEventPosition[2];
175 
176  // Methods to manipulate the cursor
177  void Translate(double eventPos[2]);
178  void Scale(double eventPos[2]);
179  void ShiftContour(double eventPos[2]);
180  void ScaleContour(double eventPos[2]);
181 
182  void ComputeCentroid(double* ioCentroid);
183 
184  // Properties used to control the appearance of selected objects and
185  // the manipulator in general.
189 
191 
193 
194  // Distance between where the mouse event happens and where the
195  // widget is focused - maintain this distance during interaction.
196  double InteractionOffset[2];
197 
198  void BuildLines() override;
199 
200 private:
203  void operator=(const vtkOrientedGlyphFocalPlaneContourRepresentation&) = delete;
204 };
205 
206 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:149
represent a contour drawn on the focal plane.
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:69
a simple class to control print indentation
Definition: vtkIndent.h:113
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
void WidgetInteraction(double eventPos[2]) override
Subclasses of vtkOrientedGlyphFocalPlaneContourRepresentation must implement these methods.
vtkPolyData * GetCursorShape()
Specify the cursor shape.
void GetActors2D(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
vtkPolyData * GetContourRepresentationAsPolyData() override
Get the points in this contour as a vtkPolyData.
int RenderOverlay(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void StartWidgetInteraction(double eventPos[2]) override
Subclasses of vtkOrientedGlyphFocalPlaneContourRepresentation must implement these methods.
void SetCursorShape(vtkPolyData *cursorShape)
Specify the cursor shape.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
int ComputeInteractionState(int X, int Y, int modified=0) override
Subclasses of vtkOrientedGlyphFocalPlaneContourRepresentation must implement these methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
static vtkOrientedGlyphFocalPlaneContourRepresentation * New()
Instantiate this class.
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
void SetRenderer(vtkRenderer *ren) override
Subclasses of vtkOrientedGlyphFocalPlaneContourRepresentation must implement these methods.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void BuildRepresentation() override
Subclasses of vtkOrientedGlyphFocalPlaneContourRepresentation must implement these methods.
void SetActiveCursorShape(vtkPolyData *activeShape)
Specify the shape of the cursor (handle) when it is active.
vtkMatrix4x4 * GetContourPlaneDirectionCosines(const double origin[3])
Direction cosines of the plane on which the contour lies on in world co-ordinates.
vtkPolyData * GetActiveCursorShape()
Specify the shape of the cursor (handle) when it is active.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
represent and manipulate 3D points
Definition: vtkPoints.h:143
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:194
an ordered list of Props
represent surface properties of a 2D image
abstract specification for renderers
Definition: vtkRenderer.h:182
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkTypeBool
Definition: vtkABI.h:69