VTK  9.2.6
vtkOrientedGlyphContourRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOrientedGlyphContourRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkOrientedGlyphContourRepresentation_h
32 #define vtkOrientedGlyphContourRepresentation_h
33 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
36 
37 class vtkProperty;
38 class vtkActor;
39 class vtkPolyDataMapper;
40 class vtkPolyData;
41 class vtkGlyph3D;
42 class vtkPoints;
43 
44 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
46 {
47 public:
52 
54 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
62 
67  void SetCursorShape(vtkPolyData* cursorShape);
68  vtkPolyData* GetCursorShape();
70 
72 
77  void SetActiveCursorShape(vtkPolyData* activeShape);
78  vtkPolyData* GetActiveCursorShape();
80 
82 
86  vtkGetObjectMacro(Property, vtkProperty);
88 
90 
94  vtkGetObjectMacro(ActiveProperty, vtkProperty);
96 
98 
101  vtkGetObjectMacro(LinesProperty, vtkProperty);
103 
105 
110  void SetRenderer(vtkRenderer* ren) override;
111  void BuildRepresentation() override;
112  void StartWidgetInteraction(double eventPos[2]) override;
113  void WidgetInteraction(double eventPos[2]) override;
114  int ComputeInteractionState(int X, int Y, int modified = 0) override;
116 
118 
121  void GetActors(vtkPropCollection*) override;
122  void ReleaseGraphicsResources(vtkWindow*) override;
123  int RenderOverlay(vtkViewport* viewport) override;
124  int RenderOpaqueGeometry(vtkViewport* viewport) override;
125  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
128 
133 
135 
141  vtkSetMacro(AlwaysOnTop, vtkTypeBool);
142  vtkGetMacro(AlwaysOnTop, vtkTypeBool);
143  vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
145 
150  void SetLineColor(double r, double g, double b);
151 
156  void SetShowSelectedNodes(vtkTypeBool) override;
157 
161  double* GetBounds() override;
162 
163 protected:
166 
167  // Render the cursor
180 
187  void CreateSelectedNodesRepresentation();
188 
192 
193  // Support picking
194  double LastPickPosition[3];
195  double LastEventPosition[2];
196 
197  // Methods to manipulate the cursor
198  void Translate(double eventPos[2]);
199  void Scale(double eventPos[2]);
200  void ShiftContour(double eventPos[2]);
201  void ScaleContour(double eventPos[2]);
202 
203  void ComputeCentroid(double* ioCentroid);
204 
205  // Properties used to control the appearance of selected objects and
206  // the manipulator in general.
210  void CreateDefaultProperties();
211 
212  // Distance between where the mouse event happens and where the
213  // widget is focused - maintain this distance during interaction.
214  double InteractionOffset[2];
215 
217 
218  void BuildLines() override;
219 
220 private:
222  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
223 };
224 
225 #endif
int RenderOverlay(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
abstract specification for Viewports
Definition: vtkViewport.h:55
represent surface properties of a geometric object
Definition: vtkProperty.h:67
void BuildRepresentation() override=0
These are methods that satisfy vtkWidgetRepresentation's API.
Default representation for the contour widget.
virtual vtkPolyData * GetContourRepresentationAsPolyData()=0
Get the points in this contour as a vtkPolyData.
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
abstract specification for renderers
Definition: vtkRenderer.h:72
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
void ReleaseGraphicsResources(vtkWindow *w) override=0
Methods required by vtkProp superclass.
void WidgetInteraction(double e[2]) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
represent the vtkContourWidget
double * GetBounds() override
Methods to make this class behave as a vtkProp.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void BuildLines()=0
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:112
vtkTypeBool HasTranslucentPolygonalGeometry() override=0
Methods required by vtkProp superclass.
map vtkPolyData to graphics primitives
void StartWidgetInteraction(double e[2]) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.
virtual void SetShowSelectedNodes(vtkTypeBool)
A flag to indicate whether to show the Selected nodes Default is to set it to false.
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:39
int ComputeInteractionState(int X, int Y, int modified=0) override=0
These are methods that satisfy vtkWidgetRepresentation's API.
int RenderOpaqueGeometry(vtkViewport *viewport) override=0
Methods required by vtkProp superclass.