VTK  9.6.2
vtkSelectionSource.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
51
52#ifndef vtkSelectionSource_h
53#define vtkSelectionSource_h
54
55#include "vtkFiltersSourcesModule.h" // For export macro
57#include "vtkSelectionNode.h" // For FieldType
58#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
59
60#include <memory> // for std::shared_ptr
61#include <vector> // for std::vector
62
63VTK_ABI_NAMESPACE_BEGIN
64class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkSelectionSource : public vtkSelectionAlgorithm
65{
66public:
69 void PrintSelf(ostream& os, vtkIndent indent) override;
70
72
77 void SetNumberOfNodes(unsigned int numberOfNodes);
78 unsigned int GetNumberOfNodes() { return static_cast<unsigned int>(this->NodesInfo.size()); }
80
82
85 void RemoveNode(unsigned int idx);
86 void RemoveNode(const char* name);
88
92 virtual void RemoveAllNodes();
93
95
107 vtkSetStdStringFromCharMacro(Expression);
108 vtkGetCharFromStdStringMacro(Expression);
110
112
125 enum FieldTypeOptions
126 {
129 };
130 vtkSetClampMacro(FieldTypeOption, int, FIELD_TYPE, ELEMENT_TYPE);
133 vtkGetMacro(FieldTypeOption, int);
135
137
144 vtkSetClampMacro(FieldType, int, vtkSelectionNode::CELL, vtkSelectionNode::ROW);
145 vtkGetMacro(FieldType, int);
147
149
157 vtkSetClampMacro(ElementType, int, vtkDataObject::POINT, vtkDataObject::ROW);
158 vtkGetMacro(ElementType, int);
160
162
168 vtkSetClampMacro(ProcessID, int, -1, VTK_INT_MAX);
169 vtkGetMacro(ProcessID, int);
171
172 //------------------------------------------------------------------------------
173 // Functions to manipulate the information of each selection node.
174 //------------------------------------------------------------------------------
175
177
186 void SetNodeName(unsigned int nodeId, const char* name);
187 void SetNodeName(const char* name) { this->SetNodeName(0, name); }
188 const char* GetNodeName(unsigned int nodeId);
189 const char* GetNodeName() { return this->GetNodeName(0); }
191
193
198 void AddID(unsigned int nodeId, vtkIdType piece, vtkIdType id);
199 void AddID(vtkIdType piece, vtkIdType id) { this->AddID(0, piece, id); }
200 void AddStringID(unsigned int nodeId, vtkIdType piece, const char* id);
201 void AddStringID(vtkIdType piece, const char* id) { this->AddStringID(0, piece, id); }
203
205
208 void AddLocation(unsigned int nodeId, double x, double y, double z);
209 void AddLocation(double x, double y, double z) { this->AddLocation(0, x, y, z); }
211
213
216 void AddThreshold(unsigned int nodeId, double min, double max);
217 void AddThreshold(double min, double max) { this->AddThreshold(0, min, max); }
219
221
224 void SetFrustum(unsigned int nodeId, double* vertices);
225 void SetFrustum(double* vertices) { this->SetFrustum(0, vertices); }
227
229
232 void AddBlock(unsigned int nodeId, vtkIdType block);
233 void AddBlock(vtkIdType blockno) { this->AddBlock(0, blockno); }
235
237
241 void AddBlockSelector(unsigned int nodeId, const char* block);
242 void AddBlockSelector(const char* selector) { this->AddBlockSelector(0, selector); }
243 void RemoveAllBlockSelectors(unsigned int nodeId);
246
248
251 void RemoveAllIDs(unsigned int nodeId);
252 void RemoveAllIDs() { this->RemoveAllIDs(0); }
253 void RemoveAllStringIDs(unsigned int nodeId);
256
258
261 void RemoveAllThresholds(unsigned int nodeId);
264
266
269 void RemoveAllLocations(unsigned int nodeId);
272
274
277 void RemoveAllBlocks(unsigned int nodeId);
278 void RemoveAllBlocks() { this->RemoveAllBlocks(0); }
280
282
289 void SetContentType(unsigned int nodeId, int type);
290 void SetContentType(int contentType) { this->SetContentType(0, contentType); }
291 int GetContentTypeMinValue() { return vtkSelectionNode::SelectionContent::GLOBALIDS; }
292 int GetContentTypeMaxValue() { return vtkSelectionNode::SelectionContent::USER; }
293 int GetContentType(unsigned int nodeId);
294 int GetContentType() { return this->GetContentType(0); }
296
298
304 void SetContainingCells(unsigned int nodeId, vtkTypeBool containingCells);
305 void SetContainingCells(vtkTypeBool containingCells)
306 {
307 this->SetContainingCells(0, containingCells);
308 }
309 vtkTypeBool GetContainingCells(unsigned int nodeId);
312
314
319 void SetNumberOfLayers(unsigned int nodeId, int numberOfLayers);
320 void SetNumberOfLayers(int numberOfLayers) { this->SetNumberOfLayers(0, numberOfLayers); }
321 int GetNumberOfLayersMinValue() { return 0; }
323 int GetNumberOfLayers(unsigned int nodeId);
324 int GetNumberOfLayers() { return this->GetNumberOfLayers(0); }
326
328
333 void SetRemoveSeed(unsigned int nodeId, bool RemoveSeed);
334 void SetRemoveSeed(bool RemoveSeed) { this->SetRemoveSeed(0, RemoveSeed); }
335 bool GetRemoveSeed(unsigned int nodeId);
336 bool GetRemoveSeed() { return this->GetRemoveSeed(0); }
338
340
345 void SetRemoveIntermediateLayers(unsigned int nodeId, bool RemoveIntermediateLayers);
346 void SetRemoveIntermediateLayers(bool RemoveIntermediateLayers)
347 {
348 this->SetRemoveIntermediateLayers(0, RemoveIntermediateLayers);
349 }
350 bool GetRemoveIntermediateLayers(unsigned int nodeId);
353
355
360 void SetInverse(unsigned int nodeId, vtkTypeBool inverse);
361 void SetInverse(vtkTypeBool inverse) { this->SetInverse(0, inverse); }
362 vtkTypeBool GetInverse(unsigned int nodeId);
363 vtkTypeBool GetInverse() { return this->GetInverse(0); }
365
367
371 void SetArrayName(unsigned int nodeId, const char* name);
372 void SetArrayName(const char* name) { this->SetArrayName(0, name); }
373 const char* GetArrayName(unsigned int nodeId);
374 const char* GetArrayName() { return this->GetArrayName(0); }
376
378
383 void SetArrayComponent(unsigned int nodeId, int component);
384 void SetArrayComponent(int component) { this->SetArrayComponent(0, component); }
385 int GetArrayComponent(unsigned int nodeId);
386 int GetArrayComponent() { return this->GetArrayComponent(0); }
388
390
396 void SetCompositeIndex(unsigned int nodeId, int index);
397 void SetCompositeIndex(int compositeIndex) { this->SetCompositeIndex(0, compositeIndex); }
398 int GetCompositeIndex(unsigned int nodeId);
399 int GetCompositeIndex() { return this->GetCompositeIndex(0); }
401
403
410 void SetHierarchicalLevel(unsigned int nodeId, int level);
411 void SetHierarchicalLevel(int level) { this->SetHierarchicalLevel(0, level); }
412 int GetHierarchicalLevel(unsigned int nodeId);
414 void SetHierarchicalIndex(unsigned int nodeId, int index);
415 void SetHierarchicalIndex(int index) { this->SetHierarchicalIndex(0, index); }
416 int GetHierarchicalIndex(unsigned int nodeId);
419
421
426 void SetAssemblyName(unsigned int nodeId, const char* name);
427 void SetAssemblyName(const char* name) { this->SetAssemblyName(0, name); }
428 const char* GetAssemblyName(unsigned int nodeId);
429 const char* GetAssemblyName() { return this->GetAssemblyName(0); }
430 void AddSelector(unsigned int nodeId, const char* selector);
431 void AddSelector(const char* selector) { this->AddSelector(0, selector); }
432 void RemoveAllSelectors(unsigned int nodeId);
435
437
440 void SetQueryString(unsigned int nodeId, const char* queryString);
441 void SetQueryString(const char* query) { this->SetQueryString(0, query); }
442 const char* GetQueryString(unsigned int nodeId);
443 const char* GetQueryString() { return this->GetQueryString(0); }
445
446protected:
449
451 vtkInformationVector* outputVector) override;
453 vtkInformationVector* outputVector) override;
454
455 std::string Expression;
460 struct NodeInformation;
461 std::vector<std::shared_ptr<NodeInformation>> NodesInfo;
462
463private:
464 vtkSelectionSource(const vtkSelectionSource&) = delete;
465 void operator=(const vtkSelectionSource&) = delete;
466};
467
468VTK_ABI_NAMESPACE_END
469#endif
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Generate selection from given set of ids.
void SetNumberOfNodes(unsigned int numberOfNodes)
Set/Get the number of nodes that will be created for the generated selection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RemoveNode(const char *name)
Remove a selection node.
static vtkSelectionSource * New()
unsigned int GetNumberOfNodes()
Set/Get the number of nodes that will be created for the generated selection.
virtual void RemoveAllNodes()
Remove all selection nodes.
void RemoveNode(unsigned int idx)
Remove a selection node.
vtkSelectionSource FIELD_TYPE
Set/Get FieldTypeOption which is used to specify the selection field type for the selection.
int vtkTypeBool
Definition vtkABI.h:64
virtual bool GetInverse()
vtkAppendSelection vtkSelectionAlgorithm SetInverse(bool)
Determines whether the selection describes what to include or exclude.
std::pair< boost::graph_traits< vtkGraph * >::vertex_iterator, boost::graph_traits< vtkGraph * >::vertex_iterator > vertices(vtkGraph *g)
virtual int GetContentType()
Get or set the content type of the selection.
virtual char * GetQueryString()
Set/Get the query expression string.
virtual void SetContentType(int type)
Get or set the content type of the selection.
virtual void SetQueryString(const char *)
Set/Get the query expression string.
vtkTypeBool GetContainingCells()
int GetCompositeIndex()
int FieldTypeOption
bool GetRemoveIntermediateLayers()
**void AddID(vtkIdType piece, vtkIdType id)
**void SetAssemblyName(const char *name)
vtkSelectionSource()
int FieldType
**void SetRemoveIntermediateLayers(bool RemoveIntermediateLayers)
**void SetArrayName(const char *name)
void AddStringID(unsigned int nodeId, vtkIdType piece, const char *id)
**void AddBlockSelector(const char *selector)
**void RemoveAllBlocks()
**void SetArrayComponent(int component)
bool GetRemoveSeed()
std::string Expression
void RemoveAllBlockSelectors()
**void SetNumberOfLayers(int numberOfLayers)
int ProcessID
int GetHierarchicalIndex()
std::vector< std::shared_ptr< NodeInformation > > NodesInfo
void AddSelector(unsigned int nodeId, const char *selector)
const char * GetAssemblyName()
int GetContentTypeMaxValue()
virtual void SetFieldTypeOption(int)
int GetContentTypeMinValue()
void RemoveAllStringIDs()
virtual void SetFieldTypeOptionToElementType()
int GetArrayComponent()
**void SetFrustum(double *vertices)
int GetNumberOfLayersMinValue()
const char * GetArrayName()
**void RemoveAllThresholds()
int GetNumberOfLayersMaxValue()
**void SetContainingCells(vtkTypeBool containingCells)
**void SetNodeName(const char *name)
**void AddLocation(double x, double y, double z)
int GetHierarchicalLevel()
**void RemoveAllIDs()
void RemoveAllSelectors()
int GetNumberOfLayers()
virtual void SetFieldTypeOptionToFieldType()
**void SetHierarchicalLevel(int level)
**void AddThreshold(double min, double max)
**void AddBlock(vtkIdType blockno)
**void SetCompositeIndex(int compositeIndex)
~vtkSelectionSource() override
**void SetRemoveSeed(bool RemoveSeed)
const char * GetNodeName()
void SetHierarchicalIndex(unsigned int nodeId, int index)
int ElementType
**void RemoveAllLocations()
vtkSelectionSource ELEMENT_TYPE
int vtkIdType
Definition vtkType.h:368
#define VTK_INT_MAX
Definition vtkType.h:197
#define VTK_MARSHALAUTO
#define max(a, b)