VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30 
31 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkDataSet;
35 
36 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMaskFields : public vtkDataSetAlgorithm
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
45  static vtkMaskFields* New();
46 
62  void CopyFieldOn(int fieldLocation, const char* name)
63  {
64  this->CopyFieldOnOff(fieldLocation, name, 1);
65  }
66  void CopyFieldOff(int fieldLocation, const char* name)
67  {
68  this->CopyFieldOnOff(fieldLocation, name, 0);
69  }
70 
86  void CopyAttributeOn(int attributeLocation, int attributeType)
87  {
88  this->CopyAttributeOnOff(attributeLocation, attributeType, 1);
89  }
90  void CopyAttributeOff(int attributeLocation, int attributeType)
91  {
92  this->CopyAttributeOnOff(attributeLocation, attributeType, 0);
93  }
94 
99  void CopyFieldsOff() { this->CopyFields = 0; }
100  void CopyAttributesOff() { this->CopyAttributes = 0; }
101 
102  void CopyFieldsOn() { this->CopyFields = 1; }
103  void CopyAttributesOn() { this->CopyAttributes = 1; }
104 
106 
110  void CopyAttributeOn(const char* attributeLoc, const char* attributeType);
111  void CopyAttributeOff(const char* attributeLoc, const char* attributeType);
112  void CopyFieldOn(const char* fieldLoc, const char* name);
113  void CopyFieldOff(const char* fieldLoc, const char* name);
115 
125  virtual void CopyAllOn();
126 
136  virtual void CopyAllOff();
137 
139  {
140  OBJECT_DATA = 0,
141  POINT_DATA = 1,
142  CELL_DATA = 2
143  };
144 
145 protected:
146  vtkMaskFields();
147  ~vtkMaskFields() override;
148 
150 
152  {
153  char* Name;
154  int Type;
155  int Location;
156  int IsCopied;
157  };
158 
159  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
160  int NumberOfFieldFlags; // the number of fields not to be copied
161  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
162  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
163  void ClearFieldFlags();
164  int FindFlag(const char* field, int location);
165  int FindFlag(int arrayType, int location);
166  int GetFlag(const char* field, int location);
167  int GetFlag(int arrayType, int location);
168  int GetAttributeLocation(const char* loc);
169  int GetAttributeType(const char* type);
170 
173 
174  static char FieldLocationNames[3][12];
175  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
176 
177 private:
178  vtkMaskFields(const vtkMaskFields&) = delete;
179  void operator=(const vtkMaskFields&) = delete;
180 };
181 
182 VTK_ABI_NAMESPACE_END
183 #endif
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
void CopyAttributeOn(int attributeLocation, int attributeType)
Turn on/off the copying of the attribute or specified by vtkDataSetAttributes:AttributeTypes.
Definition: vtkMaskFields.h:86
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()
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:36
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:66
void CopyAttributeOff(int attributeLocation, int attributeType)
Definition: vtkMaskFields.h:90
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
Definition: vtkMaskFields.h:99
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:62
#define VTK_MARSHALAUTO
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()