Version: 9.12.0
XAO::Xao Class Reference

The Xao class describes the XAO format.

#include <XAO_Xao.hxx>

Public Member Functions

 Xao ()
 Default constructor. More...
 
 Xao (const std::string &author, const std::string &version)
 Constructor with author and version. More...
 
virtual ~Xao ()
 Destructor. More...
 
const std::string getAuthor () const
 Gets the author of the file. More...
 
void setAuthor (const std::string &author)
 Sets the author of the file. More...
 
const std::string getVersion () const
 Gets the version of the file. More...
 
void setVersion (const std::string &version)
 Sets the version of the file. More...
 
GeometrygetGeometry () const
 Gets the geometry. More...
 
void setGeometry (Geometry *geometry)
 Sets the geometry. More...
 
int countGroups () const
 Gets the number of groups. More...
 
GroupgetGroup (int index)
 Gets a group. More...
 
GroupaddGroup (XAO::Dimension dim, const std::string &name=std::string(""))
 Adds a group. More...
 
bool removeGroup (Group *group)
 Removes a group. More...
 
int countFields () const
 Gets the number of fields. More...
 
XAO::Type getFieldType (int index)
 Gets the type of a field. More...
 
FieldgetField (int index)
 Gets a field. More...
 
BooleanFieldgetBooleanField (int index)
 
DoubleFieldgetDoubleField (int index)
 
IntegerFieldgetIntegerField (int index)
 
StringFieldgetStringField (int index)
 
FieldaddField (XAO::Type type, XAO::Dimension dim, int nbComponents, const std::string &name=std::string(""))
 Adds a field. More...
 
BooleanFieldaddBooleanField (XAO::Dimension dim, int nbComponents, const std::string &name=std::string(""))
 
IntegerFieldaddIntegerField (XAO::Dimension dim, int nbComponents, const std::string &name=std::string(""))
 
DoubleFieldaddDoubleField (XAO::Dimension dim, int nbComponents, const std::string &name=std::string(""))
 
StringFieldaddStringField (XAO::Dimension dim, int nbComponents, const std::string &name=std::string(""))
 
bool removeField (Field *field)
 Removes a field. More...
 
bool exportXAO (const std::string &fileName, const std::string &shapeFileName)
 Exports this XAO object to a file. More...
 
const std::string getXML ()
 Gets the XML corresponding to this XAO. More...
 
bool importXAO (const std::string &fileName)
 Imports an XAO file into this object. More...
 
bool setXML (const std::string &xml)
 Sets an XML describing an XAO format to this object. More...
 

Private Member Functions

void checkGeometry () const
 
void checkGroupIndex (int index) const
 
void checkFieldIndex (int index) const
 
void checkGroupDimension (XAO::Dimension dim) const
 

Private Attributes

std::string m_author
 The author of the file. More...
 
std::string m_version
 The version of the file. More...
 
Geometrym_geometry
 The geometry. More...
 
std::list< Group * > m_groups
 The list of groups. More...
 
std::list< Field * > m_fields
 The list of fields. More...
 

Constructor & Destructor Documentation

◆ Xao() [1/2]

Xao::Xao ( )

◆ Xao() [2/2]

Xao::Xao ( const std::string &  author,
const std::string &  version 
)
Parameters
authorthe author of the file.
versionthe version of the XAO format.

References m_author, m_geometry, and m_version.

◆ ~Xao()

Xao::~Xao ( )
virtual

References m_fields, m_geometry, and m_groups.

Member Function Documentation

◆ addBooleanField()

BooleanField * Xao::addBooleanField ( XAO::Dimension  dim,
int  nbComponents,
const std::string &  name = std::string("") 
)

◆ addDoubleField()

DoubleField * Xao::addDoubleField ( XAO::Dimension  dim,
int  nbComponents,
const std::string &  name = std::string("") 
)

◆ addField()

Field * Xao::addField ( XAO::Type  type,
XAO::Dimension  dim,
int  nbComponents,
const std::string &  name = std::string("") 
)
Parameters
typethe type of the field.
dimthe dimension of the field.
nbComponentsthe number of components in the field.
namethe name of the field.
Returns
the created field.

References checkGeometry(), XAO::Geometry::countElements(), XAO::Field::createField(), m_fields, and m_geometry.

◆ addGroup()

Group * Xao::addGroup ( XAO::Dimension  dim,
const std::string &  name = std::string("") 
)
Parameters
dimthe dimension of the group.
namethe name of the group.
Returns
the created group.

References checkGeometry(), checkGroupDimension(), XAO::Geometry::countElements(), m_geometry, and m_groups.

◆ addIntegerField()

IntegerField * Xao::addIntegerField ( XAO::Dimension  dim,
int  nbComponents,
const std::string &  name = std::string("") 
)

◆ addStringField()

StringField * Xao::addStringField ( XAO::Dimension  dim,
int  nbComponents,
const std::string &  name = std::string("") 
)

◆ checkFieldIndex()

void Xao::checkFieldIndex ( int  index) const
private

References countFields().

◆ checkGeometry()

void Xao::checkGeometry ( ) const
private

References m_geometry.

◆ checkGroupDimension()

void Xao::checkGroupDimension ( XAO::Dimension  dim) const
private

References XAO::WHOLE.

◆ checkGroupIndex()

void Xao::checkGroupIndex ( int  index) const
private

References countGroups().

◆ countFields()

int Xao::countFields ( ) const
Returns
the number of fields.

References m_fields.

◆ countGroups()

int Xao::countGroups ( ) const
Returns
the number of groups.

References m_groups.

◆ exportXAO()

bool Xao::exportXAO ( const std::string &  fileName,
const std::string &  shapeFileName 
)
Parameters
fileNamethe name of the file to create.
shapeFileNameif not empty, export the shape to this external file.
Returns
true is the export is successful.

References XAO::XaoExporter::saveToFile().

◆ getAuthor()

const std::string XAO::Xao::getAuthor ( ) const
inline
Returns
the author of the file.

◆ getBooleanField()

BooleanField * Xao::getBooleanField ( int  index)

◆ getDoubleField()

DoubleField * Xao::getDoubleField ( int  index)

◆ getField()

Field * Xao::getField ( int  index)
Parameters
indexthe index of the wanted field.
Returns
the field.

References checkFieldIndex(), and m_fields.

◆ getFieldType()

XAO::Type Xao::getFieldType ( int  index)
Parameters
indexthe index of the wanted field.
Returns
the type of the field.

References getField(), and XAO::Field::getType().

◆ getGeometry()

Geometry* XAO::Xao::getGeometry ( ) const
inline
Returns
the geometry.

◆ getGroup()

Group * Xao::getGroup ( int  index)
Parameters
indexthe index of the wanted group.
Returns
the group.

References checkGroupIndex(), and m_groups.

◆ getIntegerField()

IntegerField * Xao::getIntegerField ( int  index)

◆ getStringField()

StringField * Xao::getStringField ( int  index)

◆ getVersion()

const std::string XAO::Xao::getVersion ( ) const
inline
Returns
the version of the file.

◆ getXML()

const std::string Xao::getXML ( )
Returns
the XML as a string.

References XAO::XaoExporter::saveToXml().

◆ importXAO()

bool Xao::importXAO ( const std::string &  fileName)
Parameters
fileNamethe name of the file to import.
Returns
true if the import is successful.

References XAO::XaoExporter::readFromFile().

◆ removeField()

bool Xao::removeField ( Field field)
Parameters
fieldthe field to remove.
Returns
true if the field has been removed, false otherwise.

References countFields(), and m_fields.

◆ removeGroup()

bool Xao::removeGroup ( Group group)
Parameters
groupthe group to remove.
Returns
true if the group has been removed, false otherwise.

References countGroups(), and m_groups.

◆ setAuthor()

void XAO::Xao::setAuthor ( const std::string &  author)
inline
Parameters
authorthe author to set.

◆ setGeometry()

void XAO::Xao::setGeometry ( Geometry geometry)
inline
Parameters
geometrythe geometry to set.

References XAO::Geometry::setReadOnly().

◆ setVersion()

void XAO::Xao::setVersion ( const std::string &  version)
inline
Parameters
versionthe version to set.

◆ setXML()

bool Xao::setXML ( const std::string &  xml)
Parameters
xmlthe XML to set.
Returns
true if the import is successful.

References XAO::XaoExporter::setXML().

Member Data Documentation

◆ m_author

std::string XAO::Xao::m_author
private

◆ m_fields

std::list<Field*> XAO::Xao::m_fields
private

◆ m_geometry

Geometry* XAO::Xao::m_geometry
private

◆ m_groups

std::list<Group*> XAO::Xao::m_groups
private

◆ m_version

std::string XAO::Xao::m_version
private

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