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... | |
Geometry * | getGeometry () const |
Gets the geometry. More... | |
void | setGeometry (Geometry *geometry) |
Sets the geometry. More... | |
int | countGroups () const |
Gets the number of groups. More... | |
Group * | getGroup (int index) |
Gets a group. More... | |
Group * | addGroup (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... | |
Field * | getField (int index) |
Gets a field. More... | |
BooleanField * | getBooleanField (int index) |
DoubleField * | getDoubleField (int index) |
IntegerField * | getIntegerField (int index) |
StringField * | getStringField (int index) |
Field * | addField (XAO::Type type, XAO::Dimension dim, int nbComponents, const std::string &name=std::string("")) |
Adds a field. More... | |
BooleanField * | addBooleanField (XAO::Dimension dim, int nbComponents, const std::string &name=std::string("")) |
IntegerField * | addIntegerField (XAO::Dimension dim, int nbComponents, const std::string &name=std::string("")) |
DoubleField * | addDoubleField (XAO::Dimension dim, int nbComponents, const std::string &name=std::string("")) |
StringField * | addStringField (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... | |
Geometry * | m_geometry |
The geometry. More... | |
std::list< Group * > | m_groups |
The list of groups. More... | |
std::list< Field * > | m_fields |
The list of fields. More... | |
Xao::Xao | ( | ) |
References C_XAO_VERSION, m_author, m_geometry, and m_version.
Xao::Xao | ( | const std::string & | author, |
const std::string & | version | ||
) |
author | the author of the file. |
version | the version of the XAO format. |
References m_author, m_geometry, and m_version.
|
virtual |
References m_fields, m_geometry, and m_groups.
BooleanField * Xao::addBooleanField | ( | XAO::Dimension | dim, |
int | nbComponents, | ||
const std::string & | name = std::string("") |
||
) |
References checkGeometry(), XAO::Geometry::countElements(), m_fields, and m_geometry.
DoubleField * Xao::addDoubleField | ( | XAO::Dimension | dim, |
int | nbComponents, | ||
const std::string & | name = std::string("") |
||
) |
References checkGeometry(), XAO::Geometry::countElements(), m_fields, and m_geometry.
Field * Xao::addField | ( | XAO::Type | type, |
XAO::Dimension | dim, | ||
int | nbComponents, | ||
const std::string & | name = std::string("") |
||
) |
type | the type of the field. |
dim | the dimension of the field. |
nbComponents | the number of components in the field. |
name | the name of the field. |
References checkGeometry(), XAO::Geometry::countElements(), XAO::Field::createField(), m_fields, and m_geometry.
Group * Xao::addGroup | ( | XAO::Dimension | dim, |
const std::string & | name = std::string("") |
||
) |
dim | the dimension of the group. |
name | the name of the group. |
References checkGeometry(), checkGroupDimension(), XAO::Geometry::countElements(), m_geometry, and m_groups.
IntegerField * Xao::addIntegerField | ( | XAO::Dimension | dim, |
int | nbComponents, | ||
const std::string & | name = std::string("") |
||
) |
References checkGeometry(), XAO::Geometry::countElements(), m_fields, and m_geometry.
StringField * Xao::addStringField | ( | XAO::Dimension | dim, |
int | nbComponents, | ||
const std::string & | name = std::string("") |
||
) |
References checkGeometry(), XAO::Geometry::countElements(), m_fields, and m_geometry.
|
private |
References countFields().
|
private |
References m_geometry.
|
private |
References XAO::WHOLE.
|
private |
References countGroups().
int Xao::countFields | ( | ) | const |
References m_fields.
int Xao::countGroups | ( | ) | const |
References m_groups.
bool Xao::exportXAO | ( | const std::string & | fileName, |
const std::string & | shapeFileName | ||
) |
fileName | the name of the file to create. |
shapeFileName | if not empty, export the shape to this external file. |
References XAO::XaoExporter::saveToFile().
|
inline |
BooleanField * Xao::getBooleanField | ( | int | index | ) |
References XAO::BOOLEAN, getField(), and XAO::Field::getType().
DoubleField * Xao::getDoubleField | ( | int | index | ) |
References XAO::DOUBLE, getField(), and XAO::Field::getType().
Field * Xao::getField | ( | int | index | ) |
index | the index of the wanted field. |
References checkFieldIndex(), and m_fields.
XAO::Type Xao::getFieldType | ( | int | index | ) |
index | the index of the wanted field. |
References getField(), and XAO::Field::getType().
|
inline |
Group * Xao::getGroup | ( | int | index | ) |
index | the index of the wanted group. |
References checkGroupIndex(), and m_groups.
IntegerField * Xao::getIntegerField | ( | int | index | ) |
References getField(), XAO::Field::getType(), and XAO::INTEGER.
StringField * Xao::getStringField | ( | int | index | ) |
References getField(), XAO::Field::getType(), and XAO::STRING.
|
inline |
const std::string Xao::getXML | ( | ) |
References XAO::XaoExporter::saveToXml().
bool Xao::importXAO | ( | const std::string & | fileName | ) |
fileName | the name of the file to import. |
References XAO::XaoExporter::readFromFile().
bool Xao::removeField | ( | Field * | field | ) |
field | the field to remove. |
References countFields(), and m_fields.
bool Xao::removeGroup | ( | Group * | group | ) |
group | the group to remove. |
References countGroups(), and m_groups.
|
inline |
author | the author to set. |
|
inline |
geometry | the geometry to set. |
References XAO::Geometry::setReadOnly().
|
inline |
version | the version to set. |
bool Xao::setXML | ( | const std::string & | xml | ) |
xml | the XML to set. |
References XAO::XaoExporter::setXML().
|
private |
|
private |
|
private |
|
private |
|
private |