OGS
|
Data Explorer XML interface for project files
Definition at line 30 of file XmlPrjInterface.h.
#include <XmlPrjInterface.h>
Public Member Functions | |
XmlPrjInterface (DataHolderLib::Project &project) | |
~XmlPrjInterface () override=default | |
int | readFile (const QString &fileName) override |
Reads an xml-file containing a project. | |
bool | readFile (std::string const &fname) |
Reads an xml-file containing a project. | |
int | writeToFile (const std::string &filename) |
Writes a project to the specified file. | |
Public Member Functions inherited from BaseLib::IO::Writer | |
Writer () | |
virtual | ~Writer ()=default |
std::string | writeToString () |
Writes the object to a string. | |
Public Member Functions inherited from BaseLib::IO::XMLQtInterface | |
XMLQtInterface (QString schemaFile="") | |
virtual | ~XMLQtInterface ()=default |
Protected Member Functions | |
bool | write () override |
Writes the object to the internal stream. This method must be implemented by a subclass. The implementation should return true on success, else false. | |
Protected Member Functions inherited from BaseLib::IO::Writer | |
Protected Member Functions inherited from BaseLib::IO::XMLQtInterface | |
bool | checkHash () const |
QByteArray const & | getContent () const |
Private Member Functions | |
QDomNode | findParam (QDomNode const ¶m_root, QString const ¶m_name) const |
Tests if a given parameter exists within the file. | |
void | readConditions (QDomNode const &pvar_root, QDomNode const ¶m_root) |
Manages reading all kinds of conditions. | |
void | readBoundaryConditions (QDomNode const &bc_root, QDomNode const ¶m_root, DataHolderLib::ProcessVariable const &pvar) |
Reading all boundary conditions. | |
void | readSourceTerms (QDomNode const &st_root, QDomNode const ¶m_root, DataHolderLib::ProcessVariable const &pvar) |
Reading all source terms. | |
void | writeProcessVariables (QDomDocument &doc, QDomElement &root) const |
Writes information on process variables. | |
std::vector< DataHolderLib::ProcessVariable > | getPrimaryVariableVec () const |
Compiles a vector of all existing primary variables for writing purposes. | |
template<typename T > | |
void | writeCondition (QDomDocument &doc, QDomElement &tag, DataHolderLib::FemCondition const &cond) const |
Writes one specific condition. | |
void | writeBoundaryConditions (QDomDocument &doc, QDomElement &bc_list_tag, std::string const &name) const |
Writes a list of boundary conditions. | |
void | writeSourceTerms (QDomDocument &doc, QDomElement &st_list_tag, std::string const &name) const |
Writes a list of source terms. | |
template<typename T > | |
T * | parseCondition (QDomNode const &node, QDomNode const ¶m_root, DataHolderLib::ProcessVariable const &pvar) const |
Parsing one specific condition. | |
Private Attributes | |
std::string | _filename |
DataHolderLib::Project & | _project |
Additional Inherited Members | |
Protected Attributes inherited from BaseLib::IO::Writer | |
std::ostringstream | out |
The stream to write to. | |
|
explicit |
Definition at line 33 of file XmlPrjInterface.cpp.
|
overridedefault |
|
private |
Tests if a given parameter exists within the file.
Definition at line 159 of file XmlPrjInterface.cpp.
Referenced by parseCondition().
|
private |
Compiles a vector of all existing primary variables for writing purposes.
Definition at line 445 of file XmlPrjInterface.cpp.
References _project, DataHolderLib::Project::getBoundaryConditions(), DataHolderLib::Project::getSourceTerms(), DataHolderLib::ProcessVariable::name, and FileIO::PVarExists().
Referenced by writeProcessVariables().
|
private |
Parsing one specific condition.
Definition at line 260 of file XmlPrjInterface.cpp.
References findParam(), DataHolderLib::GEOMETRY, and DataHolderLib::MESH.
Referenced by readBoundaryConditions(), and readSourceTerms().
|
private |
Reading all boundary conditions.
Definition at line 220 of file XmlPrjInterface.cpp.
References _project, DataHolderLib::Project::addBoundaryCondition(), DataHolderLib::BoundaryCondition::NONE, and parseCondition().
Referenced by readConditions().
|
private |
Manages reading all kinds of conditions.
Definition at line 183 of file XmlPrjInterface.cpp.
References DataHolderLib::ProcessVariable::components, DataHolderLib::ProcessVariable::name, DataHolderLib::ProcessVariable::order, readBoundaryConditions(), and readSourceTerms().
Referenced by readFile().
|
overridevirtual |
Reads an xml-file containing a project.
Reimplemented from BaseLib::IO::XMLQtInterface.
Definition at line 38 of file XmlPrjInterface.cpp.
References _project, DataHolderLib::Project::addMesh(), OGSError::box(), ERR(), BaseLib::IO::XMLQtInterface::getContent(), DataHolderLib::Project::getGEOObjects(), INFO(), readConditions(), GeoLib::IO::XmlGmlInterface::readFile(), GeoLib::IO::XmlStnInterface::readFile(), and MeshLib::IO::readMeshFromFile().
Referenced by MainWindow::loadFile(), and readFile().
|
inline |
Reads an xml-file containing a project.
Definition at line 42 of file XmlPrjInterface.h.
References readFile().
|
private |
Reading all source terms.
Definition at line 241 of file XmlPrjInterface.cpp.
References _project, DataHolderLib::Project::addSourceTerm(), DataHolderLib::SourceTerm::NONE, and parseCondition().
Referenced by readConditions().
|
overrideprotectedvirtual |
Writes the object to the internal stream. This method must be implemented by a subclass. The implementation should return true on success, else false.
Implements BaseLib::IO::Writer.
Definition at line 336 of file XmlPrjInterface.cpp.
References _filename, _project, ERR(), BaseLib::IO::XMLInterface::export_name, DataHolderLib::Project::getBoundaryConditions(), GeoLib::GEOObjects::getGeometryNames(), DataHolderLib::Project::getGEOObjects(), DataHolderLib::Project::getMeshObjects(), DataHolderLib::Project::getSourceTerms(), GeoLib::GEOObjects::getStationVectorNames(), BaseLib::IO::Writer::out, MeshLib::IO::writeMeshToFile(), writeProcessVariables(), BaseLib::IO::writeStringToFile(), and BaseLib::IO::Writer::writeToString().
|
private |
Writes a list of boundary conditions.
Definition at line 511 of file XmlPrjInterface.cpp.
References _project, DataHolderLib::Project::getBoundaryConditions(), and writeCondition().
Referenced by writeProcessVariables().
|
private |
Writes one specific condition.
Definition at line 474 of file XmlPrjInterface.cpp.
References FileIO::addTextNode(), DataHolderLib::GEOMETRY, DataHolderLib::FemCondition::getBaseObjName(), DataHolderLib::FemCondition::getBaseObjType(), DataHolderLib::FemCondition::getObjName(), DataHolderLib::FemCondition::getParamName(), and DataHolderLib::MESH.
Referenced by writeBoundaryConditions(), and writeSourceTerms().
|
private |
Writes information on process variables.
Definition at line 547 of file XmlPrjInterface.cpp.
References FileIO::addTextNode(), getPrimaryVariableVec(), writeBoundaryConditions(), and writeSourceTerms().
Referenced by write().
|
private |
Writes a list of source terms.
Definition at line 529 of file XmlPrjInterface.cpp.
References _project, DataHolderLib::Project::getSourceTerms(), and writeCondition().
Referenced by writeProcessVariables().
int FileIO::XmlPrjInterface::writeToFile | ( | const std::string & | filename | ) |
Writes a project to the specified file.
Definition at line 330 of file XmlPrjInterface.cpp.
References _filename, BaseLib::IO::writeStringToFile(), and BaseLib::IO::Writer::writeToString().
|
private |
Definition at line 94 of file XmlPrjInterface.h.
Referenced by write(), and writeToFile().
|
private |
Definition at line 95 of file XmlPrjInterface.h.
Referenced by getPrimaryVariableVec(), readBoundaryConditions(), readFile(), readSourceTerms(), write(), writeBoundaryConditions(), and writeSourceTerms().