VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Filters/Core/vtkMaskFields.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMaskFields.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00035 #ifndef vtkMaskFields_h
00036 #define vtkMaskFields_h
00037 
00038 #include "vtkFiltersCoreModule.h" // For export macro
00039 #include "vtkDataSetAlgorithm.h"
00040 
00041 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
00042 
00043 class vtkDataSet;
00044 
00045 class VTKFILTERSCORE_EXPORT vtkMaskFields : public vtkDataSetAlgorithm
00046 {
00047 public:
00048   vtkTypeMacro(vtkMaskFields,vtkDataSetAlgorithm);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052   static vtkMaskFields *New();
00053 
00055 
00064   void CopyFieldOn(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 1); }
00065   void CopyFieldOff(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 0); }
00067 
00068 
00070 
00080   void CopyAttributeOn(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 1); }
00081   void CopyAttributeOff(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 0); }
00083 
00085 
00087   void CopyFieldsOff() { this->CopyFields = 0; }
00088   void CopyAttributesOff() { this->CopyAttributes = 0; }
00090 
00091   void CopyFieldsOn() { this->CopyFields = 1; }
00092   void CopyAttributesOn() { this->CopyAttributes = 1; }
00093 
00095 
00097   void CopyAttributeOn(const char* attributeLoc,
00098                        const char* attributeType);
00099   void CopyAttributeOff(const char* attributeLoc,
00100                         const char* attributeType);
00101   void CopyFieldOn(const char* fieldLoc,
00102                    const char* name);
00103   void CopyFieldOff(const char* fieldLoc,
00104                     const char* name);
00106 
00112   virtual void CopyAllOn();
00113 
00119   virtual void CopyAllOff();
00120 
00121 //BTX
00122   enum FieldLocation
00123     {
00124       OBJECT_DATA=0,
00125       POINT_DATA=1,
00126       CELL_DATA=2
00127     };
00128 //ETX
00129 
00130 protected:
00131   vtkMaskFields();
00132   virtual ~vtkMaskFields();
00133 
00134   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00135 
00136 //BTX
00137   struct CopyFieldFlag
00138   {
00139     char* Name;
00140     int Type;
00141     int Location;
00142     int IsCopied;
00143   };
00144 //ETX
00145 
00146   CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
00147   int NumberOfFieldFlags; // the number of fields not to be copied
00148   void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
00149   void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
00150   void ClearFieldFlags();
00151   int FindFlag(const char* field, int location);
00152   int FindFlag(int arrayType, int location);
00153   int GetFlag(const char* field, int location);
00154   int GetFlag(int arrayType, int location);
00155   int GetAttributeLocation(const char* loc);
00156   int GetAttributeType(const char* type);
00157 
00158   int CopyFields;
00159   int CopyAttributes;
00160 
00161   static char FieldLocationNames[3][12];
00162   static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
00163 
00164 private:
00165   vtkMaskFields(const vtkMaskFields&);  // Not implemented.
00166   void operator=(const vtkMaskFields&);  // Not implemented.
00167 };
00168 
00169 #endif
00170 
00171