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 =========================================================================*/
39 #ifndef vtkDataArraySelection_h
40 #define vtkDataArraySelection_h
41 
42 #include "vtkCommonCoreModule.h" // For export macro
43 #include "vtkObject.h"
44 
45 #include <memory> // for std::unique_ptr
46 
47 class VTKCOMMONCORE_EXPORT vtkDataArraySelection : public vtkObject
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52  static vtkDataArraySelection* New();
53 
61  void EnableArray(const char* name);
62 
70  void DisableArray(const char* name);
71 
76  int ArrayIsEnabled(const char* name) const;
77 
81  int ArrayExists(const char* name) const;
82 
89  void EnableAllArrays();
90 
97  void DisableAllArrays();
98 
102  int GetNumberOfArrays() const;
103 
107  int GetNumberOfArraysEnabled() const;
108 
112  const char* GetArrayName(int index) const;
113 
117  int GetArrayIndex(const char* name) const;
118 
123  int GetEnabledArrayIndex(const char* name) const;
124 
128  int GetArraySetting(int index) const;
129 
133  int GetArraySetting(const char* name) const { return this->ArrayIsEnabled(name); }
134 
142  void SetArraySetting(const char* name, int setting);
143 
149  void RemoveAllArrays();
150 
164  int AddArray(const char* name, bool state = true);
165 
171  void RemoveArrayByIndex(int index);
172 
178  void RemoveArrayByName(const char* name);
179 
181 
193  void SetArrays(const char* const* names, int numArrays);
194  void SetArraysWithDefault(const char* const* names, int numArrays, int defaultStatus);
196 
202  void CopySelections(vtkDataArraySelection* selections);
203 
205 
214  void Union(vtkDataArraySelection* other) { this->Union(other, false); }
215  void Union(vtkDataArraySelection* other, bool skipModified);
217 
219 
224  vtkSetMacro(UnknownArraySetting, int);
225  vtkGetMacro(UnknownArraySetting, int);
227 
232  void DeepCopy(const vtkDataArraySelection* other);
233 
237  bool IsEqual(const vtkDataArraySelection* other) const;
238 
239 protected:
241  ~vtkDataArraySelection() override;
242 
243 private:
245  void operator=(const vtkDataArraySelection&) = delete;
246 
247  // Internal implementation details.
248  class vtkInternals;
249  std::unique_ptr<vtkInternals> Internal;
250  int UnknownArraySetting;
251 };
252 
253 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Union(vtkDataArraySelection *other)
Update this to include values from other.
a simple class to control print indentation
Definition: vtkIndent.h:39
int GetArraySetting(const char *name) const
Get whether the array is enabled/disable using its name.
Store on/off settings for data arrays, etc.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...