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 =========================================================================*/
32 #ifndef __vtkMaskFields_h
33 #define __vtkMaskFields_h
34 
35 #include "vtkDataSetAlgorithm.h"
36 
37 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
38 
39 class vtkDataSet;
40 
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48  static vtkMaskFields *New();
49 
51 
60  void CopyFieldOn(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 1); }
61  void CopyFieldOff(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 0); }
63 
64 
66 
76  void CopyAttributeOn(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 1); }
77  void CopyAttributeOff(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 0); }
79 
81 
83  void CopyFieldsOff() { this->CopyFields = 0; }
84  void CopyAttributesOff() { this->CopyAttributes = 0; }
86 
87  void CopyFieldsOn() { this->CopyFields = 1; }
88  void CopyAttributesOn() { this->CopyAttributes = 1; }
89 
91 
93  void CopyAttributeOn(const char* attributeLoc,
94  const char* attributeType);
95  void CopyAttributeOff(const char* attributeLoc,
96  const char* attributeType);
97  void CopyFieldOn(const char* fieldLoc,
98  const char* name);
99  void CopyFieldOff(const char* fieldLoc,
100  const char* name);
102 
108  virtual void CopyAllOn();
109 
115  virtual void CopyAllOff();
116 
117 //BTX
119  {
120  OBJECT_DATA=0,
121  POINT_DATA=1,
122  CELL_DATA=2
123  };
124 //ETX
125 
126 protected:
127  vtkMaskFields();
128  virtual ~vtkMaskFields();
129 
131 
132 //BTX
134  {
135  char* Name;
136  int Type;
137  int Location;
138  int IsCopied;
139  };
140 //ETX
141 
142  CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
143  int NumberOfFieldFlags; // the number of fields not to be copied
144  void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
145  void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
146  void ClearFieldFlags();
147  int FindFlag(const char* field, int location);
148  int FindFlag(int arrayType, int location);
149  int GetFlag(const char* field, int location);
150  int GetFlag(int arrayType, int location);
151  int GetAttributeLocation(const char* loc);
152  int GetAttributeType(const char* type);
153 
156 
157  static char FieldLocationNames[3][12];
158  static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
159 
160 private:
161  vtkMaskFields(const vtkMaskFields&); // Not implemented.
162  void operator=(const vtkMaskFields&); // Not implemented.
163 };
164 
165 #endif
166 
167