From: fps Date: Wed, 11 Sep 2013 13:39:07 +0000 (+0000) Subject: documentation X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4055049bd0f0a5c23f68f7834e815172ab7e1355;p=modules%2Fgeom.git documentation --- diff --git a/src/XAO/XAO_BooleanField.hxx b/src/XAO/XAO_BooleanField.hxx index eefb49234..33a9baf43 100644 --- a/src/XAO/XAO_BooleanField.hxx +++ b/src/XAO/XAO_BooleanField.hxx @@ -29,16 +29,46 @@ 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); }; } diff --git a/src/XAO/XAO_BooleanStep.hxx b/src/XAO/XAO_BooleanStep.hxx index 4f514407a..e4a057ff9 100644 --- a/src/XAO/XAO_BooleanStep.hxx +++ b/src/XAO/XAO_BooleanStep.hxx @@ -29,9 +29,20 @@ 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; } @@ -64,9 +75,32 @@ namespace XAO */ 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& 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& 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& 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); diff --git a/src/XAO/XAO_BrepGeometry.hxx b/src/XAO/XAO_BrepGeometry.hxx index 16561b8a3..f2288606f 100644 --- a/src/XAO/XAO_BrepGeometry.hxx +++ b/src/XAO/XAO_BrepGeometry.hxx @@ -31,18 +31,52 @@ 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); /** @@ -94,56 +128,79 @@ namespace XAO /** * 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); /** diff --git a/src/XAO/XAO_DoubleField.hxx b/src/XAO/XAO_DoubleField.hxx index 383ff0ca8..efbffb841 100644 --- a/src/XAO/XAO_DoubleField.hxx +++ b/src/XAO/XAO_DoubleField.hxx @@ -29,16 +29,46 @@ 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); }; } diff --git a/src/XAO/XAO_DoubleStep.hxx b/src/XAO/XAO_DoubleStep.hxx index d5301aafe..c0be2c177 100644 --- a/src/XAO/XAO_DoubleStep.hxx +++ b/src/XAO/XAO_DoubleStep.hxx @@ -29,22 +29,78 @@ 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 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 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 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& 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& 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& 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); diff --git a/src/XAO/XAO_Geometry.hxx b/src/XAO/XAO_Geometry.hxx index 9f20fbcaa..6adb5c7ac 100644 --- a/src/XAO/XAO_Geometry.hxx +++ b/src/XAO/XAO_Geometry.hxx @@ -28,9 +28,17 @@ 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: diff --git a/src/XAO/XAO_IntegerField.hxx b/src/XAO/XAO_IntegerField.hxx index 807592e7f..4c3e22e50 100644 --- a/src/XAO/XAO_IntegerField.hxx +++ b/src/XAO/XAO_IntegerField.hxx @@ -29,17 +29,47 @@ 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); }; } diff --git a/src/XAO/XAO_IntegerStep.hxx b/src/XAO/XAO_IntegerStep.hxx index 8c3f65939..692fa28de 100644 --- a/src/XAO/XAO_IntegerStep.hxx +++ b/src/XAO/XAO_IntegerStep.hxx @@ -29,22 +29,78 @@ 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 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 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 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& 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& elements); - void setComponents(const int& element, const std::vector& 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& 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); diff --git a/src/XAO/XAO_Step.hxx b/src/XAO/XAO_Step.hxx index 4ebf27a55..bc9eb7406 100644 --- a/src/XAO/XAO_Step.hxx +++ b/src/XAO/XAO_Step.hxx @@ -26,6 +26,10 @@ namespace XAO { + /** + * @class Step + * Base class for steps. + */ class Step { protected: @@ -104,11 +108,33 @@ namespace XAO 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: diff --git a/src/XAO/XAO_StringField.hxx b/src/XAO/XAO_StringField.hxx index 7257f8df6..4c60daa02 100644 --- a/src/XAO/XAO_StringField.hxx +++ b/src/XAO/XAO_StringField.hxx @@ -29,16 +29,46 @@ 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); }; } diff --git a/src/XAO/XAO_StringStep.hxx b/src/XAO/XAO_StringStep.hxx index cce7271b5..43e72b1ba 100644 --- a/src/XAO/XAO_StringStep.hxx +++ b/src/XAO/XAO_StringStep.hxx @@ -30,24 +30,78 @@ 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 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 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 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& 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& 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& 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); diff --git a/src/XAO/XAO_Xao.hxx b/src/XAO/XAO_Xao.hxx index b96d2774a..e9fc6231c 100644 --- a/src/XAO/XAO_Xao.hxx +++ b/src/XAO/XAO_Xao.hxx @@ -27,7 +27,7 @@ namespace XAO { /** - * @enum CAD + * @enum Format */ enum Format { @@ -200,7 +200,7 @@ namespace XAO /** * 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. diff --git a/src/XAO/XAO_XaoExporter.hxx b/src/XAO/XAO_XaoExporter.hxx index 510572d09..844c8dcb0 100644 --- a/src/XAO/XAO_XaoExporter.hxx +++ b/src/XAO/XAO_XaoExporter.hxx @@ -11,13 +11,42 @@ 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: diff --git a/src/XAO/XAO_XaoUtils.hxx b/src/XAO/XAO_XaoUtils.hxx index c9088a636..ad41663ce 100644 --- a/src/XAO/XAO_XaoUtils.hxx +++ b/src/XAO/XAO_XaoUtils.hxx @@ -125,12 +125,19 @@ namespace XAO 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 MsgBuilder& operator <<(const T& t) { @@ -138,6 +145,9 @@ namespace XAO return *this; } + /** + * Conversion operator to char*. + */ operator const char*() const { return m_stream.str().c_str(); } private :