![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <vtkPVXMLElement.h>
Public Member Functions | |
| vtkTypeMacro (vtkPVXMLElement, vtkObject) | |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| vtkSetStringMacro (Name) | |
| vtkGetStringMacro (Name) | |
| vtkGetStringMacro (Id) | |
| const char * | GetAttribute (const char *name) |
| const char * | GetAttributeOrEmpty (const char *name) |
| const char * | GetAttributeOrDefault (const char *name, const char *notFound) |
| const char * | GetCharacterData () |
| int | GetScalarAttribute (const char *name, int *value) |
| int | GetScalarAttribute (const char *name, float *value) |
| int | GetScalarAttribute (const char *name, double *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 | GetCharacterDataAsVector (int length, int *value) |
| int | GetCharacterDataAsVector (int length, float *value) |
| int | GetCharacterDataAsVector (int length, double *value) |
| vtkPVXMLElement * | GetParent () |
| unsigned int | GetNumberOfNestedElements () |
| vtkPVXMLElement * | GetNestedElement (unsigned int index) |
| vtkPVXMLElement * | FindNestedElement (const char *id) |
| vtkPVXMLElement * | FindNestedElementByName (const char *name) |
| void | FindNestedElementByName (const char *name, vtkCollection *elements) |
| void | RemoveAllNestedElements () |
| void | RemoveNestedElement (vtkPVXMLElement *) |
| void | ReplaceNestedElement (vtkPVXMLElement *elementToReplace, vtkPVXMLElement *element) |
| vtkPVXMLElement * | LookupElement (const char *id) |
| void | AddAttribute (const char *attrName, const char *attrValue) |
| void | AddAttribute (const char *attrName, unsigned int attrValue) |
| void | AddAttribute (const char *attrName, double attrValue) |
| void | AddAttribute (const char *attrName, double attrValue, int precision) |
| void | AddAttribute (const char *attrName, int attrValue) |
| void | RemoveAttribute (const char *attrName) |
| void | SetAttribute (const char *attrName, const char *attrValue) |
| void | AddNestedElement (vtkPVXMLElement *element, int setPrent) |
| void | AddNestedElement (vtkPVXMLElement *element) |
| void | PrintXML (ostream &os, vtkIndent indent) |
| void | PrintXML () |
| void | Merge (vtkPVXMLElement *element, const char *attributeName) |
| void | GetElementsByName (const char *name, vtkCollection *elements) |
| void | GetElementsByName (const char *name, vtkCollection *elements, bool recursively) |
| bool | Equals (vtkPVXMLElement *other) |
| void | CopyTo (vtkPVXMLElement *other) |
| void | CopyAttributesTo (vtkPVXMLElement *other) |
Static Public Member Functions | |
| static vtkPVXMLElement * | New () |
| static std::string | Encode (const char *plaintext) |
Protected Member Functions | |
| vtkPVXMLElement () | |
| ~vtkPVXMLElement () override | |
| vtkSetStringMacro (Id) | |
| void | ReadXMLAttributes (const char **atts) |
| void | AddCharacterData (const char *data, int length) |
| vtkPVXMLElement * | LookupElementInScope (const char *id) |
| vtkPVXMLElement * | LookupElementUpScope (const char *id) |
| void | SetParent (vtkPVXMLElement *parent) |
Protected Attributes | |
| char * | Name |
| char * | Id |
| vtkPVXMLElement * | Parent |
|
overrideprotected |
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| const char * | attrValue | ||
| ) |
Given it's name and value, add an attribute.
Referenced by AddAttribute(), Merge(), ReadXMLAttributes(), and SetAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| double | attrValue | ||
| ) |
References AddAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| double | attrValue, | ||
| int | precision | ||
| ) |
References AddAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| int | attrValue | ||
| ) |
References AddAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| unsigned int | attrValue | ||
| ) |
References AddAttribute().
|
protected |
References data.
Referenced by vtkPVXMLParser::CharacterDataHandler(), CopyAttributesTo(), and CopyTo().
| void vtkPVXMLElement::AddNestedElement | ( | vtkPVXMLElement * | element | ) |
References AddNestedElement().
| void vtkPVXMLElement::AddNestedElement | ( | vtkPVXMLElement * | element, |
| int | setPrent | ||
| ) |
Add a sub-element. The parent element keeps a reference to sub-element. If setParent is true, the nested element's parent is set as this.
References SetParent().
Referenced by AddNestedElement(), CopyTo(), vtkPVXMLParser::EndElement(), and Merge().
| void vtkPVXMLElement::CopyAttributesTo | ( | vtkPVXMLElement * | other | ) |
Copy the attributes from current XML element content into the provided one.
References AddCharacterData().
| void vtkPVXMLElement::CopyTo | ( | vtkPVXMLElement * | other | ) |
Copy the current XML element content into the provided one
References AddCharacterData(), and AddNestedElement().
|
static |
| bool vtkPVXMLElement::Equals | ( | vtkPVXMLElement * | other | ) |
Return true if the current object has the same content as the other. The comparison implementation is pretty weak in the mean that we compare resulting XML string.
References PrintXML().
| vtkPVXMLElement * vtkPVXMLElement::FindNestedElement | ( | const char * | id | ) |
Find a nested element with the given id. Not that this searches only the immediate children of this vtkPVXMLElement.
Referenced by LookupElementInScope(), and LookupElementUpScope().
| vtkPVXMLElement * vtkPVXMLElement::FindNestedElementByName | ( | const char * | name | ) |
Locate a nested element with the given tag name.
References name.
| void vtkPVXMLElement::FindNestedElementByName | ( | const char * | name, |
| vtkCollection * | elements | ||
| ) |
Locate a set of nested elements with the given tag name.
References GetElementsByName().
|
inline |
Get the attribute with the given name. If it doesn't exist, returns NULL.
Referenced by GetVectorAttribute(), Merge(), and vtkPVXMLParser::StartElement().
| const char * vtkPVXMLElement::GetAttributeOrDefault | ( | const char * | name, |
| const char * | notFound | ||
| ) |
Get the attribute with the given name. If it doesn't exist, returns the provided notFound value.
References name.
|
inline |
Get the attribute with the given name. If it doesn't exist, returns "".
References name.
| const char * vtkPVXMLElement::GetCharacterData | ( | ) |
Get the character data for the element.
Referenced by GetCharacterDataAsVector().
| int vtkPVXMLElement::GetCharacterDataAsVector | ( | int | length, |
| double * | value | ||
| ) |
References data, GetCharacterData(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetCharacterDataAsVector | ( | int | length, |
| float * | value | ||
| ) |
References data, GetCharacterData(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetCharacterDataAsVector | ( | int | length, |
| int * | value | ||
| ) |
Get the character data converted to a scalar value. Returns length of vector read.
References data, GetCharacterData(), and vtkPVXMLVectorAttributeParse().
| void vtkPVXMLElement::GetElementsByName | ( | const char * | name, |
| vtkCollection * | elements | ||
| ) |
Similar to DOM specific getElementsByTagName(). Returns a list of vtkPVXMLElements with the given name in the order in which they will be encountered in a preorder traversal of the sub-tree under this node. The elements are populated in the vtkCollection passed as an argument.
Referenced by FindNestedElementByName(), and GetElementsByName().
| void vtkPVXMLElement::GetElementsByName | ( | const char * | name, |
| vtkCollection * | elements, | ||
| bool | recursively | ||
| ) |
References GetElementsByName(), GetNestedElement(), GetNumberOfNestedElements(), and name.
| vtkPVXMLElement * vtkPVXMLElement::GetNestedElement | ( | unsigned int | index | ) |
Get the element nested in this one at the given index.
Referenced by GetElementsByName(), and PrintSelf().
| unsigned int vtkPVXMLElement::GetNumberOfNestedElements | ( | ) |
Get the number of elements nested in this one.
Referenced by GetElementsByName(), and PrintSelf().
| vtkPVXMLElement * vtkPVXMLElement::GetParent | ( | ) |
| int vtkPVXMLElement::GetScalarAttribute | ( | const char * | name, |
| double * | value | ||
| ) |
References GetVectorAttribute().
| int vtkPVXMLElement::GetScalarAttribute | ( | const char * | name, |
| float * | value | ||
| ) |
References GetVectorAttribute().
| int vtkPVXMLElement::GetScalarAttribute | ( | const char * | name, |
| int * | value | ||
| ) |
Get the attribute with the given name converted to a scalar value. Returns whether value was extracted.
References GetVectorAttribute().
| int vtkPVXMLElement::GetVectorAttribute | ( | const char * | name, |
| int | length, | ||
| double * | value | ||
| ) |
References data, GetAttribute(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetVectorAttribute | ( | const char * | name, |
| int | length, | ||
| float * | value | ||
| ) |
References data, GetAttribute(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetVectorAttribute | ( | const char * | name, |
| int | length, | ||
| int * | value | ||
| ) |
Get the attribute with the given name converted to a scalar value. Returns length of vector read.
References data, GetAttribute(), and vtkPVXMLVectorAttributeParse().
Referenced by GetScalarAttribute().
| vtkPVXMLElement * vtkPVXMLElement::LookupElement | ( | const char * | id | ) |
Lookup the element with the given id, starting at this scope.
References LookupElementUpScope().
|
protected |
References FindNestedElement(), name, and next.
Referenced by LookupElementUpScope().
|
protected |
References FindNestedElement(), GetParent(), LookupElementInScope(), and name.
Referenced by LookupElement().
| void vtkPVXMLElement::Merge | ( | vtkPVXMLElement * | element, |
| const char * | attributeName | ||
| ) |
Merges another element with this one, both having the same name. If any attribute, character data or nested element exists in both, the passed in one will override this one's. If they don't exist, they'll be added. If nested elements have the same names, the optional attributeName maybe passed in as another criteria to determine what to merge in case of same names.
References AddAttribute(), AddNestedElement(), GetAttribute(), and NULL.
|
static |
Referenced by vtkPVXMLParser::StartElement().
|
override |
References QtCompat::endl(), GetNestedElement(), GetNumberOfNestedElements(), Id, Name, and PrintSelf().
Referenced by PrintSelf().
| void vtkPVXMLElement::PrintXML | ( | ) |
Referenced by Equals().
| void vtkPVXMLElement::PrintXML | ( | ostream & | os, |
| vtkIndent | indent | ||
| ) |
Serialize (as XML) in the given stream.
References Encode(), Name, and vtkIsSpace().
Referenced by Equals(), and vtkPVXMLParser::PrintXML().
|
protected |
References AddAttribute(), and count.
Referenced by vtkPVXMLParser::StartElement().
| void vtkPVXMLElement::RemoveAllNestedElements | ( | ) |
Removes all nested elements.
| void vtkPVXMLElement::RemoveAttribute | ( | const char * | attrName | ) |
Remove the attribute from the current element
References name.
| void vtkPVXMLElement::RemoveNestedElement | ( | vtkPVXMLElement * | element | ) |
Remove a particular element.
| void vtkPVXMLElement::ReplaceNestedElement | ( | vtkPVXMLElement * | elementToReplace, |
| vtkPVXMLElement * | element | ||
| ) |
Replace a particular element with another
| void vtkPVXMLElement::SetAttribute | ( | const char * | attrName, |
| const char * | attrValue | ||
| ) |
Given it's name and value, set an attribute. If an attribute with the given name already exists, it replaces the old attribute. chars that need to be XML escaped will be done so internally for example " will be converted to "
References AddAttribute().
|
protected |
References Parent.
Referenced by AddNestedElement().
| vtkPVXMLElement::vtkGetStringMacro | ( | Id | ) |
Get the id of the element. This is assigned by the XML parser and can be used as an identifier to an element.
| vtkPVXMLElement::vtkGetStringMacro | ( | Name | ) |
|
protected |
| vtkPVXMLElement::vtkSetStringMacro | ( | Name | ) |
Set/Get the name of the element. This is its XML tag. (<Name/>).
| vtkPVXMLElement::vtkTypeMacro | ( | vtkPVXMLElement | , |
| vtkObject | |||
| ) |
|
protected |
Referenced by PrintSelf(), and vtkPVXMLElement().
|
protected |
Referenced by PrintSelf(), PrintXML(), and vtkPVXMLElement().
|
protected |
Referenced by GetParent(), SetParent(), and vtkPVXMLElement().