VTK  9.0.3
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 =========================================================================*/
26 #ifndef vtkDataArraySelection_h
27 #define vtkDataArraySelection_h
28 
29 #include "vtkCommonCoreModule.h" // For export macro
30 #include "vtkObject.h"
31 
32 class vtkDataArraySelectionInternals;
33 
34 class VTKCOMMONCORE_EXPORT vtkDataArraySelection : public vtkObject
35 {
36 public:
38  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
48  void EnableArray(const char* name);
49 
57  void DisableArray(const char* name);
58 
63  int ArrayIsEnabled(const char* name) const;
64 
68  int ArrayExists(const char* name) const;
69 
77 
85 
89  int GetNumberOfArrays() const;
90 
95 
99  const char* GetArrayName(int index) const;
100 
104  int GetArrayIndex(const char* name) const;
105 
110  int GetEnabledArrayIndex(const char* name) const;
111 
115  int GetArraySetting(int index) const;
116 
120  int GetArraySetting(const char* name) const { return this->ArrayIsEnabled(name); }
121 
129  void SetArraySetting(const char* name, int status);
130 
137 
151  int AddArray(const char* name, bool state = true);
152 
159 
165  void RemoveArrayByName(const char* name);
166 
168 
180  void SetArrays(const char* const* names, int numArrays);
181  void SetArraysWithDefault(const char* const* names, int numArrays, int defaultStatus);
183 
190 
200 
202 
207  vtkSetMacro(UnknownArraySetting, int);
208  vtkGetMacro(UnknownArraySetting, int);
210 protected:
213 
214  // Internal implementation details.
215  vtkDataArraySelectionInternals* Internal;
216 
218 
219 private:
221  void operator=(const vtkDataArraySelection&) = delete;
222 };
223 
224 #endif
Store on/off settings for data arrays for a vtkSource.
void DisableArray(const char *name)
Disable the array with the given name.
int GetEnabledArrayIndex(const char *name) const
Get the index of an array with the given name among those that are enabled.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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.
int GetNumberOfArraysEnabled() const
Get the number of arrays that are enabled.
void SetArraySetting(const char *name, int status)
Set array setting given the name.
void EnableAllArrays()
Enable all arrays that currently have an entry.
vtkDataArraySelectionInternals * Internal
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.
const char * GetArrayName(int index) const
Get the name of the array entry at the given index.
void RemoveArrayByIndex(int index)
Remove an array setting given its index.
void SetArraysWithDefault(const char *const *names, int numArrays, int defaultStatus)
int ArrayIsEnabled(const char *name) const
Return whether the array with the given name is enabled.
static vtkDataArraySelection * New()
~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 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:63
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252