VTK
dox/Graphics/vtkAssignAttribute.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkAssignAttribute.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 =========================================================================*/
00062 #ifndef __vtkAssignAttribute_h
00063 #define __vtkAssignAttribute_h
00064 
00065 #include "vtkPassInputTypeAlgorithm.h"
00066 
00067 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
00068 
00069 class vtkFieldData;
00070 
00071 class VTK_GRAPHICS_EXPORT vtkAssignAttribute : public vtkPassInputTypeAlgorithm
00072 {
00073 public:
00074   vtkTypeMacro(vtkAssignAttribute,vtkPassInputTypeAlgorithm);
00075   void PrintSelf(ostream& os, vtkIndent indent);
00076 
00078   static vtkAssignAttribute *New();
00079 
00081   void Assign(int inputAttributeType, int attributeType, int attributeLoc);
00082 
00084   void Assign(const char* fieldName, int attributeType, int attributeLoc);
00085 
00087 
00089   void Assign(const char* name, const char* attributeType, 
00090               const char* attributeLoc);
00092 
00093 
00094 //BTX
00095   // Always keep NUM_ATTRIBUTE_LOCS as the last entry
00096   enum AttributeLocation
00097   {
00098     POINT_DATA=0,
00099     CELL_DATA=1,
00100     VERTEX_DATA=2,
00101     EDGE_DATA=3,
00102     NUM_ATTRIBUTE_LOCS
00103   };
00104 //ETX
00105 
00106 protected:
00107 
00108 //BTX
00109   enum FieldType
00110   {
00111     NAME,
00112     ATTRIBUTE
00113   };
00114 //ETX
00115 
00116   vtkAssignAttribute();
00117   virtual ~vtkAssignAttribute();
00118 
00119   int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00120   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00121   int FillInputPortInformation(int, vtkInformation *);
00122 
00123   char* FieldName;
00124   int FieldTypeAssignment;
00125   int AttributeType;
00126   int InputAttributeType;
00127   int AttributeLocationAssignment;
00128 
00129   static char AttributeLocationNames[vtkAssignAttribute::NUM_ATTRIBUTE_LOCS][12];
00130   static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][20];
00131 private:
00132   vtkAssignAttribute(const vtkAssignAttribute&);  // Not implemented.
00133   void operator=(const vtkAssignAttribute&);  // Not implemented.
00134 };
00135 
00136 #endif