Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
Graphics/vtkSplitField.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00071 #ifndef __vtkSplitField_h
00072 #define __vtkSplitField_h
00073
00074 #include "vtkDataSetToDataSetFilter.h"
00075
00076 #include "vtkDataSetAttributes.h"
00077
00078 class vtkFieldData;
00079
00080 class VTK_GRAPHICS_EXPORT vtkSplitField : public vtkDataSetToDataSetFilter
00081 {
00082 public:
00083 vtkTypeRevisionMacro(vtkSplitField,vtkDataSetToDataSetFilter);
00084 void PrintSelf(ostream& os, vtkIndent indent);
00085
00087 static vtkSplitField *New();
00088
00091 void SetInputField(int attributeType, int fieldLoc);
00092
00095 void SetInputField(const char* name, int fieldLoc);
00096
00099 void SetInputField(const char* name, const char* fieldLoc);
00100
00102 void Split(int component, const char* arrayName);
00103
00104
00105 enum FieldLocations
00106 {
00107 DATA_OBJECT=0,
00108 POINT_DATA=1,
00109 CELL_DATA=2
00110 };
00111
00112
00113
00114 struct Component
00115 {
00116 int Index;
00117 char* FieldName;
00118 Component* Next;
00119 void SetName(const char* name)
00120 {
00121 delete[] this->FieldName;
00122 this->FieldName = 0;
00123 if (name)
00124 {
00125 this->FieldName = new char[strlen(name)+1];
00126 strcpy(this->FieldName, name);
00127 }
00128 }
00129 Component() { FieldName = 0; }
00130 ~Component() { delete[] FieldName; }
00131 };
00132
00133
00134 protected:
00135
00136
00137 enum FieldTypes
00138 {
00139 NAME,
00140 ATTRIBUTE
00141 };
00142
00143
00144 vtkSplitField();
00145 virtual ~vtkSplitField();
00146
00147 void Execute();
00148
00149 char* FieldName;
00150 int FieldType;
00151 int AttributeType;
00152 int FieldLocation;
00153
00154 static char FieldLocationNames[3][12];
00155 static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
00156
00157 vtkDataArray* SplitArray(vtkDataArray* da, int component);
00158
00159
00160
00161 Component* Head;
00162 Component* Tail;
00163
00164
00165 Component* GetNextComponent(Component* op)
00166 { return op->Next; }
00167 Component* GetFirst()
00168 { return this->Head; }
00169 void AddComponent(Component* op);
00170 Component* FindComponent(int index);
00171 void DeleteAllComponents();
00172
00173 void PrintComponent(Component* op, ostream& os, vtkIndent indent);
00174 void PrintAllComponents(ostream& os, vtkIndent indent);
00175 private:
00176 vtkSplitField(const vtkSplitField&);
00177 void operator=(const vtkSplitField&);
00178 };
00179
00180 #endif
00181
00182