MeshLink
Computational geometry access
MeshLinkParserXerces Class Reference

A MeshLink data parser using Apache Xerces XML library. More...

#include <MeshLinkParser_xerces.h>

Inheritance diagram for MeshLinkParserXerces:

Public Member Functions

 MeshLinkParserXerces ()
 Default constructor. More...
 
 ~MeshLinkParserXerces ()
 Destructor. More...
 
bool validate (const std::string &fileName, const std::string &schemaName) override
 Validate XML file against MeshLink schema using the Xerces parser. More...
 
bool parseMeshLinkFile (std::string fname, MeshAssociativity *meshAssociativity) override
 Parse a MeshLink XML file and populate a MeshAssociativity using the Xerces XML parser. More...
 
bool getMeshLinkAttributes (std::string &xmlns, std::string &xmlns_xsi, std::string &schemaLocation) override
 Obtain the MeshLink XML file properties after reading. More...
 
MeshLinkWriterXerces * getXMLWriter ()
 Return a new MeshLinkWriter object using the Xerces API. More...
 
void setVerboseLevel (int level)
 Set the verbosity of the parser message output. More...
 

Private Member Functions

bool parseAttributes (xercesc_3_2::DOMElement *root)
 Populate the MeshLinkAttribute objects. More...
 
bool parsePeriodicInfo (xercesc_3_2::DOMElement *root)
 Populate the Transform and MeshElementLinkage objects. More...
 
bool parseGeometryRefs (xercesc_3_2::DOMElement *root)
 Populate the GeometryGroup objects. More...
 
bool parseMeshFile (xercesc_3_2::DOMElement *element)
 Read the MeshLink XML into a Xerces DOM model. More...
 
bool parseMeshRefModel (MeshFile &meshFile, xercesc_3_2::DOMElement *modelRef)
 Create a MeshModel from the Xerces DOM model. More...
 
bool parseMeshSheet (MeshModel *model, xercesc_3_2::DOMElement *meshSheetNode)
 Create a MeshSheet in the given model from the Xerces DOM model. More...
 
bool parseMeshSheetReference (MeshModel *model, xercesc_3_2::DOMElement *meshSheetNode)
 Create a MeshSheet from reference data in the given model from the Xerces DOM model. More...
 
bool parseMeshString (MeshModel *model, xercesc_3_2::DOMElement *meshStringNode)
 Create a MeshString from reference data in the given model from the Xerces DOM model. More...
 
bool parseMeshStringReference (MeshModel *model, xercesc_3_2::DOMElement *meshStringNode)
 Create a MeshString from reference data in the given model from the Xerces DOM model. More...
 
bool parseParamVertex (MeshTopo *meshTopo, xercesc_3_2::DOMElement *element)
 Create a ParamVertex for the given MeshTopo entity from the Xerces DOM model. More...
 
bool parseMeshPoint (MeshModel *model, xercesc_3_2::DOMElement *meshPoint)
 Create a MeshPoint in the given model from the Xerces DOM model. More...
 
bool parseMeshPointReference (MeshModel *model, xercesc_3_2::DOMElement *meshPoint)
 Create a MeshPoint from reference data in the given model from the Xerces DOM model. More...
 
bool parseMeshPointReference (MeshModel *model, MeshTopo *parentMeshTopo, xercesc_3_2::DOMElement *meshPoint)
 Create a MeshPoint from reference data in the given model and parent MeshTopo entity from the Xerces DOM model. More...
 
bool parseMeshEdge (MeshModel *model, MeshTopo *meshTopo, xercesc_3_2::DOMElement *element)
 Create a MeshEdge in the given model and parent MeshTopo entity from the Xerces DOM model. More...
 
bool parseMeshEdgeReference (MeshModel *model, MeshTopo *meshTopo, xercesc_3_2::DOMElement *element)
 Create a MeshEdge from reference data in the given model and parent MeshTopo entity from the Xerces DOM model. More...
 
bool parseMeshFace (MeshModel *model, MeshTopo *meshTopo, xercesc_3_2::DOMElement *element)
 Create a MeshFace in the given model and parent MeshTopo entity from the Xerces DOM model. More...
 
bool parseMeshFaceReference (MeshModel *model, MeshTopo *meshTopo, xercesc_3_2::DOMElement *element)
 Create a MeshFace from reference data in the given model and parent MeshTopo entity from the Xerces DOM model. More...
 
bool parseMeshObject (MeshModel *model, MeshTopo *meshTopo, xercesc_3_2::DOMElement *xmlObj, const char *objName, ParseMeshObjMap &parseMeshObjMap, bool &mapID)
 Create MeshTopo object in the given MeshModel from the Xerces DOM model. The type of object to create is determined from the object name and lookup map. More...
 

Private Attributes

MeshAssociativitymeshAssociativity_
 the MeshAssociativity object to be populated More...
 
int verbose_level_
 
std::string xmlVersion_
 The XML version string read from the input file. More...
 
std::string xmlns_
 The XML Namespace string read from the input file. More...
 
std::string xmlns_xsi_
 The XML XSI Namespace string read from the input file. More...
 
std::string schemaLocation_
 The XSD file name read from the input file. More...
 

Detailed Description

A MeshLink data parser using Apache Xerces XML library.

This is a reference implementation of the MeshLinkParser API.

Definition at line 60 of file MeshLinkParser_xerces.h.

Constructor & Destructor Documentation

◆ MeshLinkParserXerces()

MeshLinkParserXerces::MeshLinkParserXerces ( )
inline

Default constructor.

Definition at line 63 of file MeshLinkParser_xerces.h.

◆ ~MeshLinkParserXerces()

MeshLinkParserXerces::~MeshLinkParserXerces ( )

Destructor.

Member Function Documentation

◆ getMeshLinkAttributes()

bool MeshLinkParserXerces::getMeshLinkAttributes ( std::string &  xmlns,
std::string &  xmlns_xsi,
std::string &  schemaLocation 
)
inlineoverridevirtual

Obtain the MeshLink XML file properties after reading.

Parameters
[out]xmlnsthe XML namespace string
[out]xmlns_xsithe XML Schema Instance (XSI) namespace string
[out]schemaLocationthe file name (path) of the XML Schema Definition (XSD) file

Reimplemented from MeshLinkParser.

Definition at line 94 of file MeshLinkParser_xerces.h.

◆ getXMLWriter()

MeshLinkWriterXerces* MeshLinkParserXerces::getXMLWriter ( )

Return a new MeshLinkWriter object using the Xerces API.

It is the responsibility of the caller to delete the returned object.

◆ parseAttributes()

bool MeshLinkParserXerces::parseAttributes ( xercesc_3_2::DOMElement *  root)
private

Populate the MeshLinkAttribute objects.

◆ parseGeometryRefs()

bool MeshLinkParserXerces::parseGeometryRefs ( xercesc_3_2::DOMElement *  root)
private

Populate the GeometryGroup objects.

◆ parseMeshEdge()

bool MeshLinkParserXerces::parseMeshEdge ( MeshModel model,
MeshTopo meshTopo,
xercesc_3_2::DOMElement *  element 
)
private

Create a MeshEdge in the given model and parent MeshTopo entity from the Xerces DOM model.

◆ parseMeshEdgeReference()

bool MeshLinkParserXerces::parseMeshEdgeReference ( MeshModel model,
MeshTopo meshTopo,
xercesc_3_2::DOMElement *  element 
)
private

Create a MeshEdge from reference data in the given model and parent MeshTopo entity from the Xerces DOM model.

◆ parseMeshFace()

bool MeshLinkParserXerces::parseMeshFace ( MeshModel model,
MeshTopo meshTopo,
xercesc_3_2::DOMElement *  element 
)
private

Create a MeshFace in the given model and parent MeshTopo entity from the Xerces DOM model.

◆ parseMeshFaceReference()

bool MeshLinkParserXerces::parseMeshFaceReference ( MeshModel model,
MeshTopo meshTopo,
xercesc_3_2::DOMElement *  element 
)
private

Create a MeshFace from reference data in the given model and parent MeshTopo entity from the Xerces DOM model.

◆ parseMeshFile()

bool MeshLinkParserXerces::parseMeshFile ( xercesc_3_2::DOMElement *  element)
private

Read the MeshLink XML into a Xerces DOM model.

◆ parseMeshLinkFile()

bool MeshLinkParserXerces::parseMeshLinkFile ( std::string  fname,
MeshAssociativity meshAssociativity 
)
overridevirtual

Parse a MeshLink XML file and populate a MeshAssociativity using the Xerces XML parser.

Parameters
fnamethe MeshLink XML file name
meshAssociativitythe MeshAssociativity object to populate
Returns
true if the file was successfully read and the MeshAssociativity object was populated

Reimplemented from MeshLinkParser.

◆ parseMeshObject()

bool MeshLinkParserXerces::parseMeshObject ( MeshModel model,
MeshTopo meshTopo,
xercesc_3_2::DOMElement *  xmlObj,
const char *  objName,
ParseMeshObjMap parseMeshObjMap,
bool &  mapID 
)
private

Create MeshTopo object in the given MeshModel from the Xerces DOM model. The type of object to create is determined from the object name and lookup map.

◆ parseMeshPoint()

bool MeshLinkParserXerces::parseMeshPoint ( MeshModel model,
xercesc_3_2::DOMElement *  meshPoint 
)
private

Create a MeshPoint in the given model from the Xerces DOM model.

◆ parseMeshPointReference() [1/2]

bool MeshLinkParserXerces::parseMeshPointReference ( MeshModel model,
xercesc_3_2::DOMElement *  meshPoint 
)
private

Create a MeshPoint from reference data in the given model from the Xerces DOM model.

◆ parseMeshPointReference() [2/2]

bool MeshLinkParserXerces::parseMeshPointReference ( MeshModel model,
MeshTopo parentMeshTopo,
xercesc_3_2::DOMElement *  meshPoint 
)
private

Create a MeshPoint from reference data in the given model and parent MeshTopo entity from the Xerces DOM model.

◆ parseMeshRefModel()

bool MeshLinkParserXerces::parseMeshRefModel ( MeshFile meshFile,
xercesc_3_2::DOMElement *  modelRef 
)
private

Create a MeshModel from the Xerces DOM model.

◆ parseMeshSheet()

bool MeshLinkParserXerces::parseMeshSheet ( MeshModel model,
xercesc_3_2::DOMElement *  meshSheetNode 
)
private

Create a MeshSheet in the given model from the Xerces DOM model.

◆ parseMeshSheetReference()

bool MeshLinkParserXerces::parseMeshSheetReference ( MeshModel model,
xercesc_3_2::DOMElement *  meshSheetNode 
)
private

Create a MeshSheet from reference data in the given model from the Xerces DOM model.

◆ parseMeshString()

bool MeshLinkParserXerces::parseMeshString ( MeshModel model,
xercesc_3_2::DOMElement *  meshStringNode 
)
private

Create a MeshString from reference data in the given model from the Xerces DOM model.

◆ parseMeshStringReference()

bool MeshLinkParserXerces::parseMeshStringReference ( MeshModel model,
xercesc_3_2::DOMElement *  meshStringNode 
)
private

Create a MeshString from reference data in the given model from the Xerces DOM model.

◆ parseParamVertex()

bool MeshLinkParserXerces::parseParamVertex ( MeshTopo meshTopo,
xercesc_3_2::DOMElement *  element 
)
private

Create a ParamVertex for the given MeshTopo entity from the Xerces DOM model.

◆ parsePeriodicInfo()

bool MeshLinkParserXerces::parsePeriodicInfo ( xercesc_3_2::DOMElement *  root)
private

Populate the Transform and MeshElementLinkage objects.

◆ setVerboseLevel()

void MeshLinkParserXerces::setVerboseLevel ( int  level)
inline

Set the verbosity of the parser message output.

Larger values result in more output. 0 = errors only.

Definition at line 114 of file MeshLinkParser_xerces.h.

◆ validate()

bool MeshLinkParserXerces::validate ( const std::string &  fileName,
const std::string &  schemaName 
)
overridevirtual

Validate XML file against MeshLink schema using the Xerces parser.

Parameters
fileNamethe MeshLink XML file name
schemaNamethe MeshLink XML Schema Definition (XSD) file name
Returns
true if the XML conforms to the schema

Reimplemented from MeshLinkParser.

Member Data Documentation

◆ meshAssociativity_

MeshAssociativity* MeshLinkParserXerces::meshAssociativity_
private

the MeshAssociativity object to be populated

Definition at line 178 of file MeshLinkParser_xerces.h.

◆ schemaLocation_

std::string MeshLinkParserXerces::schemaLocation_
private

The XSD file name read from the input file.

Definition at line 193 of file MeshLinkParser_xerces.h.

◆ verbose_level_

int MeshLinkParserXerces::verbose_level_
private

Definition at line 180 of file MeshLinkParser_xerces.h.

◆ xmlns_

std::string MeshLinkParserXerces::xmlns_
private

The XML Namespace string read from the input file.

Definition at line 189 of file MeshLinkParser_xerces.h.

◆ xmlns_xsi_

std::string MeshLinkParserXerces::xmlns_xsi_
private

The XML XSI Namespace string read from the input file.

Definition at line 191 of file MeshLinkParser_xerces.h.

◆ xmlVersion_

std::string MeshLinkParserXerces::xmlVersion_
private

The XML version string read from the input file.

Definition at line 187 of file MeshLinkParser_xerces.h.


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