Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkXMLDataElement Class Reference

#include <vtkXMLDataElement.h>

Inheritance diagram for vtkXMLDataElement:

Inheritance graph
[legend]
Collaboration diagram for vtkXMLDataElement:

Collaboration graph
[legend]
List of all members.

Detailed Description

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.

See also:
vtkXMLDataParser

Definition at line 34 of file vtkXMLDataElement.h.
virtual char * GetName ()
virtual void SetName (const char *)
static vtkXMLDataElementNew ()

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
const char * GetAttribute (const char *name)
const char * GetAttributeName (int idx)
const char * GetAttributeValue (int idx)
virtual vtkXMLDataElementGetRoot ()
int GetNumberOfNestedElements ()
vtkXMLDataElementGetNestedElement (int index)
void AddNestedElement (vtkXMLDataElement *element)
virtual void RemoveNestedElement (vtkXMLDataElement *)
virtual int IsEqualTo (vtkXMLDataElement *elem)
virtual char * GetId ()
virtual void SetId (const char *)
void SetAttribute (const char *name, const char *value)
void SetCharacterData (const char *c, int length)
void AddCharacterData (const char *c, int 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)
int GetWordTypeAttribute (const char *name, int &value)
virtual int GetNumberOfAttributes ()
virtual void RemoveAllAttributes ()
vtkXMLDataElementGetParent ()
void SetParent (vtkXMLDataElement *parent)
virtual void RemoveAllNestedElements ()
vtkXMLDataElementFindNestedElement (const char *id)
vtkXMLDataElementFindNestedElementWithName (const char *name)
vtkXMLDataElementFindNestedElementWithNameAndId (const char *name, const char *id)
vtkXMLDataElementFindNestedElementWithNameAndAttribute (const char *name, const char *att_name, const char *att_value)
vtkXMLDataElementLookupElement (const char *id)
virtual unsigned long GetXMLByteIndex ()
virtual void SetXMLByteIndex (unsigned long)
virtual void DeepCopy (vtkXMLDataElement *elem)
virtual void SetAttributeEncoding (int)
virtual int GetAttributeEncoding ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkXMLDataElementSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkXMLDataElement ()
 ~vtkXMLDataElement ()
void ReadXMLAttributes (const char **atts, int encoding)
void SeekInlineDataPosition (vtkXMLDataParser *parser)
void PrintXML (ostream &os, vtkIndent indent)
vtkXMLDataElementLookupElementInScope (const char *id)
vtkXMLDataElementLookupElementUpScope (const char *id)

Static Protected Member Functions

static int IsSpace (char c)

Protected Attributes

char * Name
char * Id
char * CharacterData
unsigned long XMLByteIndex
unsigned long InlineDataPosition
char ** AttributeNames
char ** AttributeValues
int NumberOfAttributes
int AttributesSize
int AttributeEncoding
int NumberOfNestedElements
int NestedElementsSize
vtkXMLDataElement ** NestedElements
vtkXMLDataElementParent

Friends

class vtkXMLDataParser
class vtkXMLMaterialParser


Member Typedef Documentation

typedef vtkObject vtkXMLDataElement::Superclass
 

Reimplemented from vtkObject.

Definition at line 37 of file vtkXMLDataElement.h.


Constructor & Destructor Documentation

vtkXMLDataElement::vtkXMLDataElement  )  [protected]
 

vtkXMLDataElement::~vtkXMLDataElement  )  [protected]
 


Member Function Documentation

virtual const char* vtkXMLDataElement::GetClassName  )  [virtual]
 

Reimplemented from vtkObject.

static int vtkXMLDataElement::IsTypeOf const char *  type  )  [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

virtual int vtkXMLDataElement::IsA const char *  type  )  [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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

static vtkXMLDataElement* vtkXMLDataElement::SafeDownCast vtkObject o  )  [static]
 

Reimplemented from vtkObject.

void vtkXMLDataElement::PrintSelf ostream &  os,
vtkIndent  indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

static vtkXMLDataElement* vtkXMLDataElement::New  )  [static]
 

Set/Get the name of the element. This is its XML tag.

Reimplemented from vtkObject.

virtual char* vtkXMLDataElement::GetName  )  [virtual]
 

Set/Get the name of the element. This is its XML tag.

virtual void vtkXMLDataElement::SetName const char *   )  [virtual]
 

Set/Get the name of the element. This is its XML tag.

virtual char* vtkXMLDataElement::GetId  )  [virtual]
 

Set/Get the value of the id attribute of the element, if any.

virtual void vtkXMLDataElement::SetId const char *   )  [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.

void vtkXMLDataElement::AddCharacterData const char *  c,
int  length
 

Set the attribute with the given name and value. If it doesn't exist, adds it.

virtual char* vtkXMLDataElement::GetCharacterData  )  [virtual]
 

Set the attribute with the given name and value. If it doesn't exist, adds it.

int vtkXMLDataElement::GetScalarAttribute const char *  name,
int &  value
 

Get the attribute with the given name and converted to a scalar value. Returns whether value was extracted.

int vtkXMLDataElement::GetScalarAttribute const char *  name,
float &  value
 

Get the attribute with the given name and converted to a scalar value. Returns whether value was extracted.

int vtkXMLDataElement::GetScalarAttribute const char *  name,
double &  value
 

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).

int vtkXMLDataElement::GetVectorAttribute const char *  name,
int  length,
int *  value
 

Get the attribute with the given name and converted to a scalar value. Returns length of vector read.

int vtkXMLDataElement::GetVectorAttribute const char *  name,
int  length,
float *  value
 

Get the attribute with the given name and converted to a scalar value. Returns length of vector read.

int vtkXMLDataElement::GetVectorAttribute const char *  name,
int  length,
double *  value
 

Get the attribute with the given name and converted to a scalar value. Returns length of vector read.

int vtkXMLDataElement::GetVectorAttribute const char *  name,
int  length,
unsigned long *  value
 

Get the attribute with the given name and converted to a scalar value. Returns length of vector read.

void vtkXMLDataElement::SetVectorAttribute const char *  name,
int  length,
const int *  value
 

Set the attribute with the given name.

void vtkXMLDataElement::SetVectorAttribute const char *  name,
int  length,
const float *  value
 

Set the attribute with the given name.

void vtkXMLDataElement::SetVectorAttribute const char *  name,
int  length,
const double *  value
 

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.

int vtkXMLDataElement::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_LONG.

virtual int vtkXMLDataElement::GetNumberOfAttributes  )  [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 void vtkXMLDataElement::RemoveAllAttributes  )  [virtual]
 

Remove all attributes.

vtkXMLDataElement* vtkXMLDataElement::GetParent  ) 
 

Set/Get the parent of this element.

void vtkXMLDataElement::SetParent vtkXMLDataElement parent  ) 
 

Remove all attributes.

virtual vtkXMLDataElement* vtkXMLDataElement::GetRoot  )  [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 void vtkXMLDataElement::RemoveNestedElement vtkXMLDataElement  )  [virtual]
 

Remove nested element.

virtual void vtkXMLDataElement::RemoveAllNestedElements  )  [virtual]
 

Remove all nested elements.

vtkXMLDataElement* vtkXMLDataElement::FindNestedElement const char *  id  ) 
 

Find a nested element with the given id, given name, or given name and id.

vtkXMLDataElement* vtkXMLDataElement::FindNestedElementWithName const char *  name  ) 
 

Remove all nested elements.

vtkXMLDataElement* vtkXMLDataElement::FindNestedElementWithNameAndId const char *  name,
const char *  id
 

Remove all nested elements.

vtkXMLDataElement* vtkXMLDataElement::FindNestedElementWithNameAndAttribute const char *  name,
const char *  att_name,
const char *  att_value
 

Remove all nested elements.

vtkXMLDataElement* vtkXMLDataElement::LookupElement const char *  id  ) 
 

Lookup the element with the given id, starting at this scope.

virtual unsigned long vtkXMLDataElement::GetXMLByteIndex  )  [virtual]
 

Set/Get the offset from the beginning of the XML document to this element.

virtual void vtkXMLDataElement::SetXMLByteIndex unsigned  long  )  [virtual]
 

Lookup the element with the given id, starting at this scope.

virtual int vtkXMLDataElement::IsEqualTo vtkXMLDataElement elem  )  [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 void vtkXMLDataElement::DeepCopy vtkXMLDataElement elem  )  [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 void vtkXMLDataElement::SetAttributeEncoding int   )  [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 int vtkXMLDataElement::GetAttributeEncoding  )  [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.

void vtkXMLDataElement::ReadXMLAttributes const char **  atts,
int  encoding
[protected]
 

void vtkXMLDataElement::SeekInlineDataPosition vtkXMLDataParser parser  )  [protected]
 

void vtkXMLDataElement::PrintXML ostream &  os,
vtkIndent  indent
[protected]
 

vtkXMLDataElement* vtkXMLDataElement::LookupElementInScope const char *  id  )  [protected]
 

vtkXMLDataElement* vtkXMLDataElement::LookupElementUpScope const char *  id  )  [protected]
 

static int vtkXMLDataElement::IsSpace char  c  )  [static, protected]
 


Friends And Related Function Documentation

friend class vtkXMLDataParser [friend]
 

Definition at line 245 of file vtkXMLDataElement.h.

friend class vtkXMLMaterialParser [friend]
 

Definition at line 246 of file vtkXMLDataElement.h.


Member Data Documentation

char* vtkXMLDataElement::Name [protected]
 

Definition at line 204 of file vtkXMLDataElement.h.

char* vtkXMLDataElement::Id [protected]
 

Definition at line 207 of file vtkXMLDataElement.h.

char* vtkXMLDataElement::CharacterData [protected]
 

Definition at line 210 of file vtkXMLDataElement.h.

unsigned long vtkXMLDataElement::XMLByteIndex [protected]
 

Definition at line 213 of file vtkXMLDataElement.h.

unsigned long vtkXMLDataElement::InlineDataPosition [protected]
 

Definition at line 216 of file vtkXMLDataElement.h.

char** vtkXMLDataElement::AttributeNames [protected]
 

Definition at line 219 of file vtkXMLDataElement.h.

char** vtkXMLDataElement::AttributeValues [protected]
 

Definition at line 220 of file vtkXMLDataElement.h.

int vtkXMLDataElement::NumberOfAttributes [protected]
 

Definition at line 221 of file vtkXMLDataElement.h.

int vtkXMLDataElement::AttributesSize [protected]
 

Definition at line 222 of file vtkXMLDataElement.h.

int vtkXMLDataElement::AttributeEncoding [protected]
 

Definition at line 223 of file vtkXMLDataElement.h.

int vtkXMLDataElement::NumberOfNestedElements [protected]
 

Definition at line 226 of file vtkXMLDataElement.h.

int vtkXMLDataElement::NestedElementsSize [protected]
 

Definition at line 227 of file vtkXMLDataElement.h.

vtkXMLDataElement** vtkXMLDataElement::NestedElements [protected]
 

Definition at line 228 of file vtkXMLDataElement.h.

vtkXMLDataElement* vtkXMLDataElement::Parent [protected]
 

Definition at line 231 of file vtkXMLDataElement.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 22 00:32:05 2008 for VTK by  doxygen 1.4.3-20050530