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