VTK  9.0.1
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 =========================================================================*/
30 #ifndef vtkMaskFields_h
31 #define vtkMaskFields_h
32 
33 #include "vtkDataSetAlgorithm.h"
34 #include "vtkFiltersCoreModule.h" // For export macro
35 
36 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
37 
38 class vtkDataSet;
39 
40 class VTKFILTERSCORE_EXPORT vtkMaskFields : public vtkDataSetAlgorithm
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
49  static vtkMaskFields* New();
50 
66  void CopyFieldOn(int fieldLocation, const char* name)
67  {
68  this->CopyFieldOnOff(fieldLocation, name, 1);
69  }
70  void CopyFieldOff(int fieldLocation, const char* name)
71  {
72  this->CopyFieldOnOff(fieldLocation, name, 0);
73  }
74 
90  void CopyAttributeOn(int attributeLocation, int attributeType)
91  {
92  this->CopyAttributeOnOff(attributeLocation, attributeType, 1);
93  }
94  void CopyAttributeOff(int attributeLocation, int attributeType)
95  {
96  this->CopyAttributeOnOff(attributeLocation, attributeType, 0);
97  }
98 
103  void CopyFieldsOff() { this->CopyFields = 0; }
104  void CopyAttributesOff() { this->CopyAttributes = 0; }
105 
106  void CopyFieldsOn() { this->CopyFields = 1; }
107  void CopyAttributesOn() { this->CopyAttributes = 1; }
108 
110 
114  void CopyAttributeOn(const char* attributeLoc, const char* attributeType);
115  void CopyAttributeOff(const char* attributeLoc, const char* attributeType);
116  void CopyFieldOn(const char* fieldLoc, const char* name);
117  void CopyFieldOff(const char* fieldLoc, const char* name);
119 
129  virtual void CopyAllOn();
130 
140  virtual void CopyAllOff();
141 
143  {
144  OBJECT_DATA = 0,
145  POINT_DATA = 1,
146  CELL_DATA = 2
147  };
148 
149 protected:
150  vtkMaskFields();
151  ~vtkMaskFields() override;
152 
154 
156  {
157  char* Name;
158  int Type;
159  int Location;
160  int IsCopied;
161  };
162 
163  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
164  int NumberOfFieldFlags; // the number of fields not to be copied
165  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
166  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
167  void ClearFieldFlags();
168  int FindFlag(const char* field, int location);
169  int FindFlag(int arrayType, int location);
170  int GetFlag(const char* field, int location);
171  int GetFlag(int arrayType, int location);
172  int GetAttributeLocation(const char* loc);
173  int GetAttributeType(const char* type);
174 
177 
178  static char FieldLocationNames[3][12];
179  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
180 
181 private:
182  vtkMaskFields(const vtkMaskFields&) = delete;
183  void operator=(const vtkMaskFields&) = delete;
184 };
185 
186 #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:90
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:33
void CopyAttributesOff()
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:40
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:70
void CopyAttributeOff(int attributeLocation, int attributeType)
Definition: vtkMaskFields.h:94
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:66
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()