Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbXmlTag Class Reference

Large Data Management XML tag from LDM filer. More...

#include <LDM/xml/SbXmlTag.h>

Public Member Functions

bool exist ()
 Indicates if this XML tag is valid.
 
const char * getName ()
 Returns the name of the XML tag.
 
const char * getText ()
 Returns the text associated with the XML tag.
 
SbXmlTag getFirstChildTag ()
 Returns the first XML child tag.
 
SbXmlTag getNextSiblingTag ()
 Returns the next sibling XML child.
 

Detailed Description

Large Data Management XML tag from LDM filer.

This class allows the application to read back a custom XML section that was inserted in a LDM file header using the method SoLDMConverter::setXmlCallback().

Let's suppose the following XML text appears in the LDM file header:

...
<MY_CUSTOM_TAG_SECTION>
  text
  <CUSTOM_TAG1>value1</CUSTOM_TAG1>
  <CUSTOM_TAG2>value2</CUSTOM_TAG2>
</MY_CUSTOM_TAG_SECTION>
...

The following code will produce the output below:

SoVolumeData* volData = new SoVolumeData(); // Volume from LDM file
. . .
SoVRLdmFileReader* reader = (SoVRLdmFileReader*)(volData->getReader());
SbXmlTag myTagSection = reader->getXmlTag( "MY_CUSTOM_TAG_SECTION" );
if (myTagSection.exist()) {
const char* sectionName = myTagSection.getName();
const char* sectionText = myTagSection.getText();
for (SbXmlTag t = myTagSection.getFirstChildTag(); t.exist(); t = t.getNextSiblingTag()) {
const char* tagName = t.getName();
const char* tagText = t.getText();
}
}
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> XML tag ...
Definition SbXmlTag.h:122
SbXmlTag getFirstChildTag()
Returns the first XML child tag.
const char * getName()
Returns the name of the XML tag.
bool exist()
Indicates if this XML tag is valid.
const char * getText()
Returns the text associated with the XML tag.
SoVolumeReader * getReader()
Returns the current data set reader object.
Definition SoDataSet.h:586
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> LDM file...
<a href="IconLegend.html"><img src="extVR.gif" alt="VolumeViz" border="0"></a> Volume data property ...

Output:

MY_CUSTOM_TAG_SECTION:text
  CUSTOM_TAG1:value1
  CUSTOM_TAG2:value2

Definition at line 122 of file SbXmlTag.h.

Member Function Documentation

◆ exist()

bool SbXmlTag::exist ( )

Indicates if this XML tag is valid.

◆ getFirstChildTag()

SbXmlTag SbXmlTag::getFirstChildTag ( )

Returns the first XML child tag.

◆ getName()

const char * SbXmlTag::getName ( )

Returns the name of the XML tag.

◆ getNextSiblingTag()

SbXmlTag SbXmlTag::getNextSiblingTag ( )

Returns the next sibling XML child.

◆ getText()

const char * SbXmlTag::getText ( )

Returns the text associated with the XML tag.


The documentation for this class was generated from the following file: