VTK  9.2.20230323
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 VTK_ABI_NAMESPACE_BEGIN
38 class vtkProperty2D;
39 class vtkActor2D;
41 class vtkPolyData;
42 class vtkGlyph2D;
43 class vtkPoints;
44 class vtkPolyData;
45 
46 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphFocalPlaneContourRepresentation
48 {
49 public:
54 
56 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
69  void SetCursorShape(vtkPolyData* cursorShape);
72 
74 
79  void SetActiveCursorShape(vtkPolyData* activeShape);
82 
84 
88  vtkGetObjectMacro(Property, vtkProperty2D);
90 
92 
96  vtkGetObjectMacro(ActiveProperty, vtkProperty2D);
98 
100 
103  vtkGetObjectMacro(LinesProperty, vtkProperty2D);
105 
107 
112  void SetRenderer(vtkRenderer* ren) override;
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 modified = 0) override;
118 
120 
125  int RenderOverlay(vtkViewport* viewport) override;
126  int RenderOpaqueGeometry(vtkViewport* viewport) override;
130 
135 
144 
145 protected:
148 
149  // Render the cursor
162 
163  // The polydata represents the contour in display co-ordinates.
167 
168  // The polydata represents the contour in world coordinates. It is updated
169  // (kept in sync with Lines) every time the GetContourRepresentationAsPolyData()
170  // method is called.
172 
173  // Support picking
174  double LastPickPosition[3];
175  double LastEventPosition[2];
176 
177  // Methods to manipulate the cursor
178  void Translate(double eventPos[2]);
179  void Scale(double eventPos[2]);
180  void ShiftContour(double eventPos[2]);
181  void ScaleContour(double eventPos[2]);
182 
183  void ComputeCentroid(double* ioCentroid);
184 
185  // Properties used to control the appearance of selected objects and
186  // the manipulator in general.
190 
192 
194 
195  // Distance between where the mouse event happens and where the
196  // widget is focused - maintain this distance during interaction.
197  double InteractionOffset[2];
198 
199  void BuildLines() override;
200 
201 private:
204  void operator=(const vtkOrientedGlyphFocalPlaneContourRepresentation&) = delete;
205 };
206 
207 VTK_ABI_NAMESPACE_END
208 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:156
represent a contour drawn on the focal plane.
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:73
a simple class to control print indentation
Definition: vtkIndent.h:120
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:152
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:150
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:201
an ordered list of Props
represent surface properties of a 2D image
abstract specification for renderers
Definition: vtkRenderer.h:183
abstract specification for Viewports
Definition: vtkViewport.h:57
window superclass for vtkRenderWindow
Definition: vtkWindow.h:40
int vtkTypeBool
Definition: vtkABI.h:71