Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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) throw (XAO_Exception)
 Sets the geometry. More...
 
const int countGroups () const
 Gets the number of groups. More...
 
GroupgetGroup (const int &index) throw (XAO_Exception)
 Gets a group. More...
 
GroupaddGroup (const XAO::Dimension &dim, const std::string &name=std::string("")) throw (XAO_Exception)
 Adds a group. More...
 
bool removeGroup (Group *group)
 Removes a group. More...
 
const int countFields () const
 Gets the number of fields. More...
 
const XAO::Type getFieldType (const int &index) throw (XAO_Exception)
 Gets the type of a field. More...
 
FieldgetField (const int &index) throw (XAO_Exception)
 Gets a field. More...
 
BooleanFieldgetBooleanField (const int &index) throw (XAO_Exception)
 
DoubleFieldgetDoubleField (const int &index) throw (XAO_Exception)
 
IntegerFieldgetIntegerField (const int &index) throw (XAO_Exception)
 
StringFieldgetStringField (const int &index) throw (XAO_Exception)
 
FieldaddField (const XAO::Type &type, const XAO::Dimension &dim, const int &nbComponents, const std::string &name=std::string("")) throw (XAO_Exception)
 Adds a field. More...
 
BooleanFieldaddBooleanField (const XAO::Dimension &dim, const int &nbComponents, const std::string &name=std::string("")) throw (XAO_Exception)
 
IntegerFieldaddIntegerField (const XAO::Dimension &dim, const int &nbComponents, const std::string &name=std::string("")) throw (XAO_Exception)
 
DoubleFieldaddDoubleField (const XAO::Dimension &dim, const int &nbComponents, const std::string &name=std::string("")) throw (XAO_Exception)
 
StringFieldaddStringField (const XAO::Dimension &dim, const int &nbComponents, const std::string &name=std::string("")) throw (XAO_Exception)
 
bool removeField (Field *field)
 Removes a field. More...
 
const 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...
 
const bool importXAO (const std::string &fileName)
 Imports an XAO file into this object. More...
 
const bool setXML (const std::string &xml)
 Sets an XML describing an XAO format to this object. More...
 

Private Member Functions

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

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::Xao ( )
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, m_version, and NULL.

Xao::~Xao ( )
virtual

References it(), m_fields, m_geometry, m_groups, and NULL.

Member Function Documentation

BooleanField * Xao::addBooleanField ( const XAO::Dimension dim,
const int &  nbComponents,
const std::string &  name = std::string("") 
) throw (XAO_Exception)
DoubleField * Xao::addDoubleField ( const XAO::Dimension dim,
const int &  nbComponents,
const std::string &  name = std::string("") 
) throw (XAO_Exception)
Field * Xao::addField ( const XAO::Type type,
const XAO::Dimension dim,
const int &  nbComponents,
const std::string &  name = std::string("") 
) throw (XAO_Exception)
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 XAO::Field::createField().

Group * Xao::addGroup ( const XAO::Dimension dim,
const std::string &  name = std::string("") 
) throw (XAO_Exception)
Parameters
dimthe dimension of the group.
namethe name of the group.
Returns
the created group.
IntegerField * Xao::addIntegerField ( const XAO::Dimension dim,
const int &  nbComponents,
const std::string &  name = std::string("") 
) throw (XAO_Exception)
StringField * Xao::addStringField ( const XAO::Dimension dim,
const int &  nbComponents,
const std::string &  name = std::string("") 
) throw (XAO_Exception)
void Xao::checkFieldIndex ( const int &  index) const throw (XAO_Exception)
private
void Xao::checkGeometry ( ) const throw (XAO_Exception)
private

References m_geometry, and NULL.

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

References XAO::WHOLE.

void Xao::checkGroupIndex ( const int &  index) const throw (XAO_Exception)
private
const int Xao::countFields ( ) const
Returns
the number of fields.

References m_fields.

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

References m_groups.

const 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().

const std::string XAO::Xao::getAuthor ( ) const
inline
Returns
the author of the file.
BooleanField * Xao::getBooleanField ( const int &  index) throw (XAO_Exception)
DoubleField * Xao::getDoubleField ( const int &  index) throw (XAO_Exception)
Field * Xao::getField ( const int &  index) throw (XAO_Exception)
Parameters
indexthe index of the wanted field.
Returns
the field.

References it().

const XAO::Type Xao::getFieldType ( const int &  index) throw (XAO_Exception)
Parameters
indexthe index of the wanted field.
Returns
the type of the field.
Geometry* XAO::Xao::getGeometry ( ) const
inline
Returns
the geometry.
Group * Xao::getGroup ( const int &  index) throw (XAO_Exception)
Parameters
indexthe index of the wanted group.
Returns
the group.

References it(), and NULL.

IntegerField * Xao::getIntegerField ( const int &  index) throw (XAO_Exception)
StringField * Xao::getStringField ( const int &  index) throw (XAO_Exception)
const std::string XAO::Xao::getVersion ( ) const
inline
Returns
the version of the file.
const std::string Xao::getXML ( )
Returns
the XML as a string.

References XAO::XaoExporter::saveToXml().

const 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().

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

References countFields(), m_fields, and NULL.

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

References countGroups(), m_groups, and NULL.

void XAO::Xao::setAuthor ( const std::string &  author)
inline
Parameters
authorthe author to set.
void XAO::Xao::setGeometry ( Geometry geometry) throw (XAO_Exception)
inline
Parameters
geometrythe geometry to set.

References NULL.

void XAO::Xao::setVersion ( const std::string &  version)
inline
Parameters
versionthe version to set.
const 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

std::string XAO::Xao::m_author
private
std::list<Field*> XAO::Xao::m_fields
private
Geometry* XAO::Xao::m_geometry
private
std::list<Group*> XAO::Xao::m_groups
private
std::string XAO::Xao::m_version
private

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