VTK  9.3.0
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
25VTK_ABI_NAMESPACE_BEGIN
26class vtkProperty;
27class vtkActor;
29class vtkPolyData;
30class vtkGlyph3D;
31class vtkPoints;
32
33class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
35{
36public:
41
43
47 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
56 void SetCursorShape(vtkPolyData* cursorShape);
59
61
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
112 int RenderOverlay(vtkViewport* viewport) override;
113 int RenderOpaqueGeometry(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
146
150 double* GetBounds() override;
151
152protected:
155
156 // Render the cursor
169
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.
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
209private:
211 void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
212};
213
214VTK_ABI_NAMESPACE_END
215#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:41
represent the vtkContourWidget
copy oriented and scaled glyph geometry to every input point
Definition vtkGlyph3D.h:102
a simple class to control print indentation
Definition vtkIndent.h:29
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.
void BuildRepresentation() override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
void ShiftContour(double eventPos[2])
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.
void ScaleContour(double eventPos[2])
void SetActiveCursorShape(vtkPolyData *activeShape)
Specify the shape of the cursor (handle) when it is active.
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.
vtkPolyData * GetContourRepresentationAsPolyData() override
Get the points in this contour as a vtkPolyData.
void SetShowSelectedNodes(vtkTypeBool) override
A flag to indicate whether to show the Selected nodes Default is to set it to false.
static vtkOrientedGlyphContourRepresentation * New()
Instantiate this class.
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])
void SetCursorShape(vtkPolyData *cursorShape)
Specify the cursor shape.
vtkPolyData * GetCursorShape()
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.
double * GetBounds() override
Return the bounds of the representation.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
represent and manipulate 3D points
Definition vtkPoints.h:29
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
an ordered list of Props
represent surface properties of a geometric object
Definition vtkProperty.h:57
abstract specification for renderers
Definition vtkRenderer.h:59
abstract specification for Viewports
Definition vtkViewport.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64