VTK
|
Represents an XML element and those nested inside. More...
#include <vtkXMLDataElement.h>
Public Types | |
typedef vtkObject | Superclass |
Public Types inherited from vtkObject | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkXMLDataElement * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
const char * | GetAttribute (const char *name) |
void | SetAttribute (const char *name, const char *value) |
int | GetWordTypeAttribute (const char *name, int &value) |
const char * | GetAttributeName (int idx) |
const char * | GetAttributeValue (int idx) |
virtual vtkXMLDataElement * | GetRoot () |
int | GetNumberOfNestedElements () |
vtkXMLDataElement * | GetNestedElement (int index) |
void | AddNestedElement (vtkXMLDataElement *element) |
virtual void | RemoveNestedElement (vtkXMLDataElement *) |
virtual void | RemoveAllNestedElements () |
vtkXMLDataElement * | LookupElementWithName (const char *name) |
vtkXMLDataElement * | LookupElement (const char *id) |
virtual int | IsEqualTo (vtkXMLDataElement *elem) |
virtual void | DeepCopy (vtkXMLDataElement *elem) |
virtual char * | GetName () |
virtual void | SetName (const char *_arg) |
virtual char * | GetId () |
virtual void | SetId (const char *) |
void | SetCharacterData (const char *c, int length) |
void | AddCharacterData (const char *c, size_t length) |
virtual char * | GetCharacterData () |
int | GetScalarAttribute (const char *name, int &value) |
int | GetScalarAttribute (const char *name, float &value) |
int | GetScalarAttribute (const char *name, double &value) |
int | GetScalarAttribute (const char *name, unsigned long &value) |
void | SetIntAttribute (const char *name, int value) |
void | SetFloatAttribute (const char *name, float value) |
void | SetDoubleAttribute (const char *name, double value) |
void | SetUnsignedLongAttribute (const char *name, unsigned long value) |
int | GetVectorAttribute (const char *name, int length, int *value) |
int | GetVectorAttribute (const char *name, int length, float *value) |
int | GetVectorAttribute (const char *name, int length, double *value) |
int | GetVectorAttribute (const char *name, int length, unsigned long *value) |
void | SetVectorAttribute (const char *name, int length, const int *value) |
void | SetVectorAttribute (const char *name, int length, const float *value) |
void | SetVectorAttribute (const char *name, int length, const double *value) |
void | SetVectorAttribute (const char *name, int length, const unsigned long *value) |
virtual int | GetNumberOfAttributes () |
virtual void | RemoveAttribute (const char *name) |
virtual void | RemoveAllAttributes () |
vtkXMLDataElement * | GetParent () |
void | SetParent (vtkXMLDataElement *parent) |
vtkXMLDataElement * | FindNestedElement (const char *id) |
vtkXMLDataElement * | FindNestedElementWithName (const char *name) |
vtkXMLDataElement * | FindNestedElementWithNameAndId (const char *name, const char *id) |
vtkXMLDataElement * | FindNestedElementWithNameAndAttribute (const char *name, const char *att_name, const char *att_value) |
virtual vtkTypeInt64 | GetXMLByteIndex () |
virtual void | SetXMLByteIndex (vtkTypeInt64) |
virtual void | SetAttributeEncoding (int) |
virtual int | GetAttributeEncoding () |
void | PrintXML (ostream &os, vtkIndent indent) |
void | PrintXML (const char *fname) |
virtual int | GetCharacterDataWidth () |
virtual void | SetCharacterDataWidth (int) |
Public Member Functions inherited from vtkObject | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkXMLDataElement * | SafeDownCast (vtkObjectBase *o) |
static vtkXMLDataElement * | New () |
Static Public Member Functions inherited from vtkObject | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkXMLDataElement () | |
~vtkXMLDataElement () | |
virtual vtkTypeInt64 | GetInlineDataPosition () |
virtual void | SetInlineDataPosition (vtkTypeInt64) |
vtkXMLDataElement * | LookupElementInScope (const char *id) |
vtkXMLDataElement * | LookupElementUpScope (const char *id) |
void | PrintCharacterData (ostream &os, vtkIndent indent) |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Static Protected Member Functions | |
static int | IsSpace (char c) |
static void | PrintWithEscapedData (ostream &os, const char *data) |
Protected Attributes | |
char * | Name |
char * | Id |
int | CharacterDataWidth |
char * | CharacterData |
size_t | CharacterDataBlockSize |
size_t | CharacterDataBufferSize |
size_t | EndOfCharacterData |
int | IgnoreCharacterData |
vtkTypeInt64 | InlineDataPosition |
vtkTypeInt64 | XMLByteIndex |
char ** | AttributeNames |
char ** | AttributeValues |
int | NumberOfAttributes |
int | AttributesSize |
int | AttributeEncoding |
int | NumberOfNestedElements |
int | NestedElementsSize |
vtkXMLDataElement ** | NestedElements |
vtkXMLDataElement * | Parent |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Friends | |
class | vtkXMLDataParser |
class | vtkXMLMaterialParser |
Represents an XML element and those nested inside.
vtkXMLDataElement is used by vtkXMLDataParser to represent an XML element. It provides methods to access the element's attributes and nested elements in a convenient manner. This allows easy traversal of an input XML file by vtkXMLReader and its subclasses.
Definition at line 35 of file vtkXMLDataElement.h.
Definition at line 38 of file vtkXMLDataElement.h.
|
protected |
|
protected |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
vtkXMLDataElement* vtkXMLDataElement::NewInstance | ( | ) | const |
|
virtual |
|
static |
|
virtual |
Set/Get the name of the element. This is its XML tag.
|
virtual |
Set/Get the name of the element. This is its XML tag.
|
virtual |
Set/Get the value of the id attribute of the element, if any.
|
virtual |
Set/Get the value of the id attribute of the element, if any.
const char* vtkXMLDataElement::GetAttribute | ( | const char * | name | ) |
Get the attribute with the given name. If it doesn't exist, returns 0.
void vtkXMLDataElement::SetAttribute | ( | const char * | name, |
const char * | value | ||
) |
Set the attribute with the given name and value. If it doesn't exist, adds it.
void vtkXMLDataElement::SetCharacterData | ( | const char * | c, |
int | length | ||
) |
Set/Get the character data between XML start/end tags.
|
inline |
Set/Get the character data between XML start/end tags.
Definition at line 296 of file vtkXMLDataElement.h.
|
virtual |
Set/Get the character data between XML start/end tags.
Get the attribute with the given name and converted to a scalar value. Returns whether value was extracted.
Get the attribute with the given name and converted to a scalar value. Returns whether value was extracted.
Get the attribute with the given name and converted to a scalar value. Returns whether value was extracted.
int vtkXMLDataElement::GetScalarAttribute | ( | const char * | name, |
unsigned long & | value | ||
) |
Get the attribute with the given name and converted to a scalar value. Returns whether value was extracted.
void vtkXMLDataElement::SetIntAttribute | ( | const char * | name, |
int | value | ||
) |
Set the attribute with the given name. We can not use the same GetScalarAttribute() construct since the compiler will not be able to resolve between SetAttribute(..., int) and SetAttribute(..., unsigned long).
void vtkXMLDataElement::SetFloatAttribute | ( | const char * | name, |
float | value | ||
) |
Set the attribute with the given name. We can not use the same GetScalarAttribute() construct since the compiler will not be able to resolve between SetAttribute(..., int) and SetAttribute(..., unsigned long).
void vtkXMLDataElement::SetDoubleAttribute | ( | const char * | name, |
double | value | ||
) |
Set the attribute with the given name. We can not use the same GetScalarAttribute() construct since the compiler will not be able to resolve between SetAttribute(..., int) and SetAttribute(..., unsigned long).
void vtkXMLDataElement::SetUnsignedLongAttribute | ( | const char * | name, |
unsigned long | value | ||
) |
Set the attribute with the given name. We can not use the same GetScalarAttribute() construct since the compiler will not be able to resolve between SetAttribute(..., int) and SetAttribute(..., unsigned long).
Get the attribute with the given name and converted to a scalar value. Returns length of vector read.
Get the attribute with the given name and converted to a scalar value. Returns length of vector read.
Get the attribute with the given name and converted to a scalar value. Returns length of vector read.
Get the attribute with the given name and converted to a scalar value. Returns length of vector read.
Set the attribute with the given name.
Set the attribute with the given name.
Set the attribute with the given name.
void vtkXMLDataElement::SetVectorAttribute | ( | const char * | name, |
int | length, | ||
const unsigned long * | value | ||
) |
Set the attribute with the given name.
Get the attribute with the given name and converted to a word type such as VTK_FLOAT or VTK_UNSIGNED_LONG.
|
virtual |
Get the number of attributes.
const char* vtkXMLDataElement::GetAttributeName | ( | int | idx | ) |
Get the n-th attribute name. Returns 0 if there is no such attribute.
const char* vtkXMLDataElement::GetAttributeValue | ( | int | idx | ) |
Get the n-th attribute value. Returns 0 if there is no such attribute.
|
virtual |
Remove one or all attributes.
|
virtual |
Remove one or all attributes.
vtkXMLDataElement* vtkXMLDataElement::GetParent | ( | ) |
Set/Get the parent of this element.
void vtkXMLDataElement::SetParent | ( | vtkXMLDataElement * | parent | ) |
Set/Get the parent of this element.
|
virtual |
Get root of the XML tree this element is part of.
int vtkXMLDataElement::GetNumberOfNestedElements | ( | ) |
Get the number of elements nested in this one.
vtkXMLDataElement* vtkXMLDataElement::GetNestedElement | ( | int | index | ) |
Get the element nested in this one at the given index.
void vtkXMLDataElement::AddNestedElement | ( | vtkXMLDataElement * | element | ) |
Add nested element
|
virtual |
Remove nested element.
|
virtual |
Remove all nested elements.
vtkXMLDataElement* vtkXMLDataElement::FindNestedElement | ( | const char * | id | ) |
Find the first nested element with the given id, given name, or given name and id. WARNING: the search is only performed on the children, not the grand-children.
vtkXMLDataElement* vtkXMLDataElement::FindNestedElementWithName | ( | const char * | name | ) |
Find the first nested element with the given id, given name, or given name and id. WARNING: the search is only performed on the children, not the grand-children.
vtkXMLDataElement* vtkXMLDataElement::FindNestedElementWithNameAndId | ( | const char * | name, |
const char * | id | ||
) |
Find the first nested element with the given id, given name, or given name and id. WARNING: the search is only performed on the children, not the grand-children.
vtkXMLDataElement* 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. WARNING: the search is only performed on the children, not the grand-children.
vtkXMLDataElement* vtkXMLDataElement::LookupElementWithName | ( | const char * | name | ) |
Find the first nested element with given name. WARNING: the search is performed on the whole XML tree.
vtkXMLDataElement* vtkXMLDataElement::LookupElement | ( | const char * | id | ) |
Lookup the element with the given id, starting at this scope.
|
virtual |
Set/Get the offset from the beginning of the XML document to this element.
|
virtual |
Set/Get the offset from the beginning of the XML document to this element.
|
virtual |
Check if the instance has the same name, attributes, character data and nested elements contents than the given element (this method is applied recursively on the nested elements, and they must be stored in the same order). Warning: Id, Parent, XMLByteIndex are ignored.
|
virtual |
Copy this element from another of the same type (elem), recursively. Old attributes and nested elements are removed, new ones are created given the contents of 'elem'. Warning: Parent is ignored.
|
virtual |
Get/Set the internal character encoding of the attributes. Default type is VTK_ENCODING_UTF_8. Note that a vtkXMLDataParser has its own AttributesEncoding ivar. If this ivar is set to something other than VTK_ENCODING_NONE, it will be used to set the attribute encoding of each vtkXMLDataElement created by this vtkXMLDataParser.
|
virtual |
Get/Set the internal character encoding of the attributes. Default type is VTK_ENCODING_UTF_8. Note that a vtkXMLDataParser has its own AttributesEncoding ivar. If this ivar is set to something other than VTK_ENCODING_NONE, it will be used to set the attribute encoding of each vtkXMLDataElement created by this vtkXMLDataParser.
void vtkXMLDataElement::PrintXML | ( | ostream & | os, |
vtkIndent | indent | ||
) |
Prints element tree as XML.
void vtkXMLDataElement::PrintXML | ( | const char * | fname | ) |
Prints element tree as XML.
|
virtual |
Get/Set the width (in number of fields) that character data (that between open and closing tags ie. <X> ... </X>) is printed. If the width is less than one the tag's character data is printed all on one line. If it is greater than one the character data is streamed insterting line feeds every width number of fields. See PrintXML.
|
virtual |
Get/Set the width (in number of fields) that character data (that between open and closing tags ie. <X> ... </X>) is printed. If the width is less than one the tag's character data is printed all on one line. If it is greater than one the character data is streamed insterting line feeds every width number of fields. See PrintXML.
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
friend |
Definition at line 285 of file vtkXMLDataElement.h.
|
friend |
Definition at line 286 of file vtkXMLDataElement.h.
|
protected |
Definition at line 239 of file vtkXMLDataElement.h.
|
protected |
Definition at line 241 of file vtkXMLDataElement.h.
|
protected |
Definition at line 243 of file vtkXMLDataElement.h.
|
protected |
Definition at line 246 of file vtkXMLDataElement.h.
|
protected |
Definition at line 247 of file vtkXMLDataElement.h.
|
protected |
Definition at line 248 of file vtkXMLDataElement.h.
|
protected |
Definition at line 249 of file vtkXMLDataElement.h.
|
protected |
Definition at line 253 of file vtkXMLDataElement.h.
|
protected |
Definition at line 257 of file vtkXMLDataElement.h.
|
protected |
Definition at line 261 of file vtkXMLDataElement.h.
|
protected |
Definition at line 264 of file vtkXMLDataElement.h.
|
protected |
Definition at line 265 of file vtkXMLDataElement.h.
|
protected |
Definition at line 266 of file vtkXMLDataElement.h.
|
protected |
Definition at line 267 of file vtkXMLDataElement.h.
|
protected |
Definition at line 268 of file vtkXMLDataElement.h.
|
protected |
Definition at line 271 of file vtkXMLDataElement.h.
|
protected |
Definition at line 272 of file vtkXMLDataElement.h.
|
protected |
Definition at line 273 of file vtkXMLDataElement.h.
|
protected |
Definition at line 275 of file vtkXMLDataElement.h.