00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00029
#ifndef __vtkMaskFields_h
00030
#define __vtkMaskFields_h
00031
00032
#include "vtkDataSetToDataSetFilter.h"
00033
00034
#include "vtkDataSetAttributes.h"
00035
00036
class vtkDataSet;
00037
00038 class VTK_GRAPHICS_EXPORT vtkMaskFields :
public vtkDataSetToDataSetFilter
00039 {
00040
public:
00041 vtkTypeRevisionMacro(vtkMaskFields,
vtkDataSetToDataSetFilter);
00042
void PrintSelf(ostream& os,
vtkIndent indent);
00043
00045
static vtkMaskFields *
New();
00046
00048
00057 void CopyFieldOn(
int fieldLocation,
const char* name) { this->CopyFieldOnOff(fieldLocation, name, 1); }
00058 void CopyFieldOff(
int fieldLocation,
const char* name) { this->CopyFieldOnOff(fieldLocation, name, 0); }
00060
00061
00063
00073 void CopyAttributeOn(
int attributeLocation,
int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 1); }
00074 void CopyAttributeOff(
int attributeLocation,
int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 0); }
00076
00078
00080 void CopyFieldsOff() { this->CopyFields = 0; }
00081 void CopyAttributesOff() { this->CopyAttributes = 0; }
00083
00084 void CopyFieldsOn() { this->CopyFields = 1; }
00085 void CopyAttributesOn() { this->CopyAttributes = 1; }
00086
00088
00090
void CopyAttributeOn(
const char* attributeLoc,
00091
const char* attributeType);
00092
void CopyAttributeOff(
const char* attributeLoc,
00093
const char* attributeType);
00094
void CopyFieldOn(
const char* fieldLoc,
00095
const char* name);
00096
void CopyFieldOff(
const char* fieldLoc,
00097
const char* name);
00099
00105
virtual void CopyAllOn();
00106
00112
virtual void CopyAllOff();
00113
00114
00115 enum FieldLocation
00116 {
00117 OBJECT_DATA=0,
00118 POINT_DATA=1,
00119 CELL_DATA=2
00120 };
00121
00122
00123
protected:
00124 vtkMaskFields();
00125
virtual ~vtkMaskFields();
00126
00127
void Execute();
00128
00129
00130 struct CopyFieldFlag
00131 {
00132 char* Name;
00133 int Type;
00134 int Location;
00135 int IsCopied;
00136 };
00137
00138
00139 CopyFieldFlag* CopyFieldFlags;
00140 int NumberOfFieldFlags;
00141
void CopyFieldOnOff(
int fieldLocation,
const char* name,
int onOff);
00142
void CopyAttributeOnOff(
int attributeLocation,
int attributeType,
int onOff);
00143
void ClearFieldFlags();
00144
int FindFlag(
const char* field,
int location);
00145
int FindFlag(
int arrayType,
int location);
00146
int GetFlag(
const char* field,
int location);
00147
int GetFlag(
int arrayType,
int location);
00148
int GetAttributeLocation(
const char* loc);
00149
int GetAttributeType(
const char* type);
00150
00151 int CopyFields;
00152 int CopyAttributes;
00153
00154 static char FieldLocationNames[3][12];
00155 static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
00156
00157
private:
00158 vtkMaskFields(
const vtkMaskFields&);
00159
void operator=(
const vtkMaskFields&);
00160 };
00161
00162
#endif
00163
00164