Go to the documentation of this file.
28 #ifndef vtkXMLDataElement_h
29 #define vtkXMLDataElement_h
31 #include "vtkCommonDataModelModule.h"
56 vtkSetStringMacro(Id);
76 void AddCharacterData(
const char* c,
size_t length);
144 vtkGetMacro(NumberOfAttributes,
int);
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);
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);
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;
int GetVectorAttribute(const char *name, int length, double *value)
void SetUnsignedLongAttribute(const char *name, unsigned long value)
void AddNestedElement(vtkXMLDataElement *element)
Add nested element.
int GetVectorAttribute(const char *name, int length, unsigned long *value)
virtual void RemoveNestedElement(vtkXMLDataElement *)
Remove nested element.
void PrintXML(ostream &os, vtkIndent indent)
Prints element tree as XML.
int GetVectorAttribute(const char *name, int length, int *value)
Get the attribute with the given name and converted to a scalar value.
void SetIntAttribute(const char *name, int value)
Set the attribute with the given name.
virtual void SetName(const char *_arg)
void SetAttribute(const char *name, const char *value)
Set the attribute with the given name and value.
#define VTK_ENCODING_NONE
vtkXMLDataElement * FindNestedElementWithNameAndId(const char *name, const char *id)
const char * GetAttributeValue(int idx)
Get the n-th attribute value.
abstract base class for most VTK objects
void SetVectorAttribute(const char *name, int length, long long const *value)
int GetScalarAttribute(const char *name, unsigned long long &value)
vtkXMLDataElement * FindNestedElement(const char *id)
Find the first nested element with the given id, given name, or given name and id.
~vtkXMLDataElement() override
int GetScalarAttribute(const char *name, int &value)
Get the attribute with the given name and converted to a scalar value.
vtkXMLDataElement * LookupElement(const char *id)
Lookup the element with the given id, starting at this scope.
int GetWordTypeAttribute(const char *name, int &value)
Get the attribute with the given name and converted to a word type such as VTK_FLOAT or VTK_UNSIGNED_...
int GetScalarAttribute(const char *name, long long &value)
int GetVectorAttribute(const char *name, int length, unsigned long long *value)
vtkXMLDataElement * FindNestedElementWithName(const char *name)
void PrintXML(const char *fname)
void SetVectorAttribute(const char *name, int length, const float *value)
virtual int IsEqualTo(vtkXMLDataElement *elem)
Check if the instance has the same name, attributes, character data and nested elements contents than...
void SetDoubleAttribute(const char *name, double value)
void SetVectorAttribute(const char *name, int length, unsigned long long const *value)
vtkXMLDataElement * GetNestedElement(int index)
Get the element nested in this one at the given index.
virtual void RemoveAttribute(const char *name)
Remove one or all attributes.
a simple class to control print indentation
virtual void RemoveAllAttributes()
void SetVectorAttribute(const char *name, int length, const double *value)
Represents an XML element and those nested inside.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
int GetScalarAttribute(const char *name, unsigned long &value)
static vtkXMLDataElement * New()
int GetVectorAttribute(const char *name, int length, long *value)
void SetVectorAttribute(const char *name, int length, const int *value)
Set the attribute with the given name.
vtkXMLDataElement * LookupElementWithName(const char *name)
Find the first nested element with given name.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
void SetCharacterData(const char *c, int length)
Set/Get the character data between XML start/end tags.
virtual void RemoveAllNestedElements()
Remove all nested elements.
#define VTK_ENCODING_UNKNOWN
void SetParent(vtkXMLDataElement *parent)
int GetVectorAttribute(const char *name, int length, float *value)
vtkXMLDataElement * FindNestedElementWithNameAndAttribute(const char *name, const char *att_name, const char *att_value)
const char * GetAttributeName(int idx)
Get the n-th attribute name.
void SetVectorAttribute(const char *name, int length, const unsigned long *value)
int GetVectorAttribute(const char *name, int length, long long *value)
int GetNumberOfNestedElements()
Get the number of elements nested in this one.
int GetScalarAttribute(const char *name, double &value)
void SetFloatAttribute(const char *name, float value)
int GetScalarAttribute(const char *name, long &value)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetScalarAttribute(const char *name, float &value)
virtual vtkXMLDataElement * GetRoot()
Get root of the XML tree this element is part of.
const char * GetAttribute(const char *name)
Get the attribute with the given name.
vtkXMLDataElement * GetParent()
Set/Get the parent of this element.
Used by vtkXMLReader to parse VTK XML files.
virtual void DeepCopy(vtkXMLDataElement *elem)
Copy this element from another of the same type (elem), recursively.