VTK  9.7.20260824
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
58VTK_ABI_NAMESPACE_BEGIN
60class vtkScivisView;
61
62class VTKVIEWSSCIVIS_EXPORT vtkScivisSelector : public vtkObject
63{
64public:
67 void PrintSelf(ostream& os, vtkIndent indent) override;
68
70
79 {
82 };
83 vtkSetClampMacro(Mode, int, SURFACE, FRUSTUM);
84 vtkGetMacro(Mode, int);
85 void SetModeToSurface() { this->SetMode(SURFACE); }
86 void SetModeToFrustum() { this->SetMode(FRUSTUM); }
88
90
96 void SetFieldAssociation(int assoc);
97 vtkGetMacro(FieldAssociation, int);
101
118 void SelectRegion(int x0, int y0, int x1, int y1, bool extend = false);
119
123 void Clear();
124
133 vtkGetSmartPointerMacro(CurrentSelection, vtkSelection);
134
136
146
147protected:
150
151private:
152 vtkScivisSelector(const vtkScivisSelector&) = delete;
153 void operator=(const vtkScivisSelector&) = delete;
154
159 void GenerateSelection(const int region[4], vtkSelection* selection);
160
162 vtkNew<vtkHardwareSelector> HardwareSelector;
163 vtkSmartPointer<vtkSelection> CurrentSelection;
164 int Mode;
165 int FieldAssociation;
166};
167
168VTK_ABI_NAMESPACE_END
169#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.