VTK  9.3.20240328
vtkCellDistanceSelector.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
25 #ifndef vtkCellDistanceSelector_h
26 #define vtkCellDistanceSelector_h
27 
28 #include "vtkFiltersSelectionModule.h" // For export macro
29 #include "vtkSelectionAlgorithm.h"
30 #include "vtkSmartPointer.h" // For smart pointers
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDataSet;
34 class vtkSelection;
35 class vtkAlgorithmOutput;
36 class vtkDataArray;
37 
41 class VTKFILTERSSELECTION_EXPORT vtkCellDistanceSelector : public vtkSelectionAlgorithm
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
55  {
56  INPUT_MESH = 0,
57  INPUT_SELECTION = 1
58  };
59 
63  void SetInputMeshConnection(vtkAlgorithmOutput* in) { this->SetInputConnection(INPUT_MESH, in); }
64 
68  void SetInputMesh(vtkDataObject* obj) { this->SetInputData(INPUT_MESH, obj); }
69 
74  {
75  this->SetInputConnection(INPUT_SELECTION, in);
76  }
77 
81  void SetInputSelection(vtkSelection* obj) { this->SetInputData(INPUT_SELECTION, obj); }
82 
84 
87  vtkSetMacro(Distance, int);
88  vtkGetMacro(Distance, int);
90 
92 
95  vtkSetMacro(IncludeSeed, vtkTypeBool);
96  vtkGetMacro(IncludeSeed, vtkTypeBool);
97  vtkBooleanMacro(IncludeSeed, vtkTypeBool);
99 
101 
105  vtkSetMacro(AddIntermediate, vtkTypeBool);
106  vtkGetMacro(AddIntermediate, vtkTypeBool);
107  vtkBooleanMacro(AddIntermediate, vtkTypeBool);
109 
110 protected:
113 
115  vtkSelection* output, vtkSmartPointer<vtkDataArray> outIndices, int partNumber, int d);
116 
119 
124  int Distance;
125 
131 
137 
138 private:
140  void operator=(const vtkCellDistanceSelector&) = delete;
141 };
142 
143 VTK_ABI_NAMESPACE_END
144 #endif /* vtkCellDistanceSelector_h */
Proxy object to connect input/output ports.
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
Grows a selection, selecting neighbor cells, up to a user defined topological distance.
vtkTypeBool IncludeSeed
Decide whether seed cells are included in selection Default: 1.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void SetInputSelection(vtkSelection *obj)
A convenience method to set the input selection.
~vtkCellDistanceSelector() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInputMesh(vtkDataObject *obj)
A convenience method to set the input data object.
void SetInputMeshConnection(vtkAlgorithmOutput *in)
A convenience method to set the data object input connection to the producer output.
int Distance
Tological radius from seed cells to be used to select cells Default: 1.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
InputPorts
enumeration values to specify input port types
void SetInputSelectionConnection(vtkAlgorithmOutput *in)
A convenience method to set the selection input connection to the producer output.
void AddSelectionNode(vtkSelection *output, vtkSmartPointer< vtkDataArray > outIndices, int partNumber, int d)
static vtkCellDistanceSelector * New()
vtkTypeBool AddIntermediate
Decide whether at distance between 1 and Distance-1 are included in selection Default: 1.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
general representation of visualization data
abstract class to specify dataset behavior
Definition: vtkDataSet.h:165
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only Selection as output.
void SetInputData(vtkDataObject *obj)
Assign a data object as input.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:159
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
int vtkTypeBool
Definition: vtkABI.h:64