VTK  9.3.1
vtkOrientedGlyphContourRepresentation.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 vtkOrientedGlyphContourRepresentation_h
20 #define vtkOrientedGlyphContourRepresentation_h
21 
23 #include "vtkInteractionWidgetsModule.h" // For export macro
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkProperty;
27 class vtkActor;
28 class vtkPolyDataMapper;
29 class vtkPolyData;
30 class vtkGlyph3D;
31 class vtkPoints;
32 
33 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
35 {
36 public:
41 
43 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
56  void SetCursorShape(vtkPolyData* cursorShape);
57  vtkPolyData* GetCursorShape();
59 
61 
66  void SetActiveCursorShape(vtkPolyData* activeShape);
67  vtkPolyData* GetActiveCursorShape();
69 
71 
75  vtkGetObjectMacro(Property, vtkProperty);
77 
79 
83  vtkGetObjectMacro(ActiveProperty, vtkProperty);
85 
87 
90  vtkGetObjectMacro(LinesProperty, vtkProperty);
92 
94 
99  void SetRenderer(vtkRenderer* ren) override;
100  void BuildRepresentation() override;
101  void StartWidgetInteraction(double eventPos[2]) override;
102  void WidgetInteraction(double eventPos[2]) override;
103  int ComputeInteractionState(int X, int Y, int modified = 0) override;
105 
107 
110  void GetActors(vtkPropCollection*) override;
111  void ReleaseGraphicsResources(vtkWindow*) override;
112  int RenderOverlay(vtkViewport* viewport) override;
113  int RenderOpaqueGeometry(vtkViewport* viewport) override;
114  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
117 
122 
124 
130  vtkSetMacro(AlwaysOnTop, vtkTypeBool);
131  vtkGetMacro(AlwaysOnTop, vtkTypeBool);
132  vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
134 
139  void SetLineColor(double r, double g, double b);
140 
145  void SetShowSelectedNodes(vtkTypeBool) override;
146 
150  double* GetBounds() override;
151 
152 protected:
155 
156  // Render the cursor
169 
176  void CreateSelectedNodesRepresentation();
177 
181 
182  // Support picking
183  double LastPickPosition[3];
184  double LastEventPosition[2];
185 
186  // Methods to manipulate the cursor
187  void Translate(double eventPos[2]);
188  void Scale(double eventPos[2]);
189  void ShiftContour(double eventPos[2]);
190  void ScaleContour(double eventPos[2]);
191 
192  void ComputeCentroid(double* ioCentroid);
193 
194  // Properties used to control the appearance of selected objects and
195  // the manipulator in general.
199  void CreateDefaultProperties();
200 
201  // Distance between where the mouse event happens and where the
202  // widget is focused - maintain this distance during interaction.
203  double InteractionOffset[2];
204 
206 
207  void BuildLines() override;
208 
209 private:
211  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
212 };
213 
214 VTK_ABI_NAMESPACE_END
215 #endif
int RenderOverlay(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:56
void BuildRepresentation() override=0
These are methods that satisfy vtkWidgetRepresentation's API.
Default representation for the contour widget.
virtual vtkPolyData * GetContourRepresentationAsPolyData()=0
Get the points in this contour as a vtkPolyData.
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these 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.
represent the vtkContourWidget
double * GetBounds() override
Methods to make this class behave as a vtkProp.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void BuildLines()=0
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:101
vtkTypeBool HasTranslucentPolygonalGeometry() override=0
Methods required by vtkProp superclass.
map vtkPolyData to graphics primitives
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.
virtual void SetShowSelectedNodes(vtkTypeBool)
A flag to indicate whether to show the Selected nodes Default is to set it to false.
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
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.