VTK
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 "vtkFiltersCoreModule.h" // For export macro
34 #include "vtkDataSetAlgorithm.h"
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) { this->CopyFieldOnOff(fieldLocation, name, 1); }
67  void CopyFieldOff(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 0); }
68 
69 
85  void CopyAttributeOn(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 1); }
86  void CopyAttributeOff(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 0); }
87 
92  void CopyFieldsOff() { this->CopyFields = 0; }
93  void CopyAttributesOff() { this->CopyAttributes = 0; }
94 
95  void CopyFieldsOn() { this->CopyFields = 1; }
96  void CopyAttributesOn() { this->CopyAttributes = 1; }
97 
99 
103  void CopyAttributeOn(const char* attributeLoc,
104  const char* attributeType);
105  void CopyAttributeOff(const char* attributeLoc,
106  const char* attributeType);
107  void CopyFieldOn(const char* fieldLoc,
108  const char* name);
109  void CopyFieldOff(const char* fieldLoc,
110  const char* name);
112 
122  virtual void CopyAllOn();
123 
133  virtual void CopyAllOff();
134 
136  {
137  OBJECT_DATA=0,
138  POINT_DATA=1,
139  CELL_DATA=2
140  };
141 
142 protected:
143  vtkMaskFields();
144  ~vtkMaskFields() override;
145 
147 
149  {
150  char* Name;
151  int Type;
152  int Location;
153  int IsCopied;
154  };
155 
156  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
157  int NumberOfFieldFlags; // the number of fields not to be copied
158  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
159  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
160  void ClearFieldFlags();
161  int FindFlag(const char* field, int location);
162  int FindFlag(int arrayType, int location);
163  int GetFlag(const char* field, int location);
164  int GetFlag(int arrayType, int location);
165  int GetAttributeLocation(const char* loc);
166  int GetAttributeType(const char* type);
167 
170 
171  static char FieldLocationNames[3][12];
172  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
173 
174 private:
175  vtkMaskFields(const vtkMaskFields&) = delete;
176  void operator=(const vtkMaskFields&) = delete;
177 };
178 
179 #endif
180 
181 
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:85
CopyFieldFlag * CopyFieldFlags
void CopyFieldsOn()
Definition: vtkMaskFields.h:95
void CopyAttributesOn()
Definition: vtkMaskFields.h:96
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()
Definition: vtkMaskFields.h:93
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:67
void CopyAttributeOff(int attributeLocation, int attributeType)
Definition: vtkMaskFields.h:86
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
Definition: vtkMaskFields.h:92
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()