namespace XAO
{
+ /**
+ * @class BooleanField
+ * Represents a field with boolean values.
+ */
class BooleanField : public Field
{
public:
+ /**
+ * Constructor.
+ * @param name the name of the field.
+ * @param dimension the dimension of the field.
+ * @param nbElements the number of elements.
+ * @param nbComponents the number of components.
+ */
BooleanField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::BOOLEAN; }
virtual Step* addNewStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @return the newly created step.
+ */
BooleanStep* addStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @param stamp the stamp of the step.
+ * @return the newly created step.
+ */
BooleanStep* addStep(const int& step, const int& stamp);
+
+ /**
+ * Gets the step of given index.
+ * @param index the index.
+ * @return the step for the given index.
+ */
BooleanStep* getStep(const int& index);
};
}
namespace XAO
{
+ /**
+ * @class BooleanStep
+ * Step with boolean values.
+ */
class BooleanStep : public Step
{
public:
+ /**
+ * Constructor.
+ * @param step the step number.
+ * @param stamp the stamp of the step.
+ * @param nbElements the number elements of the geometry.
+ * @param nbComponents the number of components of the field.
+ */
BooleanStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::BOOLEAN; }
*/
const bool getValue(const int& element, const int& component);
+ /**
+ * Sets all the values from a list.
+ * @param values the list of values to set.
+ */
void setValues(const std::vector<bool>& values);
+
+ /**
+ * Sets the values for an element.
+ * @param element the index of the element to set.
+ * @param elements the values to set.
+ */
void setElements(const int& element, const std::vector<bool>& elements);
+
+ /**
+ * Sets the values for a component.
+ * @param component the index of the component to set.
+ * @param components the values to set.
+ */
void setComponents(const int& component, const std::vector<bool>& components);
+
+ /**
+ * Sets the value for an element and a component.
+ * @param element the index of the element.
+ * @param component the index of the component.
+ * @param value the value.
+ */
void setValue(const int& element, const int& component, const bool& value);
virtual const std::string getStringValue(const int& element, const int& component);
namespace XAO
{
+ /**
+ * @class BrepGeometry
+ * Representation of a BRep Geometry.
+ */
class BrepGeometry : public Geometry
{
public:
+ /**
+ * Default Constructor.
+ */
BrepGeometry();
+
+ /**
+ * Constructor.
+ * @param name the name of the geometry.
+ */
BrepGeometry(const std::string& name);
+ /**
+ * Gets the format of the geometry.
+ * @return the format of the geometry.
+ */
virtual const XAO::Format getFormat() { return XAO::BREP; }
+ /**
+ * Gets the shape as a string.
+ * @return the shape as a string.
+ */
virtual const std::string getShape();
+
+ /**
+ * Sets the shape from a string.
+ * @param shape the shape as a string.
+ */
virtual void setShape(const std::string& shape);
+ /**
+ * Gets the shape as a TopoDS_Shape.
+ * @return the TopoDS_Shape.
+ */
TopoDS_Shape getTopoDS_Shape();
+
+ /**
+ * Sets the shape from a TopoDS_Shape.
+ * @param shape the TopoDS_Shape to set.
+ */
void setTopoDS_Shape(const TopoDS_Shape& shape);
/**
/**
* Gets the length of an edge.
- * @param edge the index of the edge.
+ * @param index the index of the edge.
* @return the length of the edge.
*/
const double getEdgeLength(const int& index);
/**
* Gets the are of a face.
- * @param face the index of a face.
+ * @param index the index of a face.
* @return the area of the face.
*/
const double getFaceArea(const int& index);
/**
* Gets the volume of a solid.
- * @param solid the index of the solid.
+ * @param index the index of the solid.
* @return the volume of the solid.
*/
const double getSolidVolume(const int& index);
/**
* Gets the ID of a vertex.
- * @param vertex the index of the vertex.
+ * @param index the index of the vertex.
* @return the ID of the vertex.
*/
const int getVertexID(const int& index);
/**
* Gets the ID of an edge.
- * @param edge the index of the edge.
+ * @param index the index of the edge.
* @return the ID of the edge.
*/
const int getEdgeID(const int& index);
/**
* Gets the ID of a face.
- * @param face the index of the face.
+ * @param index the index of the face.
* @return the ID of the face.
*/
const int getFaceID(const int& index);
/**
* Gets the ID of a solid.
- * @param solid the index of the solid.
+ * @param index the index of the solid.
* @return the ID of the solid.
*/
- const int getSolidID(const int& solid);
+ const int getSolidID(const int& index);
+ /**
+ * Sets the ID of a vertex.
+ * @param index the index of the vertex to set.
+ * @param id the id to set.
+ */
void setVertexID(const int& index, const int& id);
+
+ /**
+ * Sets the ID of an edge.
+ * @param index the index of the edge to set.
+ * @param id the id to set.
+ */
void setEdgeID(const int& index, const int& id);
+
+ /**
+ * Sets the ID of a face.
+ * @param index the index of the face to set.
+ * @param id the id to set.
+ */
void setFaceID(const int& index, const int& id);
+
+ /**
+ * Sets the ID of a solid.
+ * @param index the index of the solid to set.
+ * @param id the id to set.
+ */
void setSolidID(const int& index, const int& id);
/**
namespace XAO
{
+ /**
+ * @class DoubleField
+ * Represents a field with double values.
+ */
class DoubleField : public Field
{
public:
+ /**
+ * Constructor.
+ * @param name the name of the field.
+ * @param dimension the dimension of the field.
+ * @param nbElements the number of elements.
+ * @param nbComponents the number of components.
+ */
DoubleField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::DOUBLE; }
virtual Step* addNewStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @return the newly created step.
+ */
DoubleStep* addStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @param stamp the stamp of the step.
+ * @return the newly created step.
+ */
DoubleStep* addStep(const int& step, const int& stamp);
+
+ /**
+ * Gets the step of given index.
+ * @param index the index.
+ * @return the step for the given index.
+ */
DoubleStep* getStep(const int& index);
};
}
namespace XAO
{
+ /**
+ * @class DoubleStep
+ * Step with double values.
+ */
class DoubleStep : public Step
{
public:
+ /**
+ * Constructor.
+ * @param step the step number.
+ * @param stamp the stamp of the step.
+ * @param nbElements the number elements of the geometry.
+ * @param nbComponents the number of components of the field.
+ */
DoubleStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::DOUBLE; }
+ /**
+ * Gets all the values of the step as a list.
+ * @return a vector containing all the values of the step.
+ */
std::vector<double> getValues();
+
+ /**
+ * Gets all the values for a given element.
+ * @param element the index of the element.
+ * @return a vector containing all the values for the given element.
+ */
std::vector<double> getElement(const int& element);
+
+ /**
+ * Gets all the values for a given component.
+ * @param component the index of the component.
+ * @return a vector containing all the values for the given component.
+ */
std::vector<double> getComponent(const int& component);
+ /**
+ * Gets the value for an element and a component.
+ * @param element the index of the element.
+ * @param component the index of the component.
+ * @return the value for the given element and component.
+ */
const double getValue(const int& element, const int& component);
+ /**
+ * Sets all the values from a list.
+ * @param values the list of values to set.
+ */
void setValues(const std::vector<double>& values);
+
+ /**
+ * Sets the values for an element.
+ * @param element the index of the element to set.
+ * @param elements the values to set.
+ */
void setElements(const int& element, const std::vector<double>& elements);
+
+ /**
+ * Sets the values for a component.
+ * @param component the index of the component to set.
+ * @param components the values to set.
+ */
void setComponents(const int& component, const std::vector<double>& components);
+
+ /**
+ * Sets the value for an element and a component.
+ * @param element the index of the element.
+ * @param component the index of the component.
+ * @param value the value.
+ */
void setValue(const int& element, const int& component, const double& value);
virtual const std::string getStringValue(const int& element, const int& component);
namespace XAO
{
+ /**
+ * @class Geometry
+ * Base class for geometries.
+ */
class Geometry
{
protected:
+ /**
+ * Constructor.
+ * @param name the name of the Geometry.
+ */
Geometry(const std::string& name);
public:
namespace XAO
{
+ /**
+ * @class IntegerField
+ * Represents a field with integer values.
+ */
class IntegerField : public Field
{
public:
+ /**
+ * Constructor.
+ * @param name the name of the field.
+ * @param dimension the dimension of the field.
+ * @param nbElements the number of elements.
+ * @param nbComponents the number of components.
+ */
IntegerField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::INTEGER; }
virtual Step* addNewStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @return the newly created step.
+ */
IntegerStep* addStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @param stamp the stamp of the step.
+ * @return the newly created step.
+ */
IntegerStep* addStep(const int& step, const int& stamp);
- IntegerStep* getStep(const int& step);
+
+ /**
+ * Gets the step of given index.
+ * @param index the index of the step.
+ * @return the step for the given index.
+ */
+ IntegerStep* getStep(const int& index);
};
}
namespace XAO
{
+ /**
+ * @class IntegerStep
+ * Step with integer values.
+ */
class IntegerStep : public Step
{
public:
+ /**
+ * Constructor.
+ * @param step the step number.
+ * @param stamp the stamp of the step.
+ * @param nbElements the number elements of the geometry.
+ * @param nbComponents the number of components of the field.
+ */
IntegerStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::INTEGER; }
+ /**
+ * Gets all the values of the step as a list.
+ * @return a vector containing all the values of the step.
+ */
std::vector<int> getValues();
+
+ /**
+ * Gets all the values for a given element.
+ * @param element the index of the element.
+ * @return a vector containing all the values for the given element.
+ */
std::vector<int> getElement(const int& element);
+
+ /**
+ * Gets all the values for a given component.
+ * @param component the index of the component.
+ * @return a vector containing all the values for the given component.
+ */
std::vector<int> getComponent(const int& component);
+ /**
+ * Gets the value for an element and a component.
+ * @param element the index of the element.
+ * @param component the index of the component.
+ * @return the value for the given element and component.
+ */
const int getValue(const int& element, const int& component);
+ /**
+ * Sets all the values from a list.
+ * @param values the list of values to set.
+ */
void setValues(const std::vector<int>& values);
+
+ /**
+ * Sets the values for an element.
+ * @param element the index of the element to set.
+ * @param elements the values to set.
+ */
void setElements(const int& element, const std::vector<int>& elements);
- void setComponents(const int& element, const std::vector<int>& components);
+
+ /**
+ * Sets the values for a component.
+ * @param component the index of the component to set.
+ * @param components the values to set.
+ */
+ void setComponents(const int& component, const std::vector<int>& components);
+
+ /**
+ * Sets the value for an element and a component.
+ * @param element the index of the element.
+ * @param component the index of the component.
+ * @param value the value.
+ */
void setValue(const int& element, const int& component, const int& value);
virtual const std::string getStringValue(const int& element, const int& component);
namespace XAO
{
+ /**
+ * @class Step
+ * Base class for steps.
+ */
class Step
{
protected:
virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0;
protected:
+ /**
+ * Checks that given element index is in the range of element indexes.
+ * @param element the index to check.
+ */
void checkElementIndex(const int& element);
+ /**
+ * Checks that given component index is in the range of component indexes.
+ * @param component the index to check.
+ */
void checkComponentIndex(const int& component);
+ /**
+ * Checks that the given number of elements is correct.
+ * @param nbElements the number of elements to check.
+ */
void checkNbElements(const int& nbElements);
+
+ /**
+ * Checks that the given number of components is correct.
+ * @param nbComponents the number of components to check.
+ */
void checkNbComponents(const int& nbComponents);
+
+ /**
+ * checks that the given number of values is correct.
+ * @param nbValues the number of values to check.
+ */
void checkNbValues(const int& nbValues);
protected:
namespace XAO
{
+ /**
+ * @class StringField
+ * Represents a field with string values.
+ */
class StringField : public Field
{
public:
+ /**
+ * Constructor.
+ * @param name the name of the field.
+ * @param dimension the dimension of the field.
+ * @param nbElements the number of elements.
+ * @param nbComponents the number of components.
+ */
StringField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::STRING; }
virtual Step* addNewStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @return the newly created step.
+ */
StringStep* addStep(const int& step);
+
+ /**
+ * Adds a new step.
+ * @param step the number of the step.
+ * @param stamp the stamp of the step.
+ * @return the newly created step.
+ */
StringStep* addStep(const int& step, const int& stamp);
+
+ /**
+ * Gets the step of given index.
+ * @param index the index of the step.
+ * @return the step for the given index.
+ */
StringStep* getStep(const int& index);
};
}
namespace XAO
{
+ /**
+ * @class StringStep
+ * Step with strings values.
+ */
class StringStep : public Step
{
public:
- StringStep(const int& nbElements, const int& nbComponents);
- StringStep(const int& step, const int& nbElements, const int& nbComponents);
+ /**
+ * Constructor.
+ * @param step the step number.
+ * @param stamp the stamp of the step.
+ * @param nbElements the number elements of the geometry.
+ * @param nbComponents the number of components of the field.
+ */
StringStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::STRING; }
+ /**
+ * Gets all the values of the step as a list.
+ * @return a vector containing all the values of the step.
+ */
std::vector<std::string> getValues();
+
+ /**
+ * Gets all the values for a given element.
+ * @param element the index of the element.
+ * @return a vector containing all the values for the given element.
+ */
std::vector<std::string> getElement(const int& element);
+
+ /**
+ * Gets all the values for a given component.
+ * @param component the index of the component.
+ * @return a vector containing all the values for the given component.
+ */
std::vector<std::string> getComponent(const int& component);
+ /**
+ * Gets the value for an element and a component.
+ * @param element the index of the element.
+ * @param component the index of the component.
+ * @return the value for the given element and component.
+ */
const std::string getValue(const int& element, const int& component);
+ /**
+ * Sets all the values from a list.
+ * @param values the list of values to set.
+ */
void setValues(const std::vector<std::string>& values);
+
+ /**
+ * Sets the values for an element.
+ * @param element the index of the element to set.
+ * @param elements the values to set.
+ */
void setElements(const int& element, const std::vector<std::string>& elements);
+
+ /**
+ * Sets the values for a component.
+ * @param component the index of the component to set.
+ * @param components the values to set.
+ */
void setComponents(const int& component, const std::vector<std::string>& components);
+
+ /**
+ * Sets the value for an element and a component.
+ * @param element the index of the element.
+ * @param component the index of the component.
+ * @param value the value.
+ */
void setValue(const int& element, const int& component, const std::string& value);
virtual const std::string getStringValue(const int& element, const int& component);
namespace XAO
{
/**
- * @enum CAD
+ * @enum Format
*/
enum Format
{
/**
* Adds a field.
* \param type the type of the field.
- * \param the name of the field.
+ * \param name the name of the field.
* \param dim the dimension of the field.
* \param nbComponents the number of components in the field.
* \return the created field.
namespace XAO
{
+ /**
+ * @class XaoExporter
+ * Util class for import/export XAO.
+ */
class XaoExporter
{
public:
+ /**
+ * Saves the XAO object to a file.
+ * @param xaoObject the object to export.
+ * @param fileName the path of the file to create.
+ * @return true if the export was successful, false otherwise.
+ */
static const bool saveToFile(Xao* xaoObject, const std::string& fileName);
+
+ /**
+ * Saves the XAO object to a XML string.
+ * @param xaoObject the object to export.
+ * @return the XML string.
+ */
static const std::string saveToXml(Xao* xaoObject);
+ /**
+ * Reads a XAO object from a file.
+ * @param fileName the path of the file to read.
+ * @param xaoObject the XAO object.
+ * @return true if the XAO object was read successful, false otherwise.
+ */
static const bool readFromFile(const std::string& fileName, Xao* xaoObject);
+
+ /**
+ * Reads a XAO object from an XML string.
+ * @param xml the XML string.
+ * @param xaoObject the XAO object.
+ * @return true if the XAO object was read successful, false otherwise.
+ */
static const bool setXML(const std::string& xml, Xao* xaoObject);
private:
static const XAO::Format stringToShapeFormat(const std::string& format);
};
+ /**
+ * @class MsgBuilder
+ * MsgBuilder can be use to easily create messages.
+ */
class MsgBuilder
{
public:
+ /** Constructor. */
MsgBuilder() {};
+ /** Destructor. */
~MsgBuilder() {};
+ /** Stream operator. */
template <typename T>
MsgBuilder& operator <<(const T& t)
{
return *this;
}
+ /**
+ * Conversion operator to char*.
+ */
operator const char*() const { return m_stream.str().c_str(); }
private :