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
vtkMaskFields::CopyFieldsOn
void CopyFieldsOn()
Definition: vtkMaskFields.h:106
vtkMaskFields::NumberOfFieldFlags
int NumberOfFieldFlags
Definition: vtkMaskFields.h:164
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkMaskFields::CopyAttributeOn
void CopyAttributeOn(int attributeLocation, int attributeType)
Turn on/off the copying of the attribute or specified by vtkDataSetAttributes:AttributeTypes.
Definition: vtkMaskFields.h:90
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkMaskFields::CopyFieldFlag::IsCopied
int IsCopied
Definition: vtkMaskFields.h:160
vtkDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
Definition: vtkDataSetAlgorithm.h:176
vtkMaskFields::CopyAttributes
int CopyAttributes
Definition: vtkMaskFields.h:176
vtkMaskFields::CopyFieldsOff
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
Definition: vtkMaskFields.h:103
vtkMaskFields::CopyAttributesOff
void CopyAttributesOff()
Definition: vtkMaskFields.h:104
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:48
vtkMaskFields::CopyFieldFlags
CopyFieldFlag * CopyFieldFlags
Definition: vtkMaskFields.h:163
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkX3D::field
@ field
Definition: vtkX3D.h:183
vtkDataSetAlgorithm::New
static vtkDataSetAlgorithm * New()
vtkMaskFields
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:40
vtkMaskFields::CopyFieldFlag::Name
char * Name
Definition: vtkMaskFields.h:157
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkDataSetAlgorithm.h
vtkMaskFields::CopyFieldOff
void CopyFieldOff(int fieldLocation, const char *name)
Definition: vtkMaskFields.h:70
vtkDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::location
@ location
Definition: vtkX3D.h:412
vtkMaskFields::CopyFields
int CopyFields
Definition: vtkMaskFields.h:175
vtkMaskFields::CopyFieldFlag::Location
int Location
Definition: vtkMaskFields.h:159
vtkMaskFields::FieldLocation
FieldLocation
Definition: vtkMaskFields.h:142
vtkMaskFields::CopyFieldOn
void CopyFieldOn(int fieldLocation, const char *name)
Turn on/off the copying of the field or specified by name.
Definition: vtkMaskFields.h:66
vtkMaskFields::CopyFieldFlag
Definition: vtkMaskFields.h:155
vtkMaskFields::CopyAttributeOff
void CopyAttributeOff(int attributeLocation, int attributeType)
Definition: vtkMaskFields.h:94
vtkMaskFields::CopyAttributesOn
void CopyAttributesOn()
Definition: vtkMaskFields.h:107
vtkMaskFields::CopyFieldFlag::Type
int Type
Definition: vtkMaskFields.h:158
vtkDataSetAttributes.h
vtkDataSetAttributes::NUM_ATTRIBUTES
@ NUM_ATTRIBUTES
Definition: vtkDataSetAttributes.h:107