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

vtkMaskFields.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMaskFields.h,v $
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 =========================================================================*/
00039 #ifndef __vtkMaskFields_h
00040 #define __vtkMaskFields_h
00041 
00042 #include "vtkDataSetToDataSetFilter.h"
00043 
00044 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
00045 
00046 class vtkDataSet;
00047 
00048 class VTK_GRAPHICS_EXPORT vtkMaskFields : public vtkDataSetToDataSetFilter
00049 {
00050 public:
00051   vtkTypeRevisionMacro(vtkMaskFields,vtkDataSetToDataSetFilter);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00055   static vtkMaskFields *New();
00056 
00058 
00067   void CopyFieldOn(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 1); }
00068   void CopyFieldOff(int fieldLocation, const char* name) { this->CopyFieldOnOff(fieldLocation, name, 0); }
00070 
00071 
00073 
00083   void CopyAttributeOn(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 1); }
00084   void CopyAttributeOff(int attributeLocation, int attributeType) { this->CopyAttributeOnOff(attributeLocation, attributeType, 0); }
00086 
00088 
00090   void CopyFieldsOff() { this->CopyFields = 0; }
00091   void CopyAttributesOff() { this->CopyAttributes = 0; }
00093 
00094   void CopyFieldsOn() { this->CopyFields = 1; }
00095   void CopyAttributesOn() { this->CopyAttributes = 1; }
00096 
00098 
00100   void CopyAttributeOn(const char* attributeLoc, 
00101                        const char* attributeType);
00102   void CopyAttributeOff(const char* attributeLoc, 
00103                         const char* attributeType);
00104   void CopyFieldOn(const char* fieldLoc, 
00105                    const char* name);
00106   void CopyFieldOff(const char* fieldLoc, 
00107                     const char* name);
00109 
00115   virtual void CopyAllOn();
00116 
00122   virtual void CopyAllOff();
00123 
00124 //BTX
00125   enum FieldLocation
00126     {
00127       OBJECT_DATA=0,
00128       POINT_DATA=1,
00129       CELL_DATA=2
00130     };
00131 //ETX
00132 
00133 protected:
00134   vtkMaskFields();
00135   virtual ~vtkMaskFields();
00136 
00137   void Execute();
00138 
00139 //BTX
00140   struct CopyFieldFlag
00141   {
00142     char* Name;
00143     int Type;
00144     int Location;
00145     int IsCopied;
00146   };
00147 //ETX
00148 
00149   CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
00150   int NumberOfFieldFlags; // the number of fields not to be copied
00151   void CopyFieldOnOff(int fieldLocation, const char* name, int onOff);
00152   void CopyAttributeOnOff(int attributeLocation, int attributeType, int onOff);
00153   void ClearFieldFlags();
00154   int FindFlag(const char* field, int location);
00155   int FindFlag(int arrayType, int location);
00156   int GetFlag(const char* field, int location);
00157   int GetFlag(int arrayType, int location);
00158   int GetAttributeLocation(const char* loc);
00159   int GetAttributeType(const char* type);
00160 
00161   int CopyFields;
00162   int CopyAttributes;
00163 
00164   static char FieldLocationNames[3][12];
00165   static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
00166 
00167 private:
00168   vtkMaskFields(const vtkMaskFields&);  // Not implemented.
00169   void operator=(const vtkMaskFields&);  // Not implemented.
00170 };
00171 
00172 #endif
00173 
00174