VTK  9.3.20240224
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 
64 VTK_ABI_NAMESPACE_BEGIN
65 class vtkProperty;
66 class vtkActor;
67 class vtkPolyDataMapper;
68 class vtkPolyData;
69 class vtkGlyph3D;
70 class vtkPoints;
71 
72 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
74 {
75 public:
80 
82 
86  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
90 
95  void SetCursorShape(vtkPolyData* cursorShape);
98 
100 
105  void SetActiveCursorShape(vtkPolyData* activeShape);
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 
149  void GetActors(vtkPropCollection*) override;
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 
191 protected:
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 
248 private:
250  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
251 };
252 
253 VTK_ABI_NAMESPACE_END
254 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:150
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.
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:138
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
an ordered list of Props
represent surface properties of a geometric object
Definition: vtkProperty.h:166
abstract specification for renderers
Definition: vtkRenderer.h:171
abstract specification for Viewports
Definition: vtkViewport.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
int vtkTypeBool
Definition: vtkABI.h:64