VTK  9.2.20230320
vtkOrientedGlyphContourRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOrientedGlyphContourRepresentation.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 =========================================================================*/
70 #ifndef vtkOrientedGlyphContourRepresentation_h
71 #define vtkOrientedGlyphContourRepresentation_h
72 
74 #include "vtkInteractionWidgetsModule.h" // For export macro
75 
76 VTK_ABI_NAMESPACE_BEGIN
77 class vtkProperty;
78 class vtkActor;
79 class vtkPolyDataMapper;
80 class vtkPolyData;
81 class vtkGlyph3D;
82 class vtkPoints;
83 
84 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
86 {
87 public:
92 
94 
98  void PrintSelf(ostream& os, vtkIndent indent) override;
100 
102 
107  void SetCursorShape(vtkPolyData* cursorShape);
110 
112 
117  void SetActiveCursorShape(vtkPolyData* activeShape);
120 
122 
126  vtkGetObjectMacro(Property, vtkProperty);
128 
130 
134  vtkGetObjectMacro(ActiveProperty, vtkProperty);
136 
138 
141  vtkGetObjectMacro(LinesProperty, vtkProperty);
143 
145 
150  void SetRenderer(vtkRenderer* ren) override;
151  void BuildRepresentation() override;
152  void StartWidgetInteraction(double eventPos[2]) override;
153  void WidgetInteraction(double eventPos[2]) override;
154  int ComputeInteractionState(int X, int Y, int modified = 0) override;
156 
158 
161  void GetActors(vtkPropCollection*) override;
163  int RenderOverlay(vtkViewport* viewport) override;
164  int RenderOpaqueGeometry(vtkViewport* viewport) override;
168 
173 
175 
181  vtkSetMacro(AlwaysOnTop, vtkTypeBool);
182  vtkGetMacro(AlwaysOnTop, vtkTypeBool);
183  vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
185 
190  void SetLineColor(double r, double g, double b);
191 
197 
201  double* GetBounds() override;
202 
203 protected:
206 
207  // Render the cursor
220 
228 
232 
233  // Support picking
234  double LastPickPosition[3];
235  double LastEventPosition[2];
236 
237  // Methods to manipulate the cursor
238  void Translate(double eventPos[2]);
239  void Scale(double eventPos[2]);
240  void ShiftContour(double eventPos[2]);
241  void ScaleContour(double eventPos[2]);
242 
243  void ComputeCentroid(double* ioCentroid);
244 
245  // Properties used to control the appearance of selected objects and
246  // the manipulator in general.
251 
252  // Distance between where the mouse event happens and where the
253  // widget is focused - maintain this distance during interaction.
254  double InteractionOffset[2];
255 
257 
258  void BuildLines() override;
259 
260 private:
262  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
263 };
264 
265 VTK_ABI_NAMESPACE_END
266 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:162
represent the vtkContourWidget
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:223
a simple class to control print indentation
Definition: vtkIndent.h:120
Default representation for the contour widget.
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
int ComputeInteractionState(int X, int Y, int modified=0) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
vtkPolyData * GetCursorShape()
Specify the cursor shape.
void BuildRepresentation() override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
void ShiftContour(double eventPos[2])
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
void ScaleContour(double eventPos[2])
void SetActiveCursorShape(vtkPolyData *activeShape)
Specify the shape of the cursor (handle) when it is active.
vtkPolyData * GetContourRepresentationAsPolyData() override
Get the points in this contour as a vtkPolyData.
void SetRenderer(vtkRenderer *ren) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
int RenderOverlay(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void SetShowSelectedNodes(vtkTypeBool) override
A flag to indicate whether to show the Selected nodes Default is to set it to false.
void WidgetInteraction(double eventPos[2]) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void ComputeCentroid(double *ioCentroid)
void Scale(double eventPos[2])
void Translate(double eventPos[2])
vtkPolyData * GetActiveCursorShape()
Specify the shape of the cursor (handle) when it is active.
static vtkOrientedGlyphContourRepresentation * New()
Instantiate this class.
void SetCursorShape(vtkPolyData *cursorShape)
Specify the cursor shape.
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
void StartWidgetInteraction(double eventPos[2]) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
void SetLineColor(double r, double g, double b)
Convenience method to set the line color.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
double * GetBounds() override
Return the bounds of the representation.
represent and manipulate 3D points
Definition: vtkPoints.h:150
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:201
an ordered list of Props
represent surface properties of a geometric object
Definition: vtkProperty.h:178
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