VTK  9.2.6
vtkMaskFields.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMaskFields.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 =========================================================================*/
36 #ifndef vtkMaskFields_h
37 #define vtkMaskFields_h
38 
39 #include "vtkDataSetAlgorithm.h"
40 #include "vtkFiltersCoreModule.h" // For export macro
41 
42 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
43 
44 class vtkDataSet;
45 
46 class VTKFILTERSCORE_EXPORT vtkMaskFields : public vtkDataSetAlgorithm
47 {
48 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  static vtkMaskFields* New();
56 
72  void CopyFieldOn(int fieldLocation, const char* name)
73  {
74  this->CopyFieldOnOff(fieldLocation, name, 1);
75  }
76  void CopyFieldOff(int fieldLocation, const char* name)
77  {
78  this->CopyFieldOnOff(fieldLocation, name, 0);
79  }
80 
96  void CopyAttributeOn(int attributeLocation, int attributeType)
97  {
98  this->CopyAttributeOnOff(attributeLocation, attributeType, 1);
99  }
100  void CopyAttributeOff(int attributeLocation, int attributeType)
101  {
102  this->CopyAttributeOnOff(attributeLocation, attributeType, 0);
103  }
104 
109  void CopyFieldsOff() { this->CopyFields = 0; }
110  void CopyAttributesOff() { this->CopyAttributes = 0; }
111 
112  void CopyFieldsOn() { this->CopyFields = 1; }
113  void CopyAttributesOn() { this->CopyAttributes = 1; }
114 
116 
120  void CopyAttributeOn(const char* attributeLoc, const char* attributeType);
121  void CopyAttributeOff(const char* attributeLoc, const char* attributeType);
122  void CopyFieldOn(const char* fieldLoc, const char* name);
123  void CopyFieldOff(const char* fieldLoc, const char* name);
125 
135  virtual void CopyAllOn();
136 
146  virtual void CopyAllOff();
147 
149  {
150  OBJECT_DATA = 0,
151  POINT_DATA = 1,
152  CELL_DATA = 2
153  };
154 
155 protected:
156  vtkMaskFields();
157  ~vtkMaskFields() override;
158 
160 
162  {
163  char* Name;
164  int Type;
165  int Location;
166  int IsCopied;
167  };
168 
169  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
170  int NumberOfFieldFlags; // the number of fields not to be copied
171  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
172  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
173  void ClearFieldFlags();
174  int FindFlag(const char* field, int location);
175  int FindFlag(int arrayType, int location);
176  int GetFlag(const char* field, int location);
177  int GetFlag(int arrayType, int location);
178  int GetAttributeLocation(const char* loc);
179  int GetAttributeType(const char* type);
180 
183 
184  static char FieldLocationNames[3][12];
185  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
186 
187 private:
188  vtkMaskFields(const vtkMaskFields&) = delete;
189  void operator=(const vtkMaskFields&) = delete;
190 };
191 
192 #endif
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
void CopyAttributeOn(int attributeLocation, int attributeType)
Turn on/off the copying of the attribute or specified by vtkDataSetAttributes:AttributeTypes.
Definition: vtkMaskFields.h:96
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:39
void CopyAttributesOff()
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:46
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:76
void CopyAttributeOff(int attributeLocation, int attributeType)
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
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:72
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()