vtkMaskFields.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00033 #ifndef __vtkMaskFields_h
00034 #define __vtkMaskFields_h
00035
00036 #include "vtkDataSetToDataSetFilter.h"
00037
00038 #include "vtkDataSetAttributes.h"
00039
00040 class vtkDataSet;
00041
00042 class VTK_GRAPHICS_EXPORT vtkMaskFields : public vtkDataSetToDataSetFilter
00043 {
00044 public:
00045 vtkTypeRevisionMacro(vtkMaskFields,vtkDataSetToDataSetFilter);
00046 void PrintSelf(ostream& os, vtkIndent indent);
00047
00049 static vtkMaskFields *New();
00050
00052
00061 void CopyFieldOn(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 1); }
00062 void CopyFieldOff(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 0); }
00064
00065
00067
00077 void CopyAttributeOn(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 1); }
00078 void CopyAttributeOff(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 0); }
00080
00082
00084 void CopyFieldsOff() { this->CopyFields = 0; }
00085 void CopyAttributesOff() { this->CopyAttributes = 0; }
00087
00088 void CopyFieldsOn() { this->CopyFields = 1; }
00089 void CopyAttributesOn() { this->CopyAttributes = 1; }
00090
00092
00094 void CopyAttributeOn(const char* attributeLoc,
00095 const char* attributeType);
00096 void CopyAttributeOff(const char* attributeLoc,
00097 const char* attributeType);
00098 void CopyFieldOn(const char* fieldLoc,
00099 const char* name);
00100 void CopyFieldOff(const char* fieldLoc,
00101 const char* name);
00103
00109 virtual void CopyAllOn();
00110
00116 virtual void CopyAllOff();
00117
00118 vtkMaskFields();
00119 virtual ~vtkMaskFields();
00120
00121
00122 enum FieldLocation
00123 {
00124 OBJECT_DATA=0,
00125 POINT_DATA=1,
00126 CELL_DATA=2
00127 };
00128
00129
00130 protected:
00131
00132 void Execute();
00133
00134
00135 struct CopyFieldFlag
00136 {
00137 char* Name;
00138 int Type;
00139 int Location;
00140 int IsCopied;
00141 };
00142
00143
00144 CopyFieldFlag* CopyFieldFlags;
00145 int NumberOfFieldFlags;
00146 void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
00147 void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
00148 void ClearFieldFlags();
00149 int FindFlag(const char* field, int location);
00150 int FindFlag(int arrayType, int location);
00151 int GetFlag(const char* field, int location);
00152 int GetFlag(int arrayType, int location);
00153 int GetAttributeLocation(const char* loc);
00154 int GetAttributeType(const char* type);
00155
00156 int CopyFields;
00157 int CopyAttributes;
00158
00159 static char FieldLocationNames[3][12];
00160 static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
00161
00162 private:
00163 vtkMaskFields(const vtkMaskFields&);
00164 void operator=(const vtkMaskFields&);
00165 };
00166
00167 #endif
00168
00169