VTK  9.3.20240302
vtkOrientedGlyphFocalPlaneContourRepresentation.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
19 #ifndef vtkOrientedGlyphFocalPlaneContourRepresentation_h
20 #define vtkOrientedGlyphFocalPlaneContourRepresentation_h
21 
23 #include "vtkInteractionWidgetsModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkProperty2D;
27 class vtkActor2D;
29 class vtkPolyData;
30 class vtkGlyph2D;
31 class vtkPoints;
32 class vtkPolyData;
33 
34 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphFocalPlaneContourRepresentation
36 {
37 public:
42 
44 
48  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
57  void SetCursorShape(vtkPolyData* cursorShape);
60 
62 
67  void SetActiveCursorShape(vtkPolyData* activeShape);
70 
72 
76  vtkGetObjectMacro(Property, vtkProperty2D);
78 
80 
84  vtkGetObjectMacro(ActiveProperty, vtkProperty2D);
86 
88 
91  vtkGetObjectMacro(LinesProperty, vtkProperty2D);
93 
95 
100  void SetRenderer(vtkRenderer* ren) override;
101  void BuildRepresentation() override;
102  void StartWidgetInteraction(double eventPos[2]) override;
103  void WidgetInteraction(double eventPos[2]) override;
104  int ComputeInteractionState(int X, int Y, int modified = 0) override;
106 
108 
113  int RenderOverlay(vtkViewport* viewport) override;
114  int RenderOpaqueGeometry(vtkViewport* viewport) override;
118 
123 
132 
133 protected:
136 
137  // Render the cursor
150 
151  // The polydata represents the contour in display coordinates.
155 
156  // The polydata represents the contour in world coordinates. It is updated
157  // (kept in sync with Lines) every time the GetContourRepresentationAsPolyData()
158  // method is called.
160 
161  // Support picking
162  double LastPickPosition[3];
163  double LastEventPosition[2];
164 
165  // Methods to manipulate the cursor
166  void Translate(double eventPos[2]);
167  void Scale(double eventPos[2]);
168  void ShiftContour(double eventPos[2]);
169  void ScaleContour(double eventPos[2]);
170 
171  void ComputeCentroid(double* ioCentroid);
172 
173  // Properties used to control the appearance of selected objects and
174  // the manipulator in general.
178 
180 
182 
183  // Distance between where the mouse event happens and where the
184  // widget is focused - maintain this distance during interaction.
185  double InteractionOffset[2];
186 
187  void BuildLines() override;
188 
189 private:
192  void operator=(const vtkOrientedGlyphFocalPlaneContourRepresentation&) = delete;
193 };
194 
195 VTK_ABI_NAMESPACE_END
196 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:144
represent a contour drawn on the focal plane.
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:61
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:140
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 coordinates.
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: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
abstract specification for renderers
Definition: vtkRenderer.h:171
abstract specification for Viewports
Definition: vtkViewport.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
int vtkTypeBool
Definition: vtkABI.h:64