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