SHAPER  9.12.0
XAO::Xao Class Reference

The Xao class describes the XAO format. More...

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...
 

Detailed Description

The Xao class describes the XAO format.

Constructor & Destructor Documentation

◆ Xao() [1/2]

Xao::Xao ( )

Default constructor.

◆ Xao() [2/2]

Xao::Xao ( const std::string &  author,
const std::string &  version 
)

Constructor with author and version.

Parameters
authorthe author of the file.
versionthe version of the XAO format.

◆ ~Xao()

Xao::~Xao ( )
virtual

Destructor.

Member Function Documentation

◆ getAuthor()

const std::string XAO::Xao::getAuthor ( ) const
inline

Gets the author of the file.

Returns
the author of the file.

◆ setAuthor()

void XAO::Xao::setAuthor ( const std::string &  author)
inline

Sets the author of the file.

Parameters
authorthe author to set.

◆ getVersion()

const std::string XAO::Xao::getVersion ( ) const
inline

Gets the version of the file.

Returns
the version of the file.

◆ setVersion()

void XAO::Xao::setVersion ( const std::string &  version)
inline

Sets the version of the file.

Parameters
versionthe version to set.

◆ getGeometry()

Geometry* XAO::Xao::getGeometry ( ) const
inline

Gets the geometry.

Returns
the geometry.

◆ setGeometry()

void XAO::Xao::setGeometry ( Geometry geometry)
inline

Sets the geometry.

Parameters
geometrythe geometry to set.

◆ countGroups()

int Xao::countGroups ( ) const

Gets the number of groups.

Returns
the number of groups.

◆ getGroup()

Group * Xao::getGroup ( int  index)

Gets a group.

Parameters
indexthe index of the wanted group.
Returns
the group.

◆ addGroup()

Group * Xao::addGroup ( XAO::Dimension  dim,
const std::string &  name = std::string("") 
)

Adds a group.

Parameters
dimthe dimension of the group.
namethe name of the group.
Returns
the created group.

◆ removeGroup()

bool Xao::removeGroup ( Group group)

Removes a group.

Parameters
groupthe group to remove.
Returns
true if the group has been removed, false otherwise.

◆ countFields()

int Xao::countFields ( ) const

Gets the number of fields.

Returns
the number of fields.

◆ getFieldType()

XAO::Type Xao::getFieldType ( int  index)

Gets the type of a field.

Parameters
indexthe index of the wanted field.
Returns
the type of the field.

◆ getField()

Field * Xao::getField ( int  index)

Gets a field.

Parameters
indexthe index of the wanted field.
Returns
the field.

◆ addField()

Field * Xao::addField ( XAO::Type  type,
XAO::Dimension  dim,
int  nbComponents,
const std::string &  name = std::string("") 
)

Adds a field.

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.

◆ removeField()

bool Xao::removeField ( Field field)

Removes a field.

Parameters
fieldthe field to remove.
Returns
true if the field has been removed, false otherwise.

◆ exportXAO()

bool Xao::exportXAO ( const std::string &  fileName,
const std::string &  shapeFileName 
)

Exports this XAO object to a file.

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.

◆ getXML()

const std::string Xao::getXML ( )

Gets the XML corresponding to this XAO.

Returns
the XML as a string.

◆ importXAO()

bool Xao::importXAO ( const std::string &  fileName)

Imports an XAO file into this object.

Parameters
fileNamethe name of the file to import.
Returns
true if the import is successful.

◆ setXML()

bool Xao::setXML ( const std::string &  xml)

Sets an XML describing an XAO format to this object.

Parameters
xmlthe XML to set.
Returns
true if the import is successful.