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
28 #ifndef vtkOrientedGlyphContourRepresentation_h
29 #define vtkOrientedGlyphContourRepresentation_h
30 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkProperty;
36 class vtkActor;
37 class vtkPolyDataMapper;
38 class vtkPolyData;
39 class vtkGlyph3D;
40 class vtkPoints;
41 
42 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
44 {
45 public:
50 
52 
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
65  void SetCursorShape(vtkPolyData* cursorShape);
68 
70 
75  void SetActiveCursorShape(vtkPolyData* activeShape);
78 
80 
84  vtkGetObjectMacro(Property, vtkProperty);
86 
88 
92  vtkGetObjectMacro(ActiveProperty, vtkProperty);
94 
96 
99  vtkGetObjectMacro(LinesProperty, vtkProperty);
101 
103 
108  void SetRenderer(vtkRenderer* ren) override;
109  void BuildRepresentation() override;
110  void StartWidgetInteraction(double eventPos[2]) override;
111  void WidgetInteraction(double eventPos[2]) override;
112  int ComputeInteractionState(int X, int Y, int modified = 0) override;
114 
116 
119  void GetActors(vtkPropCollection*) override;
121  int RenderOverlay(vtkViewport* viewport) override;
122  int RenderOpaqueGeometry(vtkViewport* viewport) override;
126 
131 
133 
139  vtkSetMacro(AlwaysOnTop, vtkTypeBool);
140  vtkGetMacro(AlwaysOnTop, vtkTypeBool);
141  vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
143 
148  void SetLineColor(double r, double g, double b);
149 
155 
159  double* GetBounds() override;
160 
161 protected:
164 
165  // Render the cursor
178 
186 
190 
191  // Support picking
192  double LastPickPosition[3];
193  double LastEventPosition[2];
194 
195  // Methods to manipulate the cursor
196  void Translate(double eventPos[2]);
197  void Scale(double eventPos[2]);
198  void ShiftContour(double eventPos[2]);
199  void ScaleContour(double eventPos[2]);
200 
201  void ComputeCentroid(double* ioCentroid);
202 
203  // Properties used to control the appearance of selected objects and
204  // the manipulator in general.
209 
210  // Distance between where the mouse event happens and where the
211  // widget is focused - maintain this distance during interaction.
212  double InteractionOffset[2];
213 
215 
216  void BuildLines() override;
217 
218 private:
220  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
221 };
222 
223 VTK_ABI_NAMESPACE_END
224 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
represent the vtkContourWidget
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
a simple class to control print indentation
Definition: vtkIndent.h:38
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:38
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
an ordered list of Props
represent surface properties of a geometric object
Definition: vtkProperty.h:66
abstract specification for renderers
Definition: vtkRenderer.h:71
abstract specification for Viewports
Definition: vtkViewport.h:54
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
int vtkTypeBool
Definition: vtkABI.h:64