VTK: Common/Core/vtkDataArraySelection.h Source File

| VTK 9.3.1

vtkDataArraySelection.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
27 #ifndef vtkDataArraySelection_h
28 #define vtkDataArraySelection_h
29
30 #include "vtkCommonCoreModule.h" // For export macro
31 #include "vtkObject.h"
32
33 #include <memory> // for std::unique_ptr
34
35 VTK_ABI_NAMESPACE_BEGIN
36 class VTKCOMMONCORE_EXPORT vtkDataArraySelection : public vtkObject
37 {
38 public:
39 vtkTypeMacro(vtkDataArraySelection, vtkObject);
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41 static vtkDataArraySelection* New();
42
50 void EnableArray(const char* name);
51
59 void DisableArray(const char* name);
60
65 int ArrayIsEnabled(const char* name) const;
66
70 int ArrayExists(const char* name) const;
71
78 void EnableAllArrays();
79
86 void DisableAllArrays();
87
91 int GetNumberOfArrays() const;
92
96 int GetNumberOfArraysEnabled() const;
97
101 const char* GetArrayName(int index) const;
102
106 int GetArrayIndex(const char* name) const;
107
112 int GetEnabledArrayIndex(const char* name) const;
113
117 int GetArraySetting(int index) const;
118
122 int GetArraySetting(const char* name) const { return this->ArrayIsEnabled(name); }
123
131 void SetArraySetting(const char* name, int setting);
132
138 void RemoveAllArrays();
139
153 int AddArray(const char* name, bool state = true);
154
160 void RemoveArrayByIndex(int index);
161
167 void RemoveArrayByName(const char* name);
168
170
182 void SetArrays(const char* const* names, int numArrays);
183 void SetArraysWithDefault(const char* const* names, int numArrays, int defaultStatus);
185
191 void CopySelections(vtkDataArraySelection* selections);
192
194
203 void Union(vtkDataArraySelection* other) { this->Union(other, false); }
204 void Union(vtkDataArraySelection* other, bool skipModified);
206
208
213 vtkSetMacro(UnknownArraySetting, int);
214 vtkGetMacro(UnknownArraySetting, int);
216
221 void DeepCopy(const vtkDataArraySelection* other);
222
226 bool IsEqual(const vtkDataArraySelection* other) const;
227
228 protected:
229 vtkDataArraySelection();
230 ~vtkDataArraySelection() override;
231
232 private:
233 vtkDataArraySelection(const vtkDataArraySelection&) = delete;
234 void operator=(const vtkDataArraySelection&) = delete;
235
236 // Internal implementation details.
237 class vtkInternals;
238 std::unique_ptr<vtkInternals> Internal;
239 int UnknownArraySetting;
240 };
241
242 VTK_ABI_NAMESPACE_END
243 #endif
vtkDataArraySelection
Store on/off settings for data arrays, etc.
Definition: vtkDataArraySelection.h:37
vtkDataArraySelection::DisableArray
void DisableArray(const char *name)
Disable the array with the given name.
vtkDataArraySelection::DeepCopy
void DeepCopy(const vtkDataArraySelection *other)
Copy contents of other.
vtkDataArraySelection::IsEqual
bool IsEqual(const vtkDataArraySelection *other) const
Returns true if the two array selections are equivalent.
vtkDataArraySelection::GetEnabledArrayIndex
int GetEnabledArrayIndex(const char *name) const
Get the index of an array with the given name among those that are enabled.
vtkDataArraySelection::SetArraySetting
void SetArraySetting(const char *name, int setting)
Set array setting given the name.
vtkDataArraySelection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataArraySelection::GetNumberOfArrays
int GetNumberOfArrays() const
Get the number of arrays that currently have an entry.
vtkDataArraySelection::vtkDataArraySelection
vtkDataArraySelection()
vtkDataArraySelection::CopySelections
void CopySelections(vtkDataArraySelection *selections)
Copy the selections from the given vtkDataArraySelection instance.
vtkDataArraySelection::GetNumberOfArraysEnabled
int GetNumberOfArraysEnabled() const
Get the number of arrays that are enabled.
vtkDataArraySelection::EnableAllArrays
void EnableAllArrays()
Enable all arrays that currently have an entry.
vtkDataArraySelection::EnableArray
void EnableArray(const char *name)
Enable the array with the given name.
vtkDataArraySelection::AddArray
int AddArray(const char *name, bool state=true)
Add to the list of arrays that have entries.
vtkDataArraySelection::GetArraySetting
int GetArraySetting(int index) const
Get whether the array at the given index is enabled.
vtkDataArraySelection::GetArrayName
const char * GetArrayName(int index) const
Get the name of the array entry at the given index.
vtkDataArraySelection::RemoveArrayByIndex
void RemoveArrayByIndex(int index)
Remove an array setting given its index.
vtkDataArraySelection::SetArraysWithDefault
void SetArraysWithDefault(const char *const *names, int numArrays, int defaultStatus)
Set the list of arrays that have entries.
vtkDataArraySelection::ArrayIsEnabled
int ArrayIsEnabled(const char *name) const
Return whether the array with the given name is enabled.
vtkDataArraySelection::New
static vtkDataArraySelection * New()
vtkDataArraySelection::~vtkDataArraySelection
~vtkDataArraySelection() override
vtkDataArraySelection::RemoveArrayByName
void RemoveArrayByName(const char *name)
Remove an array setting given its name.
vtkDataArraySelection::ArrayExists
int ArrayExists(const char *name) const
Return whether the array with the given name exists.
vtkDataArraySelection::GetArrayIndex
int GetArrayIndex(const char *name) const
Get an index of the array with the given name.
vtkDataArraySelection::Union
void Union(vtkDataArraySelection *other, bool skipModified)
Update this to include values from other.
vtkDataArraySelection::DisableAllArrays
void DisableAllArrays()
Disable all arrays that currently have an entry.
vtkDataArraySelection::SetArrays
void SetArrays(const char *const *names, int numArrays)
Set the list of arrays that have entries.
vtkDataArraySelection::Union
void Union(vtkDataArraySelection *other)
Update this to include values from other.
Definition: vtkDataArraySelection.h:203
vtkDataArraySelection::RemoveAllArrays
void RemoveAllArrays()
Remove all array entries.
vtkDataArraySelection::GetArraySetting
int GetArraySetting(const char *name) const
Get whether the array is enabled/disable using its name.
Definition: vtkDataArraySelection.h:122
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkObject.h