Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 =========================================================================*/
00029 #ifndef __vtkMaskFields_h
00030 #define __vtkMaskFields_h
00031 
00032 #include "vtkDataSetAlgorithm.h"
00033 
00034 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
00035 
00036 class vtkDataSet;
00037 
00038 class VTK_GRAPHICS_EXPORT vtkMaskFields : public vtkDataSetAlgorithm
00039 {
00040 public:
00041   vtkTypeRevisionMacro(vtkMaskFields,vtkDataSetAlgorithm);
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 //BTX
00115   enum FieldLocation
00116     {
00117       OBJECT_DATA=0,
00118       POINT_DATA=1,
00119       CELL_DATA=2
00120     };
00121 //ETX
00122 
00123 protected:
00124   vtkMaskFields();
00125   virtual ~vtkMaskFields();
00126 
00127   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00128 
00129 //BTX
00130   struct CopyFieldFlag
00131   {
00132     char* Name;
00133     int Type;
00134     int Location;
00135     int IsCopied;
00136   };
00137 //ETX
00138 
00139   CopyFieldFlag* CopyFieldFlags; // the names of fields not to be copied
00140   int NumberOfFieldFlags; // the number of fields not to be copied
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&);  // Not implemented.
00159   void operator=(const vtkMaskFields&);  // Not implemented.
00160 };
00161 
00162 #endif
00163 
00164 

Generated on Mon Jan 21 23:07:25 2008 for VTK by  doxygen 1.4.3-20050530