16#ifndef vtkXMLDataElement_h
17#define vtkXMLDataElement_h
19#include "vtkCommonDataModelModule.h"
22VTK_ABI_NAMESPACE_BEGIN
36 vtkGetStringMacro(Name);
44 vtkGetStringMacro(Id);
45 vtkSetStringMacro(Id);
65 void AddCharacterData(
const char* c,
size_t length);
66 vtkGetStringMacro(CharacterData);
135 vtkGetMacro(NumberOfAttributes,
int);
207 const char* name,
const char* att_name,
const char* att_value);
225 vtkGetMacro(XMLByteIndex, vtkTypeInt64);
226 vtkSetMacro(XMLByteIndex, vtkTypeInt64);
256 vtkGetMacro(AttributeEncoding,
int);
276 vtkGetMacro(CharacterDataWidth,
int);
277 vtkSetMacro(CharacterDataWidth,
int);
302 vtkGetMacro(InlineDataPosition, vtkTypeInt64);
303 vtkSetMacro(InlineDataPosition, vtkTypeInt64);
331 friend class vtkXMLMaterialParser;
361 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.
vtkTypeBool IgnoreCharacterData
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