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 =========================================================================*/
36 #ifndef vtkMaskFields_h
37 #define vtkMaskFields_h
38 
39 #include "vtkFiltersCoreModule.h" // For export macro
40 #include "vtkDataSetAlgorithm.h"
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) VTK_OVERRIDE;
51 
55  static vtkMaskFields *New();
56 
72  void CopyFieldOn(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 1); }
73  void CopyFieldOff(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 0); }
74 
75 
91  void CopyAttributeOn(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 1); }
92  void CopyAttributeOff(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 0); }
93 
98  void CopyFieldsOff() { this->CopyFields = 0; }
99  void CopyAttributesOff() { this->CopyAttributes = 0; }
100 
101  void CopyFieldsOn() { this->CopyFields = 1; }
102  void CopyAttributesOn() { this->CopyAttributes = 1; }
103 
105 
109  void CopyAttributeOn(const char* attributeLoc,
110  const char* attributeType);
111  void CopyAttributeOff(const char* attributeLoc,
112  const char* attributeType);
113  void CopyFieldOn(const char* fieldLoc,
114  const char* name);
115  void CopyFieldOff(const char* fieldLoc,
116  const char* name);
118 
128  virtual void CopyAllOn();
129 
139  virtual void CopyAllOff();
140 
142  {
143  OBJECT_DATA=0,
144  POINT_DATA=1,
145  CELL_DATA=2
146  };
147 
148 protected:
149  vtkMaskFields();
150  ~vtkMaskFields() VTK_OVERRIDE;
151 
152  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
153 
155  {
156  char* Name;
157  int Type;
158  int Location;
159  int IsCopied;
160  };
161 
162  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
163  int NumberOfFieldFlags; // the number of fields not to be copied
164  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
165  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
166  void ClearFieldFlags();
167  int FindFlag(const char* field, int location);
168  int FindFlag(int arrayType, int location);
169  int GetFlag(const char* field, int location);
170  int GetFlag(int arrayType, int location);
171  int GetAttributeLocation(const char* loc);
172  int GetAttributeType(const char* type);
173 
176 
177  static char FieldLocationNames[3][12];
178  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
179 
180 private:
181  vtkMaskFields(const vtkMaskFields&) VTK_DELETE_FUNCTION;
182  void operator=(const vtkMaskFields&) VTK_DELETE_FUNCTION;
183 };
184 
185 #endif
186 
187 
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:91
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()
Definition: vtkMaskFields.h:99
Allow control of which fields get passed to the output.
Definition: vtkMaskFields.h:46
void CopyFieldOff(int fieldLocation, const char *name)
Definition: vtkMaskFields.h:73
void CopyAttributeOff(int attributeLocation, int attributeType)
Definition: vtkMaskFields.h:92
void CopyFieldsOff()
Convenience methods which operate on all field data or attribute data.
Definition: vtkMaskFields.h:98
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()