VTK  9.3.1
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);
58  vtkPolyData* GetCursorShape();
60 
62 
67  void SetActiveCursorShape(vtkPolyData* activeShape);
68  vtkPolyData* GetActiveCursorShape();
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 
111  void GetActors2D(vtkPropCollection*) override;
112  void ReleaseGraphicsResources(vtkWindow*) override;
113  int RenderOverlay(vtkViewport* viewport) override;
114  int RenderOpaqueGeometry(vtkViewport* viewport) override;
115  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
118 
123 
131  vtkMatrix4x4* GetContourPlaneDirectionCosines(const double origin[3]);
132 
133 protected:
136 
137  // Render the cursor
150 
151  // The polydata represents the contour in display co-ordinates.
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 
181  void CreateDefaultProperties();
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
int RenderOverlay(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:31
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
abstract specification for Viewports
Definition: vtkViewport.h:44
void GetActors2D(vtkPropCollection *) override
void BuildRepresentation() override=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual vtkPolyData * GetContourRepresentationAsPolyData()=0
Get the points in this contour as a vtkPolyData.
a actor that draws 2D data
Definition: vtkActor2D.h:34
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
abstract specification for renderers
Definition: vtkRenderer.h:61
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void ReleaseGraphicsResources(vtkWindow *w) override=0
Methods required by vtkProp superclass.
void WidgetInteraction(double e[2]) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void BuildLines()=0
represent a contour drawn on the focal plane.
vtkTypeBool HasTranslucentPolygonalGeometry() override=0
Methods required by vtkProp superclass.
void StartWidgetInteraction(double e[2]) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
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...
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:28
int ComputeInteractionState(int X, int Y, int modified=0) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
int RenderOpaqueGeometry(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.