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 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkProperty;
27 class vtkActor;
28 class vtkPolyDataMapper;
29 class vtkPolyData;
30 class vtkGlyph3D;
31 class vtkPoints;
32 
33 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
35 {
36 public:
41 
43 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
56  void SetCursorShape(vtkPolyData* cursorShape);
59 
61 
66  void SetActiveCursorShape(vtkPolyData* activeShape);
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 
110  void GetActors(vtkPropCollection*) override;
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 
152 protected:
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 
209 private:
211  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
212 };
213 
214 VTK_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.
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: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:62
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:28
int vtkTypeBool
Definition: vtkABI.h:64