28 #ifndef vtkXMLDataElement_h 29 #define vtkXMLDataElement_h 31 #include "vtkCommonDataModelModule.h" 47 vtkGetStringMacro(Name);
48 virtual void SetName (
const char* _arg);
55 vtkGetStringMacro(Id);
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);
77 vtkGetStringMacro(CharacterData);
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);
236 vtkSetMacro(XMLByteIndex, vtkTypeInt64);
266 vtkGetMacro(AttributeEncoding,
int);
273 void PrintXML(ostream& os,
vtkIndent indent);
274 void PrintXML(
const char* fname);
286 vtkGetMacro(CharacterDataWidth,
int);
287 vtkSetMacro(CharacterDataWidth,
int);
312 vtkGetMacro(InlineDataPosition,vtkTypeInt64);
313 vtkSetMacro(InlineDataPosition,vtkTypeInt64);
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);
size_t EndOfCharacterData
vtkXMLDataElement ** NestedElements
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.
size_t CharacterDataBufferSize
size_t CharacterDataBlockSize
#define VTK_ENCODING_UNKNOWN
vtkTypeInt64 XMLByteIndex
void AddCharacterData(const char *c, size_t length)
Set/Get the character data between XML start/end tags.
vtkXMLDataElement * Parent
a simple class to control print indentation
#define VTK_ENCODING_NONE
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...
int NumberOfNestedElements
vtkTypeInt64 InlineDataPosition