Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Graphics/vtkMaskFields.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMaskFields.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00033 #ifndef __vtkMaskFields_h
00034 #define __vtkMaskFields_h
00035 
00036 #include "vtkDataSetToDataSetFilter.h"
00037 
00038 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
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 //BTX
00122   enum FieldLocation
00123     {
00124       OBJECT_DATA=0,
00125       POINT_DATA=1,
00126       CELL_DATA=2
00127     };
00128 //ETX
00129 
00130 protected:
00131 
00132   void Execute();
00133 
00134 //BTX
00135   struct CopyFieldFlag
00136   {
00137     char* Name;
00138     int Type;
00139     int Location;
00140     int IsCopied;
00141   };
00142 //ETX
00143 
00144   CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
00145   int NumberOfFieldFlags; // the number of fields not to be copied
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&);  // Not implemented.
00164   void operator=(const vtkMaskFields&);  // Not implemented.
00165 };
00166 
00167 #endif
00168 
00169