VTK  9.7.20261007
vtkScivisSelector.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
3
47
48#ifndef vtkScivisSelector_h
49#define vtkScivisSelector_h
50
51#include "vtkNew.h" // For ivars
52#include "vtkObject.h"
53#include "vtkSelection.h" // For the smart pointer getter macro
54#include "vtkSmartPointer.h" // For ivars
55#include "vtkViewsScivisModule.h" // For export macro
56#include "vtkWeakPointer.h" // For ivars
57#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
58
59VTK_ABI_NAMESPACE_BEGIN
61class vtkScivisView;
62
63class VTKVIEWSSCIVIS_EXPORT VTK_MARSHALAUTO vtkScivisSelector : public vtkObject
64{
65public:
68 void PrintSelf(ostream& os, vtkIndent indent) override;
69
71
80 {
83 };
84 vtkSetClampMacro(Mode, int, SURFACE, FRUSTUM);
85 vtkGetMacro(Mode, int);
86 void SetModeToSurface() { this->SetMode(SURFACE); }
87 void SetModeToFrustum() { this->SetMode(FRUSTUM); }
89
91
97 void SetFieldAssociation(int assoc);
98 vtkGetMacro(FieldAssociation, int);
102
119 void SelectRegion(int x0, int y0, int x1, int y1, bool extend = false);
120
124 void Clear();
125
134 vtkGetSmartPointerMacro(CurrentSelection, vtkSelection);
135
137
147
148protected:
151
152private:
153 vtkScivisSelector(const vtkScivisSelector&) = delete;
154 void operator=(const vtkScivisSelector&) = delete;
155
160 void GenerateSelection(const int region[4], vtkSelection* selection);
161
163 vtkNew<vtkHardwareSelector> HardwareSelector;
164 vtkSmartPointer<vtkSelection> CurrentSelection;
165 int Mode;
166 int FieldAssociation;
167};
168
169VTK_ABI_NAMESPACE_END
170#endif
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:168
void Clear()
Drop the current selection, on every representation in the view.
void SetModeToSurface()
How a screen region becomes a selection.
void SetFieldAssociation(int assoc)
Whether cells or points are selected: one of vtkDataObject::FIELD_ASSOCIATION_CELLS,...
void SetView(vtkScivisView *view)
The view this selects in.
void SetModeToFrustum()
How a screen region becomes a selection.
SelectionModeType
How a screen region becomes a selection.
~vtkScivisSelector() override
void SelectRegion(int x0, int y0, int x1, int y1, bool extend=false)
Select the screen-space region bounded by the two corner points, exactly as an interactive rubber-ban...
virtual void SetMode(int)
How a screen region becomes a selection.
void SelectCells()
Whether cells or points are selected: one of vtkDataObject::FIELD_ASSOCIATION_CELLS,...
static vtkScivisSelector * New()
void SelectPoints()
Whether cells or points are selected: one of vtkDataObject::FIELD_ASSOCIATION_CELLS,...
vtkScivisView * GetView()
The view this selects in.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
A ready-made rendering assembly for scientific visualization.
data object that represents a "selection" in VTK.
Hold a reference to a vtkObjectBase instance.
a weak reference to a vtkObject.
#define VTK_MARSHALAUTO