forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkDataArraySelection.h
168 lines (138 loc) · 4.65 KB
/
vtkDataArraySelection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataArraySelection.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkDataArraySelection
* @brief Store on/off settings for data arrays for a vtkSource.
*
* vtkDataArraySelection can be used by vtkSource subclasses to store
* on/off settings for whether each vtkDataArray in its input should
* be passed in the source's output. This is primarily intended to
* allow file readers to configure what data arrays are read from the
* file.
*/
#ifndef vtkDataArraySelection_h
#define vtkDataArraySelection_h
#include "vtkCommonCoreModule.h" // For export macro
#include "vtkObject.h"
class vtkDataArraySelectionInternals;
class VTKCOMMONCORE_EXPORT vtkDataArraySelection : public vtkObject
{
public:
vtkTypeMacro(vtkDataArraySelection,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
static vtkDataArraySelection* New();
/**
* Enable the array with the given name. Creates a new entry if
* none exists.
*/
void EnableArray(const char* name);
/**
* Disable the array with the given name. Creates a new entry if
* none exists.
*/
void DisableArray(const char* name);
/**
* Return whether the array with the given name is enabled. If
* there is no entry, the array is assumed to be disabled.
*/
int ArrayIsEnabled(const char* name);
/**
* Return whether the array with the given name exists.
*/
int ArrayExists(const char* name);
/**
* Enable all arrays that currently have an entry.
*/
void EnableAllArrays();
/**
* Disable all arrays that currently have an entry.
*/
void DisableAllArrays();
/**
* Get the number of arrays that currently have an entry.
*/
int GetNumberOfArrays();
/**
* Get the number of arrays that are enabled.
*/
int GetNumberOfArraysEnabled();
/**
* Get the name of the array entry at the given index.
*/
const char* GetArrayName(int index);
/**
* Get an index of the array with the given name.
*/
int GetArrayIndex(const char *name);
/**
* Get the index of an array with the given name among those
* that are enabled. Returns -1 if the array is not enabled.
*/
int GetEnabledArrayIndex(const char* name);
//@{
/**
* Get whether the array at the given index is enabled.
*/
int GetArraySetting(const char* name)
{
return this->GetArraySetting(this->GetArrayIndex(name));
}
int GetArraySetting(int index);
//@}
/**
* Remove all array entries.
*/
void RemoveAllArrays();
/**
* Add to the list of arrays that have entries. For arrays that
* already have entries, the settings are untouched. For arrays
* that don't already have an entry, they are assumed to be enabled.
* This method should be called only by the filter owning this
* object.
*/
int AddArray(const char* name);
/**
* Remove an array setting given its index.
*/
void RemoveArrayByIndex(int index);
/**
* Remove an array setting given its name.
*/
void RemoveArrayByName(const char* name);
//@{
/**
* Set the list of arrays that have entries. For arrays that
* already have entries, the settings are copied. For arrays that
* don't already have an entry, they are assigned the given default
* status. If no default status is given, it is assumed to be on.
* There will be no more entries than the names given. This method
* should be called only by the filter owning this object. The
* signature with the default must have a different name due to a
* bug in the Borland C++ 5.5 compiler.
*/
void SetArrays(const char* const* names, int numArrays);
void SetArraysWithDefault(const char* const* names, int numArrays,
int defaultStatus);
//@}
/**
* Copy the selections from the given vtkDataArraySelection instance.
*/
void CopySelections(vtkDataArraySelection* selections);
protected:
vtkDataArraySelection();
~vtkDataArraySelection() VTK_OVERRIDE;
// Internal implementation details.
vtkDataArraySelectionInternals* Internal;
private:
vtkDataArraySelection(const vtkDataArraySelection&) VTK_DELETE_FUNCTION;
void operator=(const vtkDataArraySelection&) VTK_DELETE_FUNCTION;
};
#endif