VTK  9.2.6
vtkDataArraySelection.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDataArraySelection.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=========================================================================*/
36#ifndef vtkDataArraySelection_h
37#define vtkDataArraySelection_h
38
39#include "vtkCommonCoreModule.h" // For export macro
40#include "vtkObject.h"
41
42#include <memory> // for std::unique_ptr
43
44class VTKCOMMONCORE_EXPORT vtkDataArraySelection : public vtkObject
45{
46public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
50
58 void EnableArray(const char* name);
59
67 void DisableArray(const char* name);
68
73 int ArrayIsEnabled(const char* name) const;
74
78 int ArrayExists(const char* name) const;
79
87
95
99 int GetNumberOfArrays() const;
100
105
109 const char* GetArrayName(int index) const;
110
114 int GetArrayIndex(const char* name) const;
115
120 int GetEnabledArrayIndex(const char* name) const;
121
125 int GetArraySetting(int index) const;
126
130 int GetArraySetting(const char* name) const { return this->ArrayIsEnabled(name); }
131
139 void SetArraySetting(const char* name, int setting);
140
147
161 int AddArray(const char* name, bool state = true);
162
168 void RemoveArrayByIndex(int index);
169
175 void RemoveArrayByName(const char* name);
176
178
190 void SetArrays(const char* const* names, int numArrays);
191 void SetArraysWithDefault(const char* const* names, int numArrays, int defaultStatus);
193
200
202
211 void Union(vtkDataArraySelection* other) { this->Union(other, false); }
212 void Union(vtkDataArraySelection* other, bool skipModified);
214
216
221 vtkSetMacro(UnknownArraySetting, int);
222 vtkGetMacro(UnknownArraySetting, int);
224
229 void DeepCopy(const vtkDataArraySelection* other);
230
234 bool IsEqual(const vtkDataArraySelection* other) const;
235
236protected:
239
240private:
242 void operator=(const vtkDataArraySelection&) = delete;
243
244 // Internal implementation details.
245 class vtkInternals;
246 std::unique_ptr<vtkInternals> Internal;
247 int UnknownArraySetting;
248};
249
250#endif
Store on/off settings for data arrays, etc.
void DisableArray(const char *name)
Disable the array with the given name.
void DeepCopy(const vtkDataArraySelection *other)
Copy contents of other.
bool IsEqual(const vtkDataArraySelection *other) const
Returns true if the two array selections are equivalent.
int GetEnabledArrayIndex(const char *name) const
Get the index of an array with the given name among those that are enabled.
void SetArraySetting(const char *name, int setting)
Set array setting given the name.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetArrayName(int index) const
Get the name of the array entry at the given index.
int GetNumberOfArrays() const
Get the number of arrays that currently have an entry.
void CopySelections(vtkDataArraySelection *selections)
Copy the selections from the given vtkDataArraySelection instance.
static vtkDataArraySelection * New()
int GetNumberOfArraysEnabled() const
Get the number of arrays that are enabled.
void EnableAllArrays()
Enable all arrays that currently have an entry.
void EnableArray(const char *name)
Enable the array with the given name.
int AddArray(const char *name, bool state=true)
Add to the list of arrays that have entries.
int GetArraySetting(int index) const
Get whether the array at the given index is enabled.
void RemoveArrayByIndex(int index)
Remove an array setting given its index.
void SetArraysWithDefault(const char *const *names, int numArrays, int defaultStatus)
Set the list of arrays that have entries.
int ArrayIsEnabled(const char *name) const
Return whether the array with the given name is enabled.
~vtkDataArraySelection() override
void RemoveArrayByName(const char *name)
Remove an array setting given its name.
int ArrayExists(const char *name) const
Return whether the array with the given name exists.
int GetArrayIndex(const char *name) const
Get an index of the array with the given name.
void Union(vtkDataArraySelection *other, bool skipModified)
Update this to include values from other.
void DisableAllArrays()
Disable all arrays that currently have an entry.
void SetArrays(const char *const *names, int numArrays)
Set the list of arrays that have entries.
void Union(vtkDataArraySelection *other)
Update this to include values from other.
void RemoveAllArrays()
Remove all array entries.
int GetArraySetting(const char *name) const
Get whether the array is enabled/disable using its name.
a simple class to control print indentation
Definition vtkIndent.h:34
abstract base class for most VTK objects
Definition vtkObject.h:57