documentation

This commit is contained in:
fps 2013-09-11 13:39:07 +00:00
parent 23adb0a6eb
commit 4055049bd0
14 changed files with 464 additions and 14 deletions

View File

@ -29,16 +29,46 @@
namespace XAO namespace XAO
{ {
/**
* @class BooleanField
* Represents a field with boolean values.
*/
class BooleanField : public Field class BooleanField : public Field
{ {
public: 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); BooleanField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::BOOLEAN; } virtual const XAO::Type getType() { return XAO::BOOLEAN; }
virtual Step* addNewStep(const int& step); 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); 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); 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); BooleanStep* getStep(const int& index);
}; };
} }

View File

@ -29,9 +29,20 @@
namespace XAO namespace XAO
{ {
/**
* @class BooleanStep
* Step with boolean values.
*/
class BooleanStep : public Step class BooleanStep : public Step
{ {
public: 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); BooleanStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::BOOLEAN; } virtual const XAO::Type getType() { return XAO::BOOLEAN; }
@ -64,9 +75,32 @@ namespace XAO
*/ */
const bool getValue(const int& element, const int& component); 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); 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); 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); 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); void setValue(const int& element, const int& component, const bool& value);
virtual const std::string getStringValue(const int& element, const int& component); virtual const std::string getStringValue(const int& element, const int& component);

View File

@ -31,18 +31,52 @@
namespace XAO namespace XAO
{ {
/**
* @class BrepGeometry
* Representation of a BRep Geometry.
*/
class BrepGeometry : public Geometry class BrepGeometry : public Geometry
{ {
public: public:
/**
* Default Constructor.
*/
BrepGeometry(); BrepGeometry();
/**
* Constructor.
* @param name the name of the geometry.
*/
BrepGeometry(const std::string& name); 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; } 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(); 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); virtual void setShape(const std::string& shape);
/**
* Gets the shape as a TopoDS_Shape.
* @return the TopoDS_Shape.
*/
TopoDS_Shape getTopoDS_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); void setTopoDS_Shape(const TopoDS_Shape& shape);
/** /**
@ -94,56 +128,79 @@ namespace XAO
/** /**
* Gets the length of an edge. * 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. * @return the length of the edge.
*/ */
const double getEdgeLength(const int& index); const double getEdgeLength(const int& index);
/** /**
* Gets the are of a face. * 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. * @return the area of the face.
*/ */
const double getFaceArea(const int& index); const double getFaceArea(const int& index);
/** /**
* Gets the volume of a solid. * 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. * @return the volume of the solid.
*/ */
const double getSolidVolume(const int& index); const double getSolidVolume(const int& index);
/** /**
* Gets the ID of a vertex. * 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. * @return the ID of the vertex.
*/ */
const int getVertexID(const int& index); const int getVertexID(const int& index);
/** /**
* Gets the ID of an edge. * 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. * @return the ID of the edge.
*/ */
const int getEdgeID(const int& index); const int getEdgeID(const int& index);
/** /**
* Gets the ID of a face. * 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. * @return the ID of the face.
*/ */
const int getFaceID(const int& index); const int getFaceID(const int& index);
/** /**
* Gets the ID of a solid. * 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. * @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); 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); 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); 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); void setSolidID(const int& index, const int& id);
/** /**

View File

@ -29,16 +29,46 @@
namespace XAO namespace XAO
{ {
/**
* @class DoubleField
* Represents a field with double values.
*/
class DoubleField : public Field class DoubleField : public Field
{ {
public: 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); DoubleField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::DOUBLE; } virtual const XAO::Type getType() { return XAO::DOUBLE; }
virtual Step* addNewStep(const int& step); 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); 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); 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); DoubleStep* getStep(const int& index);
}; };
} }

View File

@ -29,22 +29,78 @@
namespace XAO namespace XAO
{ {
/**
* @class DoubleStep
* Step with double values.
*/
class DoubleStep : public Step class DoubleStep : public Step
{ {
public: 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); DoubleStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::DOUBLE; } 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(); 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); 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); 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); 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); 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); 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); 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); void setValue(const int& element, const int& component, const double& value);
virtual const std::string getStringValue(const int& element, const int& component); virtual const std::string getStringValue(const int& element, const int& component);

View File

@ -28,9 +28,17 @@
namespace XAO namespace XAO
{ {
/**
* @class Geometry
* Base class for geometries.
*/
class Geometry class Geometry
{ {
protected: protected:
/**
* Constructor.
* @param name the name of the Geometry.
*/
Geometry(const std::string& name); Geometry(const std::string& name);
public: public:

View File

@ -29,17 +29,47 @@
namespace XAO namespace XAO
{ {
/**
* @class IntegerField
* Represents a field with integer values.
*/
class IntegerField : public Field class IntegerField : public Field
{ {
public: 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); IntegerField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::INTEGER; } virtual const XAO::Type getType() { return XAO::INTEGER; }
virtual Step* addNewStep(const int& step); 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); 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* 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);
}; };
} }

View File

@ -29,22 +29,78 @@
namespace XAO namespace XAO
{ {
/**
* @class IntegerStep
* Step with integer values.
*/
class IntegerStep : public Step class IntegerStep : public Step
{ {
public: 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); IntegerStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::INTEGER; } 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(); 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); 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); 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); 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); 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 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); void setValue(const int& element, const int& component, const int& value);
virtual const std::string getStringValue(const int& element, const int& component); virtual const std::string getStringValue(const int& element, const int& component);

View File

@ -26,6 +26,10 @@
namespace XAO namespace XAO
{ {
/**
* @class Step
* Base class for steps.
*/
class Step class Step
{ {
protected: protected:
@ -104,11 +108,33 @@ namespace XAO
virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0; virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0;
protected: protected:
/**
* Checks that given element index is in the range of element indexes.
* @param element the index to check.
*/
void checkElementIndex(const int& element); 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); 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); 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); 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); void checkNbValues(const int& nbValues);
protected: protected:

View File

@ -29,16 +29,46 @@
namespace XAO namespace XAO
{ {
/**
* @class StringField
* Represents a field with string values.
*/
class StringField : public Field class StringField : public Field
{ {
public: 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); StringField(const std::string& name, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::STRING; } virtual const XAO::Type getType() { return XAO::STRING; }
virtual Step* addNewStep(const int& step); 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); 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); 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); StringStep* getStep(const int& index);
}; };
} }

View File

@ -30,24 +30,78 @@
namespace XAO namespace XAO
{ {
/**
* @class StringStep
* Step with strings values.
*/
class StringStep : public Step class StringStep : public Step
{ {
public: 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); StringStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents);
virtual const XAO::Type getType() { return XAO::STRING; } 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(); 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); 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); 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); 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); 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); 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); 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); void setValue(const int& element, const int& component, const std::string& value);
virtual const std::string getStringValue(const int& element, const int& component); virtual const std::string getStringValue(const int& element, const int& component);

View File

@ -27,7 +27,7 @@
namespace XAO namespace XAO
{ {
/** /**
* @enum CAD * @enum Format
*/ */
enum Format enum Format
{ {
@ -200,7 +200,7 @@ namespace XAO
/** /**
* Adds a field. * Adds a field.
* \param type the type of the 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 dim the dimension of the field.
* \param nbComponents the number of components in the field. * \param nbComponents the number of components in the field.
* \return the created field. * \return the created field.

View File

@ -11,13 +11,42 @@
namespace XAO namespace XAO
{ {
/**
* @class XaoExporter
* Util class for import/export XAO.
*/
class XaoExporter class XaoExporter
{ {
public: 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); 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); 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); 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); static const bool setXML(const std::string& xml, Xao* xaoObject);
private: private:

View File

@ -125,12 +125,19 @@ namespace XAO
static const XAO::Format stringToShapeFormat(const std::string& format); static const XAO::Format stringToShapeFormat(const std::string& format);
}; };
/**
* @class MsgBuilder
* MsgBuilder can be use to easily create messages.
*/
class MsgBuilder class MsgBuilder
{ {
public: public:
/** Constructor. */
MsgBuilder() {}; MsgBuilder() {};
/** Destructor. */
~MsgBuilder() {}; ~MsgBuilder() {};
/** Stream operator. */
template <typename T> template <typename T>
MsgBuilder& operator <<(const T& t) MsgBuilder& operator <<(const T& t)
{ {
@ -138,6 +145,9 @@ namespace XAO
return *this; return *this;
} }
/**
* Conversion operator to char*.
*/
operator const char*() const { return m_stream.str().c_str(); } operator const char*() const { return m_stream.str().c_str(); }
private : private :