28#ifndef vtkXMLDataElement_h
29#define vtkXMLDataElement_h
31#include "vtkCommonDataModelModule.h"
47 vtkGetStringMacro(Name);
55 vtkGetStringMacro(Id);
56 vtkSetStringMacro(Id);
76 void AddCharacterData(
const char* c,
size_t length);
77 vtkGetStringMacro(CharacterData);
146 vtkGetMacro(NumberOfAttributes,
int);
218 const char* name,
const char* att_name,
const char* att_value);
236 vtkGetMacro(XMLByteIndex, vtkTypeInt64);
237 vtkSetMacro(XMLByteIndex, vtkTypeInt64);
267 vtkGetMacro(AttributeEncoding,
int);
287 vtkGetMacro(CharacterDataWidth,
int);
288 vtkSetMacro(CharacterDataWidth,
int);
313 vtkGetMacro(InlineDataPosition, vtkTypeInt64);
314 vtkSetMacro(InlineDataPosition, vtkTypeInt64);
342 friend class vtkXMLMaterialParser;
372 memmove(pCD, data, length);
a simple class to control print indentation
abstract base class for most VTK objects
Represents an XML element and those nested inside.
int GetScalarAttribute(const char *name, unsigned long &value)
Get the attribute with the given name and converted to a scalar value.
vtkXMLDataElement * LookupElementInScope(const char *id)
vtkTypeInt64 XMLByteIndex
void SetAttribute(const char *name, const char *value)
Set the attribute with the given name and value.
virtual void RemoveAllNestedElements()
Remove all nested elements.
int GetScalarAttribute(const char *name, unsigned long long &value)
vtkXMLDataElement * LookupElement(const char *id)
Lookup the element with the given id, starting at this scope.
const char * GetAttributeValue(int idx)
Get the n-th attribute value.
void PrintXML(VTK_FILEPATH const char *fname)
Prints element tree as XML.
static void PrintWithEscapedData(ostream &os, const char *data)
vtkXMLDataElement ** NestedElements
const char * GetAttributeName(int idx)
Get the n-th attribute name.
int GetVectorAttribute(const char *name, int length, unsigned long long *value)
void PrintCharacterData(ostream &os, vtkIndent indent)
void PrintXML(ostream &os, vtkIndent indent)
Prints element tree as XML.
vtkTypeInt64 InlineDataPosition
int GetVectorAttribute(const char *name, int length, double *value)
Get the attribute with the given name and converted to a scalar value.
void SetDoubleAttribute(const char *name, double value)
Set the attribute with the given name.
static vtkXMLDataElement * New()
void SetVectorAttribute(const char *name, int length, const int *value)
Set the attribute with the given name.
int GetVectorAttribute(const char *name, int length, long long *value)
vtkXMLDataElement * FindNestedElementWithNameAndAttribute(const char *name, const char *att_name, const char *att_value)
Find the first nested element with the given id, given name, or given name and id.
void SetVectorAttribute(const char *name, int length, long long const *value)
vtkXMLDataElement * FindNestedElement(const char *id)
Find the first nested element with the given id, given name, or given name and id.
int GetScalarAttribute(const char *name, long &value)
Get the attribute with the given name and converted to a scalar value.
int GetScalarAttribute(const char *name, float &value)
Get the attribute with the given name and converted to a scalar value.
void SetVectorAttribute(const char *name, int length, const float *value)
Set the attribute with the given name.
static int IsSpace(char c)
int NumberOfNestedElements
vtkXMLDataElement * GetNestedElement(int index)
Get the element nested in this one at the given index.
~vtkXMLDataElement() override
void SetVectorAttribute(const char *name, int length, unsigned long long const *value)
void SetUnsignedLongAttribute(const char *name, unsigned long value)
Set the attribute with the given name.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXMLDataElement * FindNestedElementWithNameAndId(const char *name, const char *id)
Find the first nested element with the given id, given name, or given name and id.
int GetScalarAttribute(const char *name, int &value)
Get the attribute with the given name and converted to a scalar value.
virtual void SetName(const char *_arg)
Set/Get the name of the element.
vtkXMLDataElement * LookupElementUpScope(const char *id)
int GetVectorAttribute(const char *name, int length, float *value)
Get the attribute with the given name and converted to a scalar value.
virtual vtkXMLDataElement * GetRoot()
Get root of the XML tree this element is part of.
size_t EndOfCharacterData
void SetIntAttribute(const char *name, int value)
Set the attribute with the given name.
int GetVectorAttribute(const char *name, int length, int *value)
Get the attribute with the given name and converted to a scalar value.
virtual void RemoveAllAttributes()
Remove one or all attributes.
vtkXMLDataElement * FindNestedElementWithName(const char *name)
Find the first nested element with the given id, given name, or given name and id.
size_t CharacterDataBlockSize
virtual int IsEqualTo(vtkXMLDataElement *elem)
Check if the instance has the same name, attributes, character data and nested elements contents than...
void SetVectorAttribute(const char *name, int length, const unsigned long *value)
Set the attribute with the given name.
vtkXMLDataElement * LookupElementWithName(const char *name)
Find the first nested element with given name.
int GetVectorAttribute(const char *name, int length, long *value)
Get the attribute with the given name and converted to a scalar value.
void AddCharacterData(const char *c, size_t length)
Set/Get the character data between XML start/end tags.
int GetVectorAttribute(const char *name, int length, unsigned long *value)
Get the attribute with the given name and converted to a scalar value.
vtkXMLDataElement * GetParent()
Set/Get the parent of this element.
void SetFloatAttribute(const char *name, float value)
Set the attribute with the given name.
size_t CharacterDataBufferSize
virtual void RemoveNestedElement(vtkXMLDataElement *)
Remove nested element.
vtkXMLDataElement * Parent
void SetParent(vtkXMLDataElement *parent)
Set/Get the parent of this element.
const char * GetAttribute(const char *name)
Get the attribute with the given name.
virtual void DeepCopy(vtkXMLDataElement *elem)
Copy this element from another of the same type (elem), recursively.
int GetNumberOfNestedElements()
Get the number of elements nested in this one.
virtual void RemoveAttribute(const char *name)
Remove one or all attributes.
int GetScalarAttribute(const char *name, double &value)
Get the attribute with the given name and converted to a scalar value.
void SetCharacterData(const char *data, int length)
Set/Get the character data between XML start/end tags.
int GetWordTypeAttribute(const char *name, int &value)
Get the attribute with the given name and converted to a word type.
void AddNestedElement(vtkXMLDataElement *element)
Add nested element.
int GetScalarAttribute(const char *name, long long &value)
void SetVectorAttribute(const char *name, int length, const double *value)
Set the attribute with the given name.
Used by vtkXMLReader to parse VTK XML files.
#define VTK_ENCODING_UNKNOWN
#define VTK_ENCODING_NONE