VTK  9.2.6
vtkPointCloudRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPointCloudRepresentation.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=========================================================================*/
27#ifndef vtkPointCloudRepresentation_h
28#define vtkPointCloudRepresentation_h
29
30#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
31#include "vtkInteractionWidgetsModule.h" // For export macro
33
34class vtkActor;
37class vtkActor2D;
38class vtkCoordinate;
40class vtkProperty2D;
41class vtkPolyData;
42class vtkPicker;
43class vtkPointPicker;
44class vtkPointSet;
46struct vtkPointCloudPicker;
47
48class VTKINTERACTIONWIDGETS_EXPORT vtkPointCloudRepresentation : public vtkWidgetRepresentation
49{
50 friend struct vtkPointCloudPicker;
51
52public:
57
59
63 void PrintSelf(ostream& os, vtkIndent indent) override;
65
67
78
80
83 vtkGetObjectMacro(PointCloudActor, vtkActor);
84 vtkGetObjectMacro(PointCloudMapper, vtkPolyDataMapper);
86
91 vtkIdType GetPointId() { return this->PointId; }
92
94
98 const double* GetPointCoordinates() { return this->PointCoordinates; }
99 void GetPointCoordinates(double x[3])
100 {
101 x[0] = this->PointCoordinates[0];
102 x[1] = this->PointCoordinates[1];
103 x[2] = this->PointCoordinates[2];
104 }
106
108
112 vtkSetMacro(Highlighting, bool);
113 vtkGetMacro(Highlighting, bool);
114 vtkBooleanMacro(Highlighting, bool);
116
117 // Enums define the state of the representation relative to the mouse pointer
118 // position. Used by ComputeInteractionState() to communicate with the
119 // widget.
121 {
122 Outside = 0, // no points nor outline selected
123 OverOutline, // mouse is over the bounding box of the point cloud
124 Over, // mouse is over a point
125 Selecting // user has selected the point
126 };
127#if !defined(VTK_LEGACY_REMOVE)
128 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
130#endif
131
133
141 vtkSetClampMacro(InteractionState, int, Outside, Selecting);
143
145
148 double* GetBounds() VTK_SIZEHINT(6) override;
149 void BuildRepresentation() override {}
150 int ComputeInteractionState(int X, int Y, int modify = 0) override;
152
154
158 void GetActors(vtkPropCollection* pc) override;
159 void GetActors2D(vtkPropCollection* pc) override;
160 int RenderOpaqueGeometry(vtkViewport* viewport) override;
166
168
187 {
188 HARDWARE_PICKING = 0,
189 SOFTWARE_PICKING
190 };
191#if !defined(VTK_LEGACY_REMOVE)
192 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
194#endif
195 vtkSetClampMacro(PickingMode, int, HARDWARE_PICKING, SOFTWARE_PICKING);
196 vtkGetMacro(PickingMode, int);
197 void SetPickingModeToHardware() { this->SetPickingMode(HARDWARE_PICKING); }
198 void SetPickingModeToSoftware() { this->SetPickingMode(SOFTWARE_PICKING); }
200
202
212 vtkSetMacro(HardwarePickingTolerance, unsigned int);
213 vtkGetMacro(HardwarePickingTolerance, unsigned int);
215
217
225 vtkSetClampMacro(SoftwarePickingTolerance, double, 0.0, 100.0);
226 vtkGetMacro(SoftwarePickingTolerance, double);
228
229 /*
230 * Register internal Pickers within PickingManager
231 */
232 void RegisterPickers() override;
233
234protected:
237
238 // The point cloud that is being operated on
242
243 // The selected point id and coordinates
245 double PointCoordinates[3];
246
247 // Data members to manage state
253 vtkPointCloudPicker* PointCloudPicker;
254
255 // Draw an outline around the point cloud
259
260 // Highlight the selected point
265
268
269private:
271 void operator=(const vtkPointCloudRepresentation&) = delete;
272};
273
274#endif
a actor that draws 2D data
Definition vtkActor2D.h:40
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
create 2D glyphs represented by vtkPolyData
a simple class to control print indentation
Definition vtkIndent.h:34
create wireframe outline for an arbitrary data set or composite dataset
superclass for 3D geometric pickers (uses ray cast)
Definition vtkPicker.h:59
represent the vtkPointCloudWidget
int RenderOpaqueGeometry(vtkViewport *viewport) override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
void GetActors2D(vtkPropCollection *pc) override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
static vtkPointCloudRepresentation * New()
Instantiate this class.
vtkIdType GetPointId()
Retrieve the point id from the selected point.
void GetPointCoordinates(double x[3])
Retrieve the point coordinates of the selected point.
void SetPickingModeToHardware()
Because point clouds can be very large, alternative point picking approaches can be used to select po...
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK class methods for obtaining type information and printing.
void ReleaseGraphicsResources(vtkWindow *) override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
void GetActors(vtkPropCollection *pc) override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
void PlacePointCloud(vtkPointSet *ps)
Specify and place either an actor (vtkActor) or a point set (vtkPointSet) that represents the point c...
int ComputeInteractionState(int X, int Y, int modify=0) override
Some methods required to satisfy the vtkWidgetRepresentation API.
PickingModeType
Because point clouds can be very large, alternative point picking approaches can be used to select po...
void PlacePointCloud(vtkActor *a)
Specify and place either an actor (vtkActor) or a point set (vtkPointSet) that represents the point c...
~vtkPointCloudRepresentation() override
const double * GetPointCoordinates()
Retrieve the point coordinates of the selected point.
double * GetBounds() override
Some methods required to satisfy the vtkWidgetRepresentation API.
vtkTypeBool HasTranslucentPolygonalGeometry() override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
int RenderOverlay(vtkViewport *) override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
void SetPickingModeToSoftware()
Because point clouds can be very large, alternative point picking approaches can be used to select po...
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
select a point by shooting a ray into a graphics window
concrete class for storing a set of points
Definition vtkPointSet.h:67
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
an ordered list of Props
represent surface properties of a 2D image
abstract specification for Viewports
Definition vtkViewport.h:50
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)
int vtkIdType
Definition vtkType.h:332
#define VTK_SIZEHINT(...)