VTK  9.1.0
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 =========================================================================*/
59 #ifndef vtkMaskFields_h
60 #define vtkMaskFields_h
61 
62 #include "vtkDataSetAlgorithm.h"
63 #include "vtkFiltersCoreModule.h" // For export macro
64 
65 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
66 
67 class vtkDataSet;
68 
69 class VTKFILTERSCORE_EXPORT vtkMaskFields : public vtkDataSetAlgorithm
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
78  static vtkMaskFields* New();
79 
95  void CopyFieldOn(int fieldLocation, const char* name)
96  {
97  this->CopyFieldOnOff(fieldLocation, name, 1);
98  }
99  void CopyFieldOff(int fieldLocation, const char* name)
100  {
101  this->CopyFieldOnOff(fieldLocation, name, 0);
102  }
103 
119  void CopyAttributeOn(int attributeLocation, int attributeType)
120  {
121  this->CopyAttributeOnOff(attributeLocation, attributeType, 1);
122  }
123  void CopyAttributeOff(int attributeLocation, int attributeType)
124  {
125  this->CopyAttributeOnOff(attributeLocation, attributeType, 0);
126  }
127 
132  void CopyFieldsOff() { this->CopyFields = 0; }
133  void CopyAttributesOff() { this->CopyAttributes = 0; }
134 
135  void CopyFieldsOn() { this->CopyFields = 1; }
136  void CopyAttributesOn() { this->CopyAttributes = 1; }
137 
139 
143  void CopyAttributeOn(const char* attributeLoc, const char* attributeType);
144  void CopyAttributeOff(const char* attributeLoc, const char* attributeType);
145  void CopyFieldOn(const char* fieldLoc, const char* name);
146  void CopyFieldOff(const char* fieldLoc, const char* name);
148 
158  virtual void CopyAllOn();
159 
169  virtual void CopyAllOff();
170 
172  {
173  OBJECT_DATA = 0,
174  POINT_DATA = 1,
175  CELL_DATA = 2
176  };
177 
178 protected:
180  ~vtkMaskFields() override;
181 
183 
185  {
186  char* Name;
187  int Type;
188  int Location;
189  int IsCopied;
190  };
191 
192  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
193  int NumberOfFieldFlags; // the number of fields not to be copied
194  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
195  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
197  int FindFlag(const char* field, int location);
198  int FindFlag(int arrayType, int location);
199  int GetFlag(const char* field, int location);
200  int GetFlag(int arrayType, int location);
201  int GetAttributeLocation(const char* loc);
202  int GetAttributeType(const char* type);
203 
206 
207  static char FieldLocationNames[3][12];
208  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
209 
210 private:
211  vtkMaskFields(const vtkMaskFields&) = delete;
212  void operator=(const vtkMaskFields&) = delete;
213 };
214 
215 #endif
vtkMaskFields::GetFlag
int GetFlag(const char *field, int location)
vtkMaskFields::CopyFieldsOn
void CopyFieldsOn()
Definition: vtkMaskFields.h:135
vtkMaskFields::NumberOfFieldFlags
int NumberOfFieldFlags
Definition: vtkMaskFields.h:193
vtkMaskFields::CopyAttributeOnOff
void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff)
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:119
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkMaskFields::CopyFieldFlag::IsCopied
int IsCopied
Definition: vtkMaskFields.h:189
vtkMaskFields::GetFlag
int GetFlag(int arrayType, int location)
vtkMaskFields::FindFlag
int FindFlag(const char *field, int location)
vtkMaskFields::vtkMaskFields
vtkMaskFields()
vtkMaskFields::GetAttributeLocation
int GetAttributeLocation(const char *loc)
vtkMaskFields::CopyAttributeOff
void CopyAttributeOff(const char *attributeLoc, const char *attributeType)
Helper methods used by other language bindings.
vtkMaskFields::CopyAttributes
int CopyAttributes
Definition: vtkMaskFields.h:205
vtkMaskFields::CopyFieldsOff
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
Definition: vtkMaskFields.h:132
vtkMaskFields::~vtkMaskFields
~vtkMaskFields() override
vtkMaskFields::CopyAttributesOff
void CopyAttributesOff()
Definition: vtkMaskFields.h:133
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:49
vtkMaskFields::CopyFieldFlags
CopyFieldFlag * CopyFieldFlags
Definition: vtkMaskFields.h:192
vtkMaskFields::FindFlag
int FindFlag(int arrayType, int location)
vtkMaskFields::CopyAllOn
virtual void CopyAllOn()
Turn on copying of all data.
vtkMaskFields::CopyFieldOnOff
void CopyFieldOnOff(int fieldLocation, const char *name, int onOff)
vtkMaskFields::CopyAttributeOn
void CopyAttributeOn(const char *attributeLoc, const char *attributeType)
Helper methods used by other language bindings.
vtkMaskFields::New
static vtkMaskFields * New()
Create a new vtkMaskFields.
vtkMaskFields::CopyFieldOn
void CopyFieldOn(const char *fieldLoc, const char *name)
Helper methods used by other language bindings.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkX3D::field
@ field
Definition: vtkX3D.h:183
vtkMaskFields::GetAttributeType
int GetAttributeType(const char *type)
vtkMaskFields::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMaskFields::CopyFieldOff
void CopyFieldOff(const char *fieldLoc, const char *name)
Helper methods used by other language bindings.
vtkMaskFields
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:70
vtkMaskFields::CopyFieldFlag::Name
char * Name
Definition: vtkMaskFields.h:186
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkDataSetAlgorithm.h
vtkMaskFields::CopyFieldOff
void CopyFieldOff(int fieldLocation, const char *name)
Definition: vtkMaskFields.h:99
vtkMaskFields::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkMaskFields::CopyAllOff
virtual void CopyAllOff()
Turn off copying of all data.
vtkX3D::location
@ location
Definition: vtkX3D.h:412
vtkMaskFields::CopyFields
int CopyFields
Definition: vtkMaskFields.h:204
vtkMaskFields::CopyFieldFlag::Location
int Location
Definition: vtkMaskFields.h:188
vtkMaskFields::FieldLocation
FieldLocation
Definition: vtkMaskFields.h:172
vtkMaskFields::CopyFieldOn
void CopyFieldOn(int fieldLocation, const char *name)
Turn on/off the copying of the field or specified by name.
Definition: vtkMaskFields.h:95
vtkMaskFields::CopyFieldFlag
Definition: vtkMaskFields.h:185
vtkMaskFields::CopyAttributeOff
void CopyAttributeOff(int attributeLocation, int attributeType)
Definition: vtkMaskFields.h:123
vtkMaskFields::CopyAttributesOn
void CopyAttributesOn()
Definition: vtkMaskFields.h:136
vtkMaskFields::CopyFieldFlag::Type
int Type
Definition: vtkMaskFields.h:187
vtkMaskFields::ClearFieldFlags
void ClearFieldFlags()
vtkDataSetAttributes.h
vtkDataSetAttributes::NUM_ATTRIBUTES
@ NUM_ATTRIBUTES
Definition: vtkDataSetAttributes.h:224