Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
IO/vtkXMLDataElement.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00041 #ifndef __vtkXMLDataElement_h
00042 #define __vtkXMLDataElement_h
00043
00044 #include "vtkObject.h"
00045
00046 class vtkXMLDataParser;
00047
00048 class VTK_IO_EXPORT vtkXMLDataElement : public vtkObject
00049 {
00050 public:
00051 vtkTypeRevisionMacro(vtkXMLDataElement,vtkObject);
00052 void PrintSelf(ostream& os, vtkIndent indent);
00053 static vtkXMLDataElement* New();
00054
00056
00057 vtkGetStringMacro(Name);
00059
00061
00062 vtkGetStringMacro(Id);
00064
00067 const char* GetAttribute(const char* name);
00068
00070
00072 int GetScalarAttribute(const char* name, int& value);
00073 int GetScalarAttribute(const char* name, float& value);
00074 int GetScalarAttribute(const char* name, unsigned long& value);
00075 #ifdef VTK_ID_TYPE_IS_NOT_BASIC_TYPE
00076 int GetScalarAttribute(const char* name, vtkIdType& value);
00078 #endif
00079
00081
00083 int GetVectorAttribute(const char* name, int length, int* value);
00084 int GetVectorAttribute(const char* name, int length, float* value);
00085 int GetVectorAttribute(const char* name, int length, unsigned long* value);
00086 #ifdef VTK_ID_TYPE_IS_NOT_BASIC_TYPE
00087 int GetVectorAttribute(const char* name, int length, vtkIdType* value);
00089 #endif
00090
00093 int GetWordTypeAttribute(const char* name, int& value);
00094
00096 vtkXMLDataElement* GetParent();
00097
00099 int GetNumberOfNestedElements();
00100
00102 vtkXMLDataElement* GetNestedElement(int index);
00103
00105 vtkXMLDataElement* FindNestedElement(const char* id);
00106
00108 vtkXMLDataElement* LookupElement(const char* id);
00109
00111
00113 vtkGetMacro(XMLByteIndex, unsigned long);
00115
00116 protected:
00117 vtkXMLDataElement();
00118 ~vtkXMLDataElement();
00119
00120
00121 char* Name;
00122
00123
00124 char* Id;
00125
00126
00127 unsigned long XMLByteIndex;
00128
00129
00130 unsigned long InlineDataPosition;
00131
00132
00133 char** AttributeNames;
00134 char** AttributeValues;
00135 int NumberOfAttributes;
00136 int AttributesSize;
00137
00138
00139 int NumberOfNestedElements;
00140 int NestedElementsSize;
00141 vtkXMLDataElement** NestedElements;
00142
00143
00144 vtkXMLDataElement* Parent;
00145
00146
00147 vtkSetStringMacro(Name);
00148 vtkSetStringMacro(Id);
00149 vtkSetMacro(XMLByteIndex, unsigned long);
00150 void ReadXMLAttributes(const char** atts);
00151 void AddNestedElement(vtkXMLDataElement* element);
00152 void SeekInlineDataPosition(vtkXMLDataParser* parser);
00153
00154 void PrintXML(ostream& os, vtkIndent indent);
00155
00156
00157 vtkXMLDataElement* LookupElementInScope(const char* id);
00158 vtkXMLDataElement* LookupElementUpScope(const char* id);
00159 void SetParent(vtkXMLDataElement* parent);
00160 static int IsSpace(char c);
00161
00162
00163 friend class vtkXMLDataParser;
00164
00165
00166 private:
00167 vtkXMLDataElement(const vtkXMLDataElement&);
00168 void operator=(const vtkXMLDataElement&);
00169 };
00170
00171 #endif