VTK  9.2.6
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 class vtkProperty;
77 class vtkActor;
78 class vtkPolyDataMapper;
79 class vtkPolyData;
80 class vtkGlyph3D;
81 class vtkPoints;
82 
83 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
85 {
86 public:
91 
93 
97  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
101 
106  void SetCursorShape(vtkPolyData* cursorShape);
109 
111 
116  void SetActiveCursorShape(vtkPolyData* activeShape);
119 
121 
125  vtkGetObjectMacro(Property, vtkProperty);
127 
129 
133  vtkGetObjectMacro(ActiveProperty, vtkProperty);
135 
137 
140  vtkGetObjectMacro(LinesProperty, vtkProperty);
142 
144 
149  void SetRenderer(vtkRenderer* ren) override;
150  void BuildRepresentation() override;
151  void StartWidgetInteraction(double eventPos[2]) override;
152  void WidgetInteraction(double eventPos[2]) override;
153  int ComputeInteractionState(int X, int Y, int modified = 0) override;
155 
157 
160  void GetActors(vtkPropCollection*) override;
162  int RenderOverlay(vtkViewport* viewport) override;
163  int RenderOpaqueGeometry(vtkViewport* viewport) override;
167 
172 
174 
180  vtkSetMacro(AlwaysOnTop, vtkTypeBool);
181  vtkGetMacro(AlwaysOnTop, vtkTypeBool);
182  vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
184 
189  void SetLineColor(double r, double g, double b);
190 
196 
200  double* GetBounds() override;
201 
202 protected:
205 
206  // Render the cursor
219 
227 
231 
232  // Support picking
233  double LastPickPosition[3];
234  double LastEventPosition[2];
235 
236  // Methods to manipulate the cursor
237  void Translate(double eventPos[2]);
238  void Scale(double eventPos[2]);
239  void ShiftContour(double eventPos[2]);
240  void ScaleContour(double eventPos[2]);
241 
242  void ComputeCentroid(double* ioCentroid);
243 
244  // Properties used to control the appearance of selected objects and
245  // the manipulator in general.
250 
251  // Distance between where the mouse event happens and where the
252  // widget is focused - maintain this distance during interaction.
253  double InteractionOffset[2];
254 
256 
257  void BuildLines() override;
258 
259 private:
261  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
262 };
263 
264 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
represent the vtkContourWidget
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:222
a simple class to control print indentation
Definition: vtkIndent.h:119
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:149
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
an ordered list of Props
represent surface properties of a geometric object
Definition: vtkProperty.h:177
abstract specification for renderers
Definition: vtkRenderer.h:182
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkTypeBool
Definition: vtkABI.h:69