VTK
|
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 "vtkFiltersCoreModule.h" // For export macro 00066 #include "vtkPassInputTypeAlgorithm.h" 00067 00068 #include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES 00069 00070 class vtkFieldData; 00071 00072 class VTKFILTERSCORE_EXPORT vtkAssignAttribute : public vtkPassInputTypeAlgorithm 00073 { 00074 public: 00075 vtkTypeMacro(vtkAssignAttribute,vtkPassInputTypeAlgorithm); 00076 void PrintSelf(ostream& os, vtkIndent indent); 00077 00079 static vtkAssignAttribute *New(); 00080 00082 void Assign(int inputAttributeType, int attributeType, int attributeLoc); 00083 00085 void Assign(const char* fieldName, int attributeType, int attributeLoc); 00086 00088 00090 void Assign(const char* name, const char* attributeType, 00091 const char* attributeLoc); 00093 00094 00095 //BTX 00096 // Always keep NUM_ATTRIBUTE_LOCS as the last entry 00097 enum AttributeLocation 00098 { 00099 POINT_DATA=0, 00100 CELL_DATA=1, 00101 VERTEX_DATA=2, 00102 EDGE_DATA=3, 00103 NUM_ATTRIBUTE_LOCS 00104 }; 00105 //ETX 00106 00107 protected: 00108 00109 //BTX 00110 enum FieldType 00111 { 00112 NAME, 00113 ATTRIBUTE 00114 }; 00115 //ETX 00116 00117 vtkAssignAttribute(); 00118 virtual ~vtkAssignAttribute(); 00119 00120 int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00121 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00122 int FillInputPortInformation(int, vtkInformation *); 00123 00124 char* FieldName; 00125 int FieldTypeAssignment; 00126 int AttributeType; 00127 int InputAttributeType; 00128 int AttributeLocationAssignment; 00129 00130 static char AttributeLocationNames[vtkAssignAttribute::NUM_ATTRIBUTE_LOCS][12]; 00131 static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][20]; 00132 private: 00133 vtkAssignAttribute(const vtkAssignAttribute&); // Not implemented. 00134 void operator=(const vtkAssignAttribute&); // Not implemented. 00135 }; 00136 00137 #endif