28 #ifndef vtkXMLDataElement_h
29 #define vtkXMLDataElement_h
31 #include "vtkCommonDataModelModule.h"
48 virtual void SetName (
const char* _arg);
56 vtkSetStringMacro(Id);
63 const char* GetAttribute(
const char*
name);
69 void SetAttribute(
const char*
name,
const char*
value);
75 void SetCharacterData(
const char* c,
int length);
76 void AddCharacterData(
const char* c,
size_t length);
85 int GetScalarAttribute(
const char*
name,
int&
value);
86 int GetScalarAttribute(
const char*
name,
float&
value);
87 int GetScalarAttribute(
const char*
name,
double&
value);
88 int GetScalarAttribute(
const char*
name,
long&
value);
89 int GetScalarAttribute(
const char*
name,
unsigned long&
value);
99 void SetIntAttribute(
const char*
name,
int value);
100 void SetFloatAttribute(
const char*
name,
float value);
101 void SetDoubleAttribute(
const char*
name,
double value);
102 void SetUnsignedLongAttribute(
const char*
name,
unsigned long value);
114 int GetVectorAttribute(
const char*
name,
int length,
unsigned long*
value);
121 void SetVectorAttribute(
const char*
name,
int length,
const int*
value);
122 void SetVectorAttribute(
const char*
name,
int length,
const float*
value);
123 void SetVectorAttribute(
const char*
name,
int length,
const double*
value);
124 void SetVectorAttribute(
const char*
name,
int length,
const unsigned long*
value);
127 int GetScalarAttribute(
const char*
name,
long long&
value);
128 int GetVectorAttribute(
const char*
name,
int length,
long long*
value);
129 void SetVectorAttribute(
const char*
name,
int length,
long long const*
value);
130 int GetScalarAttribute(
const char*
name,
unsigned long long&
value);
131 int GetVectorAttribute(
const char*
name,
int length,
unsigned long long*
value);
132 void SetVectorAttribute(
const char*
name,
int length,
unsigned long long const*
value);
138 int GetWordTypeAttribute(
const char*
name,
int&
value);
144 vtkGetMacro(NumberOfAttributes,
int);
151 const char* GetAttributeName(
int idx);
157 const char* GetAttributeValue(
int idx);
163 virtual void RemoveAttribute(
const char *
name);
164 virtual void RemoveAllAttributes();
183 int GetNumberOfNestedElements();
203 virtual void RemoveAllNestedElements();
215 const char*
name,
const char*
id);
217 const char*
name,
const char* att_name,
const char* att_value);
235 vtkGetMacro(XMLByteIndex, vtkTypeInt64);
266 vtkGetMacro(AttributeEncoding,
int);
273 void PrintXML(ostream& os,
vtkIndent indent);
274 void PrintXML(
const char* fname);
286 vtkGetMacro(CharacterDataWidth,
int);
299 int CharacterDataWidth;
303 size_t CharacterDataBlockSize;
304 size_t CharacterDataBufferSize;
305 size_t EndOfCharacterData;
309 int IgnoreCharacterData;
312 vtkGetMacro(InlineDataPosition,vtkTypeInt64);
315 vtkTypeInt64 InlineDataPosition;
317 vtkTypeInt64 XMLByteIndex;
320 char** AttributeNames;
321 char** AttributeValues;
322 int NumberOfAttributes;
324 int AttributeEncoding;
327 int NumberOfNestedElements;
328 int NestedElementsSize;
336 static
int IsSpace(
char c);
337 void PrintCharacterData(ostream &os,
vtkIndent indent);
338 static
void PrintWithEscapedData(ostream& os, const
char*
data);
341 friend class vtkXMLMaterialParser;
352 if (this->IgnoreCharacterData){
return; }
354 size_t eod=this->EndOfCharacterData-1;
357 this->EndOfCharacterData+=
length;
358 if (this->EndOfCharacterData>=this->CharacterDataBufferSize)
360 while(this->EndOfCharacterData>=this->CharacterDataBufferSize)
362 this->CharacterDataBufferSize+=this->CharacterDataBlockSize;
365 =
static_cast<char *
>(realloc(this->CharacterData,this->CharacterDataBufferSize));
368 char *pCD=this->CharacterData+eod;
369 memmove(pCD,data,length);
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Represents an XML element and those nested inside.
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
#define VTK_ENCODING_UNKNOWN
a simple class to control print indentation
#define VTK_ENCODING_NONE
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Used by vtkXMLReader to parse VTK XML files.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...