VTK  9.3.20240416
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
43 #ifndef vtkMaskFields_h
44 #define vtkMaskFields_h
45 
46 #include "vtkDataSetAlgorithm.h"
47 #include "vtkFiltersCoreModule.h" // For export macro
48 
49 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
50 
51 VTK_ABI_NAMESPACE_BEGIN
52 class vtkDataSet;
53 
54 class VTKFILTERSCORE_EXPORT vtkMaskFields : public vtkDataSetAlgorithm
55 {
56 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
63  static vtkMaskFields* New();
64 
80  void CopyFieldOn(int fieldLocation, const char* name)
81  {
82  this->CopyFieldOnOff(fieldLocation, name, 1);
83  }
84  void CopyFieldOff(int fieldLocation, const char* name)
85  {
86  this->CopyFieldOnOff(fieldLocation, name, 0);
87  }
88 
104  void CopyAttributeOn(int attributeLocation, int attributeType)
105  {
106  this->CopyAttributeOnOff(attributeLocation, attributeType, 1);
107  }
108  void CopyAttributeOff(int attributeLocation, int attributeType)
109  {
110  this->CopyAttributeOnOff(attributeLocation, attributeType, 0);
111  }
112 
117  void CopyFieldsOff() { this->CopyFields = 0; }
118  void CopyAttributesOff() { this->CopyAttributes = 0; }
119 
120  void CopyFieldsOn() { this->CopyFields = 1; }
121  void CopyAttributesOn() { this->CopyAttributes = 1; }
122 
124 
128  void CopyAttributeOn(const char* attributeLoc, const char* attributeType);
129  void CopyAttributeOff(const char* attributeLoc, const char* attributeType);
130  void CopyFieldOn(const char* fieldLoc, const char* name);
131  void CopyFieldOff(const char* fieldLoc, const char* name);
133 
143  virtual void CopyAllOn();
144 
154  virtual void CopyAllOff();
155 
157  {
158  OBJECT_DATA = 0,
159  POINT_DATA = 1,
160  CELL_DATA = 2
161  };
162 
163 protected:
165  ~vtkMaskFields() override;
166 
168 
170  {
171  char* Name;
172  int Type;
173  int Location;
174  int IsCopied;
175  };
176 
177  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
178  int NumberOfFieldFlags; // the number of fields not to be copied
179  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
180  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
182  int FindFlag(const char* field, int location);
183  int FindFlag(int arrayType, int location);
184  int GetFlag(const char* field, int location);
185  int GetFlag(int arrayType, int location);
186  int GetAttributeLocation(const char* loc);
187  int GetAttributeType(const char* type);
188 
191 
192  static char FieldLocationNames[3][12];
193  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
194 
195 private:
196  vtkMaskFields(const vtkMaskFields&) = delete;
197  void operator=(const vtkMaskFields&) = delete;
198 };
199 
200 VTK_ABI_NAMESPACE_END
201 #endif
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:55
virtual void CopyAllOff()
Turn off copying of all data.
static vtkMaskFields * New()
Create a new vtkMaskFields.
~vtkMaskFields() override
void CopyFieldOff(int fieldLocation, const char *name)
Definition: vtkMaskFields.h:84
void CopyFieldsOn()
int GetAttributeType(const char *type)
void CopyFieldOff(const char *fieldLoc, const char *name)
Helper methods used by other language bindings.
void CopyAttributeOff(int attributeLocation, int attributeType)
int GetFlag(int arrayType, int location)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CopyAttributesOn()
virtual void CopyAllOn()
Turn on copying of all data.
void CopyAttributeOn(int attributeLocation, int attributeType)
Turn on/off the copying of the attribute or specified by vtkDataSetAttributes:AttributeTypes.
void CopyAttributeOff(const char *attributeLoc, const char *attributeType)
Helper methods used by other language bindings.
void ClearFieldFlags()
int GetFlag(const char *field, int location)
void CopyFieldOnOff(int fieldLocation, const char *name, int onOff)
void CopyAttributeOn(const char *attributeLoc, const char *attributeType)
Helper methods used by other language bindings.
void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
CopyFieldFlag * CopyFieldFlags
int GetAttributeLocation(const char *loc)
void CopyFieldOn(const char *fieldLoc, const char *name)
Helper methods used by other language bindings.
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
int FindFlag(int arrayType, int location)
int FindFlag(const char *field, int location)
void CopyFieldOn(int fieldLocation, const char *name)
Turn on/off the copying of the field or specified by name.
Definition: vtkMaskFields.h:80
void CopyAttributesOff()
@ field
Definition: vtkX3D.h:177
@ location
Definition: vtkX3D.h:406
@ type
Definition: vtkX3D.h:516
@ name
Definition: vtkX3D.h:219