VTK  9.3.1
vtkMaskFields.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
24 #ifndef vtkMaskFields_h
25 #define vtkMaskFields_h
26 
27 #include "vtkDataSetAlgorithm.h"
28 #include "vtkFiltersCoreModule.h" // For export macro
29 
30 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDataSet;
34 
35 class VTKFILTERSCORE_EXPORT vtkMaskFields : public vtkDataSetAlgorithm
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  static vtkMaskFields* New();
45 
61  void CopyFieldOn(int fieldLocation, const char* name)
62  {
63  this->CopyFieldOnOff(fieldLocation, name, 1);
64  }
65  void CopyFieldOff(int fieldLocation, const char* name)
66  {
67  this->CopyFieldOnOff(fieldLocation, name, 0);
68  }
69 
85  void CopyAttributeOn(int attributeLocation, int attributeType)
86  {
87  this->CopyAttributeOnOff(attributeLocation, attributeType, 1);
88  }
89  void CopyAttributeOff(int attributeLocation, int attributeType)
90  {
91  this->CopyAttributeOnOff(attributeLocation, attributeType, 0);
92  }
93 
98  void CopyFieldsOff() { this->CopyFields = 0; }
99  void CopyAttributesOff() { this->CopyAttributes = 0; }
100 
101  void CopyFieldsOn() { this->CopyFields = 1; }
102  void CopyAttributesOn() { this->CopyAttributes = 1; }
103 
105 
109  void CopyAttributeOn(const char* attributeLoc, const char* attributeType);
110  void CopyAttributeOff(const char* attributeLoc, const char* attributeType);
111  void CopyFieldOn(const char* fieldLoc, const char* name);
112  void CopyFieldOff(const char* fieldLoc, const char* name);
114 
124  virtual void CopyAllOn();
125 
135  virtual void CopyAllOff();
136 
138  {
139  OBJECT_DATA = 0,
140  POINT_DATA = 1,
141  CELL_DATA = 2
142  };
143 
144 protected:
145  vtkMaskFields();
146  ~vtkMaskFields() override;
147 
149 
151  {
152  char* Name;
153  int Type;
154  int Location;
155  int IsCopied;
156  };
157 
158  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
159  int NumberOfFieldFlags; // the number of fields not to be copied
160  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
161  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
162  void ClearFieldFlags();
163  int FindFlag(const char* field, int location);
164  int FindFlag(int arrayType, int location);
165  int GetFlag(const char* field, int location);
166  int GetFlag(int arrayType, int location);
167  int GetAttributeLocation(const char* loc);
168  int GetAttributeType(const char* type);
169 
172 
173  static char FieldLocationNames[3][12];
174  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
175 
176 private:
177  vtkMaskFields(const vtkMaskFields&) = delete;
178  void operator=(const vtkMaskFields&) = delete;
179 };
180 
181 VTK_ABI_NAMESPACE_END
182 #endif
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
void CopyAttributeOn(int attributeLocation, int attributeType)
Turn on/off the copying of the attribute or specified by vtkDataSetAttributes:AttributeTypes.
Definition: vtkMaskFields.h:85
CopyFieldFlag * CopyFieldFlags
void CopyFieldsOn()
void CopyAttributesOn()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
void CopyAttributesOff()
Definition: vtkMaskFields.h:99
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:35
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
void CopyFieldOff(int fieldLocation, const char *name)
Definition: vtkMaskFields.h:65
void CopyAttributeOff(int attributeLocation, int attributeType)
Definition: vtkMaskFields.h:89
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
Definition: vtkMaskFields.h:98
Store zero or more vtkInformation instances.
void CopyFieldOn(int fieldLocation, const char *name)
Turn on/off the copying of the field or specified by name.
Definition: vtkMaskFields.h:61
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()