VTK  9.4.20241108
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
58#ifndef vtkOrientedGlyphContourRepresentation_h
59#define vtkOrientedGlyphContourRepresentation_h
60
62#include "vtkInteractionWidgetsModule.h" // For export macro
63
64VTK_ABI_NAMESPACE_BEGIN
65class vtkProperty;
66class vtkActor;
68class vtkPolyData;
69class vtkGlyph3D;
70class vtkPoints;
71
72class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
74{
75public:
80
82
86 void PrintSelf(ostream& os, vtkIndent indent) override;
88
90
95 void SetCursorShape(vtkPolyData* cursorShape);
98
100
108
110
114 vtkGetObjectMacro(Property, vtkProperty);
116
118
122 vtkGetObjectMacro(ActiveProperty, vtkProperty);
124
126
129 vtkGetObjectMacro(LinesProperty, vtkProperty);
131
133
138 void SetRenderer(vtkRenderer* ren) override;
139 void BuildRepresentation() override;
140 void StartWidgetInteraction(double eventPos[2]) override;
141 void WidgetInteraction(double eventPos[2]) override;
142 int ComputeInteractionState(int X, int Y, int modified = 0) override;
144
146
151 int RenderOverlay(vtkViewport* viewport) override;
152 int RenderOpaqueGeometry(vtkViewport* viewport) override;
156
161
163
169 vtkSetMacro(AlwaysOnTop, vtkTypeBool);
170 vtkGetMacro(AlwaysOnTop, vtkTypeBool);
171 vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
173
178 void SetLineColor(double r, double g, double b);
179
185
189 double* GetBounds() override;
190
191protected:
194
195 // Render the cursor
208
216
220
221 // Support picking
222 double LastPickPosition[3];
223 double LastEventPosition[2];
224
225 // Methods to manipulate the cursor
226 void Translate(double eventPos[2]);
227 void Scale(double eventPos[2]);
228 void ShiftContour(double eventPos[2]);
229 void ScaleContour(double eventPos[2]);
230
231 void ComputeCentroid(double* ioCentroid);
232
233 // Properties used to control the appearance of selected objects and
234 // the manipulator in general.
239
240 // Distance between where the mouse event happens and where the
241 // widget is focused - maintain this distance during interaction.
242 double InteractionOffset[2];
243
245
246 void BuildLines() override;
247
248private:
250 void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
251};
252
253VTK_ABI_NAMESPACE_END
254#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
represent the vtkContourWidget
copy oriented and scaled glyph geometry to every input point
Definition vtkGlyph3D.h:211
a simple class to control print indentation
Definition vtkIndent.h:108
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:139
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
an ordered list of Props
represent surface properties of a geometric object
abstract specification for renderers
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64