using namespace XAO;
-BooleanField::BooleanField(const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents, const std::string& name)
+BooleanField::BooleanField(XAO::Dimension dimension,
+ int nbElements, int nbComponents, const std::string& name)
: Field(dimension, nbElements, nbComponents, name)
{
}
-Step* BooleanField::addNewStep(const int& step)
-throw (XAO_Exception)
+Step* BooleanField::addNewStep(int step)
{
return addStep(step, 0);
}
-BooleanStep* BooleanField::addStep(const int& step)
-throw (XAO_Exception)
+BooleanStep* BooleanField::addStep(int step)
{
return addStep(step, 0);
}
-BooleanStep* BooleanField::addStep(const int& step, const int& stamp)
-throw (XAO_Exception)
+BooleanStep* BooleanField::addStep(int step, int stamp)
{
if (hasStep(step))
throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists.");
return bstep;
}
-BooleanStep* BooleanField::getStep(const int& index)
-throw (XAO_Exception)
+BooleanStep* BooleanField::getStep(int index)
{
checkStepIndex(index);
return (BooleanStep*)m_steps[index];
* @param nbComponents the number of components.
* @param name the name of the field.
*/
- BooleanField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name);
+ BooleanField(XAO::Dimension dimension, int nbElements, int nbComponents, const std::string& name);
- virtual const XAO::Type getType() { return XAO::BOOLEAN; }
+ virtual XAO::Type getType() { return XAO::BOOLEAN; }
- virtual Step* addNewStep(const int& step) throw (XAO_Exception);
+ virtual Step* addNewStep(int step);
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- BooleanStep* addStep(const int& step) throw (XAO_Exception);
+ BooleanStep* addStep(int step);
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- BooleanStep* addStep(const int& step, const int& stamp)
- throw (XAO_Exception);
+ BooleanStep* addStep(int step, int stamp);
/**
* Gets the step of given index.
* @param index the index.
* @return the step for the given index.
*/
- BooleanStep* getStep(const int& index) throw (XAO_Exception);
+ BooleanStep* getStep(int index);
};
}
using namespace XAO;
-BooleanStep::BooleanStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents)
+BooleanStep::BooleanStep(int step, int stamp, int nbElements, int nbComponents)
{
m_nbElements = nbElements;
m_nbComponents = nbComponents;
return result;
}
-std::vector<bool> BooleanStep::getElement(const int& element)
-throw (XAO_Exception)
+std::vector<bool> BooleanStep::getElement(int element)
{
checkElementIndex(element);
return result;
}
-std::vector<bool> BooleanStep::getComponent(const int& component)
-throw (XAO_Exception)
+std::vector<bool> BooleanStep::getComponent(int component)
{
checkComponentIndex(component);
return result;
}
-const bool BooleanStep::getValue(const int& element, const int& component)
-throw (XAO_Exception)
+bool BooleanStep::getValue(int element, int component)
{
checkElementIndex(element);
checkComponentIndex(component);
return m_values[element][component];
}
-const std::string BooleanStep::getStringValue(const int& element, const int& component)
-throw (XAO_Exception)
+const std::string BooleanStep::getStringValue(int element, int component)
{
return XaoUtils::booleanToString(getValue(element, component));
}
void BooleanStep::setValues(const std::vector<bool>& values)
-throw (XAO_Exception)
{
checkNbValues((int)values.size());
}
}
-void BooleanStep::setElement(const int& element, const std::vector<bool>& elements)
-throw (XAO_Exception)
+void BooleanStep::setElement(int element, const std::vector<bool>& elements)
{
checkElementIndex(element);
- checkNbComponents((int)elements.size());
+ checkNbComponents(elements.size());
for (int i = 0; i < m_nbComponents; ++i)
m_values[element][i] = elements[i];
}
-void BooleanStep::setComponent(const int& component, const std::vector<bool>& components)
-throw (XAO_Exception)
+void BooleanStep::setComponent(int component, const std::vector<bool>& components)
{
checkComponentIndex(component);
- checkNbElements((int)components.size());
+ checkNbElements(components.size());
for (int i = 0; i < m_nbElements; ++i)
m_values[i][component] = components[i];
}
-void BooleanStep::setValue(const int& element, const int& component, const bool& value)
-throw (XAO_Exception)
+void BooleanStep::setValue(int element, int component, bool value)
{
checkElementIndex(element);
checkComponentIndex(component);
m_values[element][component] = value;
}
-void BooleanStep::setStringValue(const int& element, const int& component, const std::string& value)
-throw (XAO_Exception)
+void BooleanStep::setStringValue(int element, int component, const std::string& value)
{
setValue(element, component, XaoUtils::stringToBoolean(value));
}
* @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(int step, int stamp, int nbElements, int nbComponents);
- virtual const XAO::Type getType() { return XAO::BOOLEAN; }
+ virtual XAO::Type getType() { return XAO::BOOLEAN; }
/**
* Gets all the values in a vector by elements and by components.
* @param element the index of the element to get.
* @return a vector containing all the values for the given element.
*/
- std::vector<bool> getElement(const int& element) throw (XAO_Exception);
+ std::vector<bool> getElement(int element);
/**
* Gets all the values for a component.
* @param component the index of the component to get.
* @return a vector containing all the values for the given component.
*/
- std::vector<bool> getComponent(const int& component) throw (XAO_Exception);
+ std::vector<bool> getComponent(int component);
/**
* Gets a value for an element and a component.
* @param component the index of the component.
* @return the value.
*/
- const bool getValue(const int& element, const int& component) throw (XAO_Exception);
+ bool getValue(int element, int component);
/**
* Sets all the values from a list.
* @param values the list of values to set.
*/
- void setValues(const std::vector<bool>& values) throw (XAO_Exception);
+ 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 setElement(const int& element, const std::vector<bool>& elements) throw (XAO_Exception);
+ void setElement(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 setComponent(const int& component, const std::vector<bool>& components) throw (XAO_Exception);
+ void setComponent(int component, const std::vector<bool>& components);
/**
* Sets the value for an element and a component.
* @param component the index of the component.
* @param value the value.
*/
- void setValue(const int& element, const int& component, const bool& value) throw (XAO_Exception);
+ void setValue(int element, int component, bool value);
- virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception);
- virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception);
+ virtual const std::string getStringValue(int element, int component);
+ virtual void setStringValue(int element, int component, const std::string& value);
private:
std::vector< std::vector<bool> > m_values;
}
void BrepGeometry::writeShapeFile(const std::string& fileName)
-throw (XAO_Exception)
{
bool res = BRepTools::Write(m_shape, fileName.c_str());
if (!res)
}
void BrepGeometry::readShapeFile(const std::string& fileName)
-throw (XAO_Exception)
{
BRep_Builder builder;
bool res = BRepTools::Read(m_shape, fileName.c_str(), builder);
}
}
-TopoDS_Shape BrepGeometry::getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex)
-throw (XAO_Exception)
+TopoDS_Shape BrepGeometry::getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, int shapeIndex)
{
TopTools_MapOfShape mapShape;
TopTools_ListOfShape listShape;
}
// -----------------------------
-const int BrepGeometry::countGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType)
+int BrepGeometry::countGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType)
{
int res = 0;
TopExp_Explorer exp(shape, shapeType);
return res;
}
-std::vector<int> BrepGeometry::getGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType, const XAO::Dimension& dim)
+std::vector<int> BrepGeometry::getGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType, XAO::Dimension dim)
{
std::vector<int> indexList;
return indexList;
}
-void BrepGeometry::getEdgeVertices(const int& edgeIndex, int& vertexA, int& vertexB)
+void BrepGeometry::getEdgeVertices(int edgeIndex, int& vertexA, int& vertexB)
{
TopoDS_Shape edge = getSubShape(m_shape, TopAbs_EDGE, edgeIndex);
std::vector<int> vertices = getGeometricalElements(edge, TopAbs_VERTEX, XAO::VERTEX);
vertexB = vertices[1];
}
-const int BrepGeometry::countFaceWires(const int& faceIndex)
+int BrepGeometry::countFaceWires(int faceIndex)
{
TopoDS_Shape face = getSubShape(m_shape, TopAbs_FACE, faceIndex);
return countGeometricalElements(face, TopAbs_WIRE);
}
-std::vector<int> BrepGeometry::getFaceEdges(const int& faceIndex, const int& wireIndex)
+std::vector<int> BrepGeometry::getFaceEdges(int faceIndex, int wireIndex)
{
// get the face
TopoDS_Shape face = getSubShape(m_shape, TopAbs_FACE, faceIndex);
return getGeometricalElements(wire, TopAbs_EDGE, XAO::EDGE);
}
-const int BrepGeometry::countSolidShells(const int& solidIndex)
+int BrepGeometry::countSolidShells(int solidIndex)
{
TopoDS_Shape solid = getSubShape(m_shape, TopAbs_SOLID, solidIndex);
return countGeometricalElements(solid, TopAbs_SHELL);
}
-std::vector<int> BrepGeometry::getSolidFaces(const int& solidIndex, const int& shellIndex)
+std::vector<int> BrepGeometry::getSolidFaces(int solidIndex, int shellIndex)
{
TopoDS_Shape solid = getSubShape(m_shape, TopAbs_SOLID, solidIndex);
TopoDS_Shape shell = getSubShape(solid, TopAbs_SHELL, shellIndex);
return getGeometricalElements(shell, TopAbs_FACE, XAO::FACE);
}
-void BrepGeometry::getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord)
-throw (XAO_Exception)
+void BrepGeometry::getVertexXYZ(int vertexIndex, double& xCoord, double& yCoord, double& zCoord)
{
xCoord = 0.;
yCoord = 0.;
}
// -----------------------------
-const double BrepGeometry::getEdgeLength(const int& edgeIndex)
+double BrepGeometry::getEdgeLength(int edgeIndex)
{
TopoDS_Shape edge = getSubShape(m_shape, TopAbs_EDGE, edgeIndex);
GProp_GProps system;
return system.Mass();
}
-const double BrepGeometry::getFaceArea(const int& faceIndex)
+double BrepGeometry::getFaceArea(int faceIndex)
{
TopoDS_Shape face = getSubShape(m_shape, TopAbs_FACE, faceIndex);
GProp_GProps system;
return system.Mass();
}
-const double BrepGeometry::getSolidVolume(const int& solidIndex)
+double BrepGeometry::getSolidVolume(int solidIndex)
{
TopoDS_Shape solid = getSubShape(m_shape, TopAbs_SOLID, solidIndex);
GProp_GProps system;
}
// -----------------------------
-const int BrepGeometry::getVertexID(const int& index)
+int BrepGeometry::getVertexID(int index)
{
return XaoUtils::stringToInt(getVertexReference(index));
}
-const int BrepGeometry::getEdgeID(const int& index)
+int BrepGeometry::getEdgeID(int index)
{
return XaoUtils::stringToInt(getEdgeReference(index));
}
-const int BrepGeometry::getFaceID(const int& index)
+int BrepGeometry::getFaceID(int index)
{
return XaoUtils::stringToInt(getFaceReference(index));
}
-const int BrepGeometry::getSolidID(const int& index)
+int BrepGeometry::getSolidID(int index)
{
return XaoUtils::stringToInt(getSolidReference(index));
}
// -----------------------------
-void BrepGeometry::setVertexID(const int& index, const int& id)
+void BrepGeometry::setVertexID(int index, int id)
{
setVertexReference(index, XaoUtils::intToString(id));
}
-void BrepGeometry::setEdgeID(const int& index, const int& id)
+void BrepGeometry::setEdgeID(int index, int id)
{
setEdgeReference(index, XaoUtils::intToString(id));
}
-void BrepGeometry::setFaceID(const int& index, const int& id)
+void BrepGeometry::setFaceID(int index, int id)
{
setEdgeReference(index, XaoUtils::intToString(id));
}
-void BrepGeometry::setSolidID(const int& index, const int& id)
+void BrepGeometry::setSolidID(int index, int id)
{
setEdgeReference(index, XaoUtils::intToString(id));
}
// -----------------------------
-const int BrepGeometry::findElement(const XAO::Dimension& dim, const int& id)
-throw (XAO_Exception)
+int BrepGeometry::findElement(XAO::Dimension dim, int id)
{
if (dim == XAO::VERTEX)
return findVertex(id);
throw XAO_Exception(MsgBuilder() << "Unknown Dimension: " << dim);
}
-const int BrepGeometry::findVertex(const int& id)
+int BrepGeometry::findVertex(int id)
{
return getVertexIndexByReference(XaoUtils::intToString(id));
}
-const int BrepGeometry::findEdge(const int& id)
+int BrepGeometry::findEdge(int id)
{
return getEdgeIndexByReference(XaoUtils::intToString(id));
}
-const int BrepGeometry::findFace(const int& id)
+int BrepGeometry::findFace(int id)
{
return getFaceIndexByReference(XaoUtils::intToString(id));
}
-const int BrepGeometry::findSolid(const int& id)
+int BrepGeometry::findSolid(int id)
{
return getSolidIndexByReference(XaoUtils::intToString(id));
}
// -----------------------------
-const std::string BrepGeometry::findVertexName(const int& id)
+const std::string BrepGeometry::findVertexName(int id)
{
return getVertexName(findVertex(id));
}
-const std::string BrepGeometry::findEdgeName(const int& id)
+const std::string BrepGeometry::findEdgeName(int id)
{
return getEdgeName(findEdge(id));
}
-const std::string BrepGeometry::findFaceName(const int& id)
+const std::string BrepGeometry::findFaceName(int id)
{
return getFaceName(findFace(id));
}
-const std::string BrepGeometry::findSolidName(const int& id)
+const std::string BrepGeometry::findSolidName(int id)
{
return getSolidName(findSolid(id));
}
// -----------------------------
-void BrepGeometry::changeVertexName(const int& id, const std::string& name)
-throw (XAO_Exception)
+void BrepGeometry::changeVertexName(int id, const std::string& name)
{
setVertexName(findVertex(id), name);
}
-void BrepGeometry::changeEdgeName(const int& id, const std::string& name)
-throw (XAO_Exception)
+void BrepGeometry::changeEdgeName(int id, const std::string& name)
{
setEdgeName(findEdge(id), name);
}
-void BrepGeometry::changeFaceName(const int& id, const std::string& name)
-throw (XAO_Exception)
+void BrepGeometry::changeFaceName(int id, const std::string& name)
{
setFaceName(findFace(id), name);
}
-void BrepGeometry::changeSolidName(const int& id, const std::string& name)
-throw (XAO_Exception)
+void BrepGeometry::changeSolidName(int id, const std::string& name)
{
setSolidName(findSolid(id), name);
}
* Gets the format of the geometry.
* @return the format of the geometry.
*/
- virtual const XAO::Format getFormat() { return XAO::BREP; }
+ virtual XAO::Format getFormat() { return XAO::BREP; }
/**
* Gets the shape as a string.
* Writes shape to a file
* @param fileName the path to the file
*/
- virtual void writeShapeFile(const std::string& fileName) throw (XAO_Exception);
+ virtual void writeShapeFile(const std::string& fileName) ;
/**
* Reads shape from a file
* @param fileName the path to the file
*/
- virtual void readShapeFile(const std::string& fileName) throw (XAO_Exception);
+ virtual void readShapeFile(const std::string& fileName) ;
#ifdef SWIG
%pythoncode %{
* @param vertexA
* @param vertexB
*/
- void getEdgeVertices(const int& edgeIndex, int& vertexA, int& vertexB);
+ void getEdgeVertices(int edgeIndex, int& vertexA, int& vertexB);
/**
* Gets the number of wires of a face (including holes).
* @param faceIndex the index of the face.
* @return the number of wires.
*/
- const int countFaceWires(const int& faceIndex);
+ int countFaceWires(int faceIndex);
/**
* Gets the indices of the wires of the face.
* @param wireIndex the index of the wire.
* @return the list of wires for the given face.
*/
- std::vector<int> getFaceEdges(const int& faceIndex, const int& wireIndex);
+ std::vector<int> getFaceEdges(int faceIndex, int wireIndex);
/**
* Gets the number of shells of a solid (including cavities).
* @param solidIndex the index of the solid.
* @return the number of shells.
*/
- const int countSolidShells(const int& solidIndex);
+ int countSolidShells(int solidIndex);
/**
* Gets the indices of the shells of the solids.
* @param shellIndex the index of the shell (for the given solid).
* @return the list of shells for the given solid.
*/
- std::vector<int> getSolidFaces(const int& solidIndex, const int& shellIndex);
+ std::vector<int> getSolidFaces(int solidIndex, int shellIndex);
/**
* Gets the coordinates of a vertex.
* @param yCoord the Y coordinate.
* @param zCoord the Z coordinate.
*/
- void getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord)
- throw (XAO_Exception);
+ void getVertexXYZ(int vertexIndex, double& xCoord, double& yCoord, double& zCoord)
+ ;
/**
* Gets the length of an edge.
* @param index the index of the edge.
* @return the length of the edge.
*/
- const double getEdgeLength(const int& index);
+ double getEdgeLength(int index);
/**
* Gets the are of a face.
* @param index the index of a face.
* @return the area of the face.
*/
- const double getFaceArea(const int& index);
+ double getFaceArea(int index);
/**
* Gets the volume of a solid.
* @param index the index of the solid.
* @return the volume of the solid.
*/
- const double getSolidVolume(const int& index);
+ double getSolidVolume(int index);
/**
* Gets the ID of a vertex.
* @param index the index of the vertex.
* @return the ID of the vertex.
*/
- const int getVertexID(const int& index);
+ int getVertexID(int index);
/**
* Gets the ID of an edge.
* @param index the index of the edge.
* @return the ID of the edge.
*/
- const int getEdgeID(const int& index);
+ int getEdgeID(int index);
/**
* Gets the ID of a face.
* @param index the index of the face.
* @return the ID of the face.
*/
- const int getFaceID(const int& index);
+ int getFaceID(int index);
/**
* Gets the ID of a solid.
* @param index the index of the solid.
* @return the ID of the solid.
*/
- const int getSolidID(const int& index);
+ int getSolidID(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(int index, 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(int index, 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(int index, 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(int index, int id);
/**
* Finds a vertex with its ID.
* @param id the ID of the vertex.
* @return the index of the vertex.
*/
- const int findVertex(const int& id);
+ int findVertex(int id);
/**
* Finds an edge with its ID.
* @param id the ID of the edge.
* @return the index of the edge.
*/
- const int findEdge(const int& id);
+ int findEdge(int id);
/**
* Finds a face with its ID.
* @param id the ID of the face.
* @return the index of the face.
*/
- const int findFace(const int& id);
+ int findFace(int id);
/**
* Finds a solid with its ID.
* @param id the ID of the solid.
* @return th index of the solid.
*/
- const int findSolid(const int& id);
+ int findSolid(int id);
/**
* Finds the name of a vertex with its ID.
* @param id the ID of the vertex.
* @return the name of the vertex.
*/
- const std::string findVertexName(const int& id);
+ const std::string findVertexName(int id);
/**
* Finds the name of an edge with its ID.
* @param id the ID of the edge.
* @return the name of the edge.
*/
- const std::string findEdgeName(const int& id);
+ const std::string findEdgeName(int id);
/**
* Finds the name of a face with its ID.
* @param id the ID of the face.
* @return the name of the face.
*/
- const std::string findFaceName(const int& id);
+ const std::string findFaceName(int id);
/**
* Finds the name of a solid with its ID.
* @param id the ID of the solid.
* @return the name of the solid.
*/
- const std::string findSolidName(const int& id);
+ const std::string findSolidName(int id);
/**
* Changes the name of a vertex.
* @param id the ID of the vertex.
* @param name the name to set.
*/
- void changeVertexName(const int& id, const std::string& name) throw (XAO_Exception);
+ void changeVertexName(int id, const std::string& name) ;
/**
* Changes the name of an edge.
* @param id the ID of the edge
* @param name the name to set.
*/
- void changeEdgeName(const int& id, const std::string& name) throw (XAO_Exception);
+ void changeEdgeName(int id, const std::string& name) ;
/**
* Changes the name of a face.
* @param id the ID of the face.
* @param name the name to set.
*/
- void changeFaceName(const int& id, const std::string& name) throw (XAO_Exception);
+ void changeFaceName(int id, const std::string& name) ;
/**
* Changes the name of a solid.
* @param id the ID of the solid.
* @param name the name to set.
*/
- void changeSolidName(const int& id, const std::string& name) throw (XAO_Exception);
+ void changeSolidName(int id, const std::string& name) ;
private:
void initIds();
void initListIds(const TopAbs_ShapeEnum& shapeType, GeometricElementList& eltList);
- TopoDS_Shape getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex)
- throw (XAO_Exception);
- const int countGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType);
- std::vector<int> getGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType, const XAO::Dimension& dim);
- const int findElement(const XAO::Dimension& dim, const int& id)
- throw (XAO_Exception);
+ TopoDS_Shape getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, int shapeIndex)
+ ;
+ int countGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType);
+ std::vector<int> getGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType, XAO::Dimension dim);
+ int findElement(XAO::Dimension dim, int id)
+ ;
private:
TopoDS_Shape m_shape;
using namespace XAO;
-DoubleField::DoubleField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name)
+DoubleField::DoubleField(XAO::Dimension dimension, int nbElements, int nbComponents, const std::string& name)
: Field(dimension, nbElements, nbComponents, name)
{
}
-Step* DoubleField::addNewStep(const int& step)
-throw (XAO_Exception)
+Step* DoubleField::addNewStep(int step)
+
{
return addStep(step, 0);
}
-DoubleStep* DoubleField::addStep(const int& step)
-throw (XAO_Exception)
+DoubleStep* DoubleField::addStep(int step)
+
{
return addStep(step, 0);
}
-DoubleStep* DoubleField::addStep(const int& step, const int& stamp)
-throw (XAO_Exception)
+DoubleStep* DoubleField::addStep(int step, int stamp)
+
{
if (hasStep(step))
throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists.");
return bstep;
}
-DoubleStep* DoubleField::getStep(const int& index)
-throw (XAO_Exception)
+DoubleStep* DoubleField::getStep(int index)
+
{
checkStepIndex(index);
return (DoubleStep*)m_steps[index];
* @param nbComponents the number of components.
* @param name the name of the field.
*/
- DoubleField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name);
+ DoubleField(XAO::Dimension dimension, int nbElements, int nbComponents, const std::string& name);
- virtual const XAO::Type getType() { return XAO::DOUBLE; }
+ virtual XAO::Type getType() { return XAO::DOUBLE; }
- virtual Step* addNewStep(const int& step) throw (XAO_Exception);
+ virtual Step* addNewStep(int step) ;
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- DoubleStep* addStep(const int& step) throw (XAO_Exception);
+ DoubleStep* addStep(int step) ;
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- DoubleStep* addStep(const int& step, const int& stamp) throw (XAO_Exception);
+ DoubleStep* addStep(int step, int stamp) ;
/**
* Gets the step of given index.
* @param index the index.
* @return the step for the given index.
*/
- DoubleStep* getStep(const int& index) throw (XAO_Exception);
+ DoubleStep* getStep(int index) ;
};
}
using namespace XAO;
-DoubleStep::DoubleStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents)
+DoubleStep::DoubleStep(int step, int stamp, int nbElements, int nbComponents)
{
m_nbElements = nbElements;
m_nbComponents = nbComponents;
return result;
}
-std::vector<double> DoubleStep::getElement(const int& element)
-throw (XAO_Exception)
+std::vector<double> DoubleStep::getElement(int element)
+
{
checkElementIndex(element);
return result;
}
-std::vector<double> DoubleStep::getComponent(const int& component)
-throw (XAO_Exception)
+std::vector<double> DoubleStep::getComponent(int component)
+
{
checkComponentIndex(component);
return result;
}
-const double DoubleStep::getValue(const int& element, const int& component)
-throw (XAO_Exception)
+double DoubleStep::getValue(int element, int component)
+
{
checkElementIndex(element);
checkComponentIndex(component);
return m_values[element][component];
}
-const std::string DoubleStep::getStringValue(const int& element, const int& component)
-throw (XAO_Exception)
+const std::string DoubleStep::getStringValue(int element, int component)
+
{
return XaoUtils::doubleToString(getValue(element, component));
}
void DoubleStep::setValues(const std::vector<double>& values)
-throw (XAO_Exception)
+
{
- checkNbValues((int)values.size());
+ checkNbValues(values.size());
for (int i = 0; i < m_nbElements; ++i)
{
}
}
-void DoubleStep::setElement(const int& element, const std::vector<double>& elements)
-throw (XAO_Exception)
+void DoubleStep::setElement(int element, const std::vector<double>& elements)
+
{
checkElementIndex(element);
- checkNbComponents((int)elements.size());
+ checkNbComponents(elements.size());
for (int i = 0; i < m_nbComponents; ++i)
m_values[element][i] = elements[i];
}
-void DoubleStep::setComponent(const int& component, const std::vector<double>& components)
-throw (XAO_Exception)
+void DoubleStep::setComponent(int component, const std::vector<double>& components)
+
{
checkElementIndex(component);
- checkNbElements((int)components.size());
+ checkNbElements(components.size());
for (int i = 0; i < m_nbElements; ++i)
m_values[i][component] = components[i];
}
-void DoubleStep::setValue(const int& element, const int& component, const double& value)
-throw (XAO_Exception)
+void DoubleStep::setValue(int element, int component, double value)
+
{
checkElementIndex(element);
checkComponentIndex(component);
m_values[element][component] = value;
}
-void DoubleStep::setStringValue(const int& element, const int& component, const std::string& value)
-throw (XAO_Exception)
+void DoubleStep::setStringValue(int element, int component, const std::string& value)
+
{
setValue(element, component, XaoUtils::stringToDouble(value));
}
#include "XAO_Step.hxx"
#ifdef WIN32
-#pragma warning(disable:4251) // std::vector needs dll-interface
#pragma warning(disable:4290) // Warning Exception ...
#endif
* @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(int step, int stamp, int nbElements, int nbComponents);
- virtual const XAO::Type getType() { return XAO::DOUBLE; }
+ virtual XAO::Type getType() { return XAO::DOUBLE; }
/**
* Gets all the values of the step as a list.
* @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) throw (XAO_Exception);
+ std::vector<double> getElement(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) throw (XAO_Exception);
+ std::vector<double> getComponent(int component) ;
/**
* Gets the value for an element and a component.
* @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) throw (XAO_Exception);
+ double getValue(int element, int component) ;
/**
* Sets all the values from a list.
* @param values the list of values to set.
*/
- void setValues(const std::vector<double>& values) throw (XAO_Exception);
+ 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 setElement(const int& element, const std::vector<double>& elements) throw (XAO_Exception);
+ void setElement(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 setComponent(const int& component, const std::vector<double>& components) throw (XAO_Exception);
+ void setComponent(int component, const std::vector<double>& components) ;
/**
* Sets the value for an element and a component.
* @param component the index of the component.
* @param value the value.
*/
- void setValue(const int& element, const int& component, const double& value) throw (XAO_Exception);
+ void setValue(int element, int component, double value) ;
- virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception);
- virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception);
+ virtual const std::string getStringValue(int element, int component) ;
+ virtual void setStringValue(int element, int component, const std::string& value) ;
private:
std::vector< std::vector<double> > m_values;
#include "XAO.hxx"
#include <exception>
-#ifdef WIN32
-#pragma warning(disable : 4275) // for std::exception
-#endif
-
namespace XAO
{
/**
{
}
- virtual ~XAO_Exception() throw() {};
+ virtual ~XAO_Exception() noexcept {};
/**
* Returns the error message.
* @return the error message.
*/
- virtual const char* what() const throw ()
+ virtual const char* what() const noexcept
{
return m_message;
}
// -------------------------------------------------------
-Field::Field(const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents, const std::string& name)
+Field::Field(XAO::Dimension dimension,
+ int nbElements, int nbComponents, const std::string& name)
: m_name(name), m_dimension(dimension),
m_nbComponents(nbComponents), m_components(nbComponents, ""),
m_nbElements(nbElements)
delete m_steps[i];
}
-Field* Field::createField(const XAO::Type& type, const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents, const std::string& name)
-throw (XAO_Exception)
+Field* Field::createField(XAO::Type type, XAO::Dimension dimension,
+ int nbElements, int nbComponents, const std::string& name)
{
if (type == XAO::BOOLEAN)
return new BooleanField(dimension, nbElements, nbComponents, name);
throw XAO_Exception(MsgBuilder() << "Bad Type: " << type);
}
-const std::string Field::getComponentName(const int& index)
-throw (XAO_Exception)
+const std::string Field::getComponentName(int index)
{
checkComponent(index);
return m_components[index];
}
-void Field::setComponentName(const int& index, const std::string& name)
-throw (XAO_Exception)
+void Field::setComponentName(int index, const std::string& name)
{
checkComponent(index);
m_components[index] = name;
}
void Field::setComponentsNames(const std::vector<std::string>& names)
-throw (XAO_Exception)
{
for (unsigned int i = 0; i < names.size(); ++i)
{
return false;
}
-bool Field::hasStep(const int& step)
+bool Field::hasStep(int step)
{
std::vector<Step*>::iterator it = m_steps.begin();
for (; it != m_steps.end(); ++it)
return false;
}
-void Field::checkComponent(const int& component)
-throw (XAO_Exception)
+void Field::checkComponent(int component)
{
if (component < m_nbComponents && component >= 0)
return;
<< m_nbComponents-1 << "]: " << component);
}
-void Field::checkStepIndex(const int& step)
-throw (XAO_Exception)
+void Field::checkStepIndex(int step)
{
if (step < (int)m_steps.size() && step >= 0)
return;
* @param nbComponents the number of components.
* @param name the name of the field.
*/
- Field(const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents, const std::string& name);
+ Field(XAO::Dimension dimension,
+ int nbElements, int nbComponents, const std::string& name);
public:
/**
* @name the name of the field.
* @return the created field.
*/
- static Field* createField(const XAO::Type& type, const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents,
- const std::string& name = std::string(""))
- throw (XAO_Exception);
+ static Field* createField(XAO::Type type, XAO::Dimension dimension,
+ int nbElements, int nbComponents,
+ const std::string& name = std::string(""));
/**
* Destructor.
* Gets the Type of the field.
* @return the Type of the field.
*/
- virtual const XAO::Type getType() = 0;
+ virtual XAO::Type getType() = 0;
/**
* Gets the name of the Field.
* Gets the Dimension of the Field.
* @return the Dimension of the Field.
*/
- const XAO::Dimension getDimension() const
+ XAO::Dimension getDimension() const
{
return m_dimension;
}
* Gets the number of elements of each step.
* @return the number of elements of each step.
*/
- const int countElements() const
+ int countElements() const
{
return m_nbElements;
}
* Gets the number of components.
* @return the number of components.
*/
- const int countComponents() const
+ int countComponents() const
{
return m_nbComponents;
}
* Gets the number of values for each step.
* @return the number of values for each step.
*/
- const int countValues() const
+ int countValues() const
{
return m_nbElements * m_nbComponents;
}
* Gets the number of the steps.
* @return the number of steps.
*/
- const int countSteps() const { return (int)m_steps.size(); }
+ int countSteps() const { return m_steps.size(); }
/**
* Gets the name of a component.
* @param index the index of the component to get.
* @return the name of the component for the given index.
*/
- const std::string getComponentName(const int& index) throw (XAO_Exception);
+ const std::string getComponentName(int index);
/**
* Sets the name of a component.
* @param componentIndex the index of the component to set.
* @param name the name to set.
*/
- void setComponentName(const int& componentIndex, const std::string& name) throw (XAO_Exception);
+ void setComponentName(int componentIndex, const std::string& name);
/**
* Sets the name of the components.
* @param names the names to set.
*/
- void setComponentsNames(const std::vector<std::string>& names) throw (XAO_Exception);
+ void setComponentsNames(const std::vector<std::string>& names);
/**
* Adds a new step of the same type than the field.
* @param number the numer of the step.
* @return the new create step.
*/
- virtual Step* addNewStep(const int& number) throw (XAO_Exception) = 0;
+ virtual Step* addNewStep(int number) = 0;
/**
* Remove a step.
* @param step the step number.
* @return true if the field has a step for the given number.
*/
- bool hasStep(const int& step);
+ bool hasStep(int step);
/**
* Returns the first step.
stepIterator end() { return m_steps.end(); }
protected:
- void checkComponent(const int& component) throw (XAO_Exception);
- void checkStepIndex(const int& step) throw (XAO_Exception);
+ void checkComponent(int component) ;
+ void checkStepIndex(int step) ;
protected:
/** The name of the Field. */
{
}
-const bool GeometricElement::hasName()
+bool GeometricElement::hasName()
{
return !m_name.empty();
}
setSize(0);
}
-GeometricElementList::GeometricElementList(const int& count)
+GeometricElementList::GeometricElementList(int count)
{
setSize(count);
}
-void GeometricElementList::setSize(const int& nb)
+void GeometricElementList::setSize(int nb)
{
m_count = nb;
m_elements.clear();
}
}
-void GeometricElementList::checkElementIndex(const int& index) const
-throw (XAO_Exception)
+void GeometricElementList::checkElementIndex(int index) const
{
if (m_count >= 0 && index < m_count)
return;
<< m_count-1 << "]: " << index);
}
-void GeometricElementList::setElement(const int& index, const std::string& name, const std::string& reference)
-throw (XAO_Exception)
+void GeometricElementList::setElement(int index, const std::string& name, const std::string& reference)
{
checkElementIndex(index);
m_elements[index].setName(name);
m_elements[index].setReference(reference);
}
-const std::string GeometricElementList::getName(const int& index)
-throw (XAO_Exception)
+const std::string GeometricElementList::getName(int index)
{
checkElementIndex(index);
return m_elements[index].getName();
}
-void GeometricElementList::setName(const int& index, const std::string& name)
-throw (XAO_Exception)
+void GeometricElementList::setName(int index, const std::string& name)
{
checkElementIndex(index);
m_elements[index].setName(name);
}
-const bool GeometricElementList::hasName(const int& index)
-throw (XAO_Exception)
+bool GeometricElementList::hasName(int index)
{
checkElementIndex(index);
return m_elements[index].hasName();
}
-const std::string GeometricElementList::getReference(const int& index)
-throw (XAO_Exception)
+const std::string GeometricElementList::getReference(int index)
{
checkElementIndex(index);
return m_elements[index].getReference();
}
-void GeometricElementList::setReference(const int& index, const std::string& name)
-throw (XAO_Exception)
+void GeometricElementList::setReference(int index, const std::string& name)
{
checkElementIndex(index);
m_elements[index].setReference(name);
}
-const int GeometricElementList::getIndexByReference(const std::string& ref)
-throw (XAO_Exception)
+int GeometricElementList::getIndexByReference(const std::string& ref)
{
for (int index = 0; index < m_count; ++index)
{
* Checks if the element has a name.
* @return true if the element has a name, false otherwise.
*/
- const bool hasName();
+ bool hasName();
/**
* Gets the reference of the element.
* Constructor with size.
* \param nb the size to set.
*/
- GeometricElementList(const int& nb);
+ GeometricElementList(int nb);
/**
* Destructor.
* Gets the size of the list.
* \return the size of the list.
*/
- const int getSize() const { return m_count; }
+ int getSize() const { return m_count; }
/**
* Sets the size of the list.
* \param nb the size to set.
* \warning the list will be cleared.
*/
- void setSize(const int& nb);
+ void setSize(int nb);
/**
* Sets the name and the reference of an element.
* \param reference the reference to set.
* \throw XAO_Exception if index is bigger than the size of the list.
*/
- void setElement(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception);
+ void setElement(int index, const std::string& name, const std::string& reference);
/**
* Gets the name of an element.
* \param index the index of the element to set.
* \return the name of the element with the given index.
* \throw XAO_Exception if index is bigger than the size of the list.
*/
- const std::string getName(const int& index) throw (XAO_Exception);
+ const std::string getName(int index);
/**
* Sets the name of an element.
* \param index the index of the element.
* \param name the name to set.
* \throw XAO_Exception if index is bigger than the size of the list.
*/
- void setName(const int& index, const std::string& name) throw (XAO_Exception);
+ void setName(int index, const std::string& name);
/**
* Checks if an element has a name.
* @param index the index of the element.
* @return true if the element has a name, false otherwise.
*/
- const bool hasName(const int& index) throw (XAO_Exception);
+ bool hasName(int index);
/**
* Gets the reference of an element.
* \return the reference of the element.
* \throw XAO_Exception if index is bigger than the size of the list.
*/
- const std::string getReference(const int& index) throw (XAO_Exception);
+ const std::string getReference(int index);
/**
* Sets the reference of an element.
* \param index the index of the element to set.
* \param reference the reference to set.
* \throw XAO_Exception if index is bigger than the size of the list.
*/
- void setReference(const int& index, const std::string& reference) throw (XAO_Exception);
+ void setReference(int index, const std::string& reference);
/**
* Gets the index of an element using its reference.
* \param reference the searched reference.
* \return the index of the element or -1 if no element found.
*/
- const int getIndexByReference(const std::string& reference) throw (XAO_Exception);
+ int getIndexByReference(const std::string& reference);
/**
* Iterator on the element of the list.
iterator end() { return m_elements.end(); }
private:
- void checkElementIndex(const int& index) const throw (XAO_Exception);
+ void checkElementIndex(int index) const;
private:
int m_count;
m_readOnly = false;
}
-Geometry* Geometry::createGeometry(const XAO::Format& format)
-throw (XAO_Exception)
+Geometry* Geometry::createGeometry(XAO::Format format)
{
return createGeometry(format, "");
}
-Geometry* Geometry::createGeometry(const XAO::Format& format, const std::string& name)
-throw (XAO_Exception)
+Geometry* Geometry::createGeometry(XAO::Format format, const std::string& name)
{
if (format == XAO::BREP)
return new BrepGeometry(name);
}
void Geometry::checkReadOnly()
-throw (XAO_Exception)
{
if (m_readOnly)
throw XAO_Exception("Geometry is read only.");
}
-const int Geometry::countElements(const XAO::Dimension& dim) const
-throw (XAO_Exception)
+int Geometry::countElements(XAO::Dimension dim) const
{
if (dim == XAO::VERTEX)
return countVertices();
throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
-const std::string Geometry::getElementReference(const XAO::Dimension& dim, const int& index)
-throw (XAO_Exception)
+const std::string Geometry::getElementReference(XAO::Dimension dim, int index)
{
if (dim == XAO::VERTEX)
return getVertexReference(index);
throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
-const int Geometry::getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference)
-throw (XAO_Exception)
+int Geometry::getElementIndexByReference(XAO::Dimension dim, const std::string& reference)
{
if (dim == XAO::VERTEX)
return getVertexIndexByReference(reference);
throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
-GeometricElementList::iterator Geometry::begin(const XAO::Dimension& dim)
-throw (XAO_Exception)
+GeometricElementList::iterator Geometry::begin(XAO::Dimension dim)
{
if (dim == XAO::VERTEX)
return m_vertices.begin();
throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
-GeometricElementList::iterator Geometry::end(const XAO::Dimension& dim)
-throw (XAO_Exception)
+GeometricElementList::iterator Geometry::end(XAO::Dimension dim)
{
if (dim == XAO::VERTEX)
return m_vertices.end();
throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
-void Geometry::setCountVertices(const int& nb) throw (XAO_Exception)
+void Geometry::setCountVertices(int nb)
{
checkReadOnly();
m_vertices.setSize(nb);
}
-void Geometry::setCountEdges(const int& nb) throw (XAO_Exception)
+void Geometry::setCountEdges(int nb)
{
checkReadOnly();
m_edges.setSize(nb);
}
-void Geometry::setCountFaces(const int& nb) throw (XAO_Exception)
+void Geometry::setCountFaces(int nb)
{
checkReadOnly();
m_faces.setSize(nb);
}
-void Geometry::setCountSolids(const int& nb) throw (XAO_Exception)
+void Geometry::setCountSolids(int nb)
{
checkReadOnly();
m_solids.setSize(nb);
}
-void Geometry::setVertexReference(const int& index, const std::string& reference) throw (XAO_Exception)
+void Geometry::setVertexReference(int index, const std::string& reference)
{
checkReadOnly();
m_vertices.setReference(index, reference);
}
-void Geometry::setEdgeReference(const int& index, const std::string& reference) throw (XAO_Exception)
+void Geometry::setEdgeReference(int index, const std::string& reference)
{
checkReadOnly();
m_edges.setReference(index, reference);
}
-void Geometry::setFaceReference(const int& index, const std::string& reference) throw (XAO_Exception)
+void Geometry::setFaceReference(int index, const std::string& reference)
{
checkReadOnly();
m_faces.setReference(index, reference);
}
-void Geometry::setSolidReference(const int& index, const std::string& reference) throw (XAO_Exception)
+void Geometry::setSolidReference(int index, const std::string& reference)
{
checkReadOnly();
m_solids.setReference(index, reference);
}
-void Geometry::setVertex(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception)
+void Geometry::setVertex(int index, const std::string& name, const std::string& reference)
{
checkReadOnly();
m_vertices.setElement(index, name, reference);
}
-void Geometry::setEdge(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception)
+void Geometry::setEdge(int index, const std::string& name, const std::string& reference)
{
checkReadOnly();
m_edges.setElement(index, name, reference);
}
-void Geometry::setFace(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception)
+void Geometry::setFace(int index, const std::string& name, const std::string& reference)
{
checkReadOnly();
m_faces.setElement(index, name, reference);
}
-void Geometry::setSolid(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception)
+void Geometry::setSolid(int index, const std::string& name, const std::string& reference)
{
checkReadOnly();
m_solids.setElement(index, name, reference);
* @param format the format of the geometry.
* @return the created geometry.
*/
- static Geometry* createGeometry(const XAO::Format& format) throw (XAO_Exception);
+ static Geometry* createGeometry(XAO::Format format) ;
/**
* Constructor.
* @name name the name of the geometry.
* @return the created geometry.
*/
- static Geometry* createGeometry(const XAO::Format& format, const std::string& name)
- throw (XAO_Exception);
+ static Geometry* createGeometry(XAO::Format format, const std::string& name);
/** Destructor. */
virtual ~Geometry();
* Gets the format of the geometry.
* @return the format of the geometry.
*/
- virtual const XAO::Format getFormat() = 0;
+ virtual XAO::Format getFormat() = 0;
virtual const std::string getShapeString() = 0;
virtual void setShapeString(const std::string& shape) = 0;
virtual void writeShapeFile(const std::string& fileName) = 0;
virtual void readShapeFile(const std::string& fileName) = 0;
- const int countElements(const XAO::Dimension& dim) const throw (XAO_Exception);
- const int countVertices() const { return m_vertices.getSize(); }
- const int countEdges() const { return m_edges.getSize(); }
- const int countFaces() const { return m_faces.getSize(); }
- const int countSolids() const { return m_solids.getSize(); }
-
- void setCountVertices(const int& nb) throw (XAO_Exception);
- void setCountEdges(const int& nb) throw (XAO_Exception);
- void setCountFaces(const int& nb) throw (XAO_Exception);
- void setCountSolids(const int& nb) throw (XAO_Exception);
-
- const std::string getVertexName(const int& index) throw (XAO_Exception) { return m_vertices.getName(index); }
- const std::string getEdgeName(const int& index) throw (XAO_Exception) { return m_edges.getName(index); }
- const std::string getFaceName(const int& index) throw (XAO_Exception) { return m_faces.getName(index); }
- const std::string getSolidName(const int& index) throw (XAO_Exception) { return m_solids.getName(index); }
-
- void setVertexName(const int& index, const std::string& name) throw (XAO_Exception) { m_vertices.setName(index, name); }
- void setEdgeName(const int& index, const std::string& name) throw (XAO_Exception) { m_edges.setName(index, name); }
- void setFaceName(const int& index, const std::string& name) throw (XAO_Exception) { m_faces.setName(index, name); }
- void setSolidName(const int& index, const std::string& name) throw (XAO_Exception) { m_solids.setName(index, name); }
-
- const bool hasVertexName(const int& index) throw (XAO_Exception) { return m_vertices.hasName(index); }
- const bool hasEdgeName(const int& index) throw (XAO_Exception) { return m_edges.hasName(index); }
- const bool hasFaceName(const int& index) throw (XAO_Exception) { return m_faces.hasName(index); }
- const bool hasSolidName(const int& index) throw (XAO_Exception) { return m_solids.hasName(index); }
-
- const std::string getVertexReference(const int& index) throw (XAO_Exception) { return m_vertices.getReference(index); }
- const std::string getEdgeReference(const int& index) throw (XAO_Exception) { return m_edges.getReference(index); }
- const std::string getFaceReference(const int& index) throw (XAO_Exception) { return m_faces.getReference(index); }
- const std::string getSolidReference(const int& index) throw (XAO_Exception) { return m_solids.getReference(index); }
- const std::string getElementReference(const XAO::Dimension& dim, const int& index) throw (XAO_Exception);
-
- void setVertexReference(const int& index, const std::string& reference) throw (XAO_Exception);
- void setEdgeReference(const int& index, const std::string& reference) throw (XAO_Exception);
- void setFaceReference(const int& index, const std::string& reference) throw (XAO_Exception);
- void setSolidReference(const int& index, const std::string& reference) throw (XAO_Exception);
-
- void setVertex(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception);
- void setEdge(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception);
- void setFace(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception);
- void setSolid(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception);
-
- const int getVertexIndexByReference(const std::string& reference) { return m_vertices.getIndexByReference(reference); }
- const int getEdgeIndexByReference(const std::string& reference) { return m_edges.getIndexByReference(reference); }
- const int getFaceIndexByReference(const std::string& reference) { return m_faces.getIndexByReference(reference); }
- const int getSolidIndexByReference(const std::string& reference) { return m_solids.getIndexByReference(reference); }
- const int getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference) throw (XAO_Exception);
-
- GeometricElementList::iterator begin(const XAO::Dimension& dim) throw (XAO_Exception);
- GeometricElementList::iterator end(const XAO::Dimension& dim) throw (XAO_Exception);
+ int countElements(XAO::Dimension dim) const ;
+ int countVertices() const { return m_vertices.getSize(); }
+ int countEdges() const { return m_edges.getSize(); }
+ int countFaces() const { return m_faces.getSize(); }
+ int countSolids() const { return m_solids.getSize(); }
+
+ void setCountVertices(int nb);
+ void setCountEdges(int nb);
+ void setCountFaces(int nb);
+ void setCountSolids(int nb);
+
+ const std::string getVertexName(int index) { return m_vertices.getName(index); }
+ const std::string getEdgeName(int index) { return m_edges.getName(index); }
+ const std::string getFaceName(int index) { return m_faces.getName(index); }
+ const std::string getSolidName(int index) { return m_solids.getName(index); }
+
+ void setVertexName(int index, const std::string& name) { m_vertices.setName(index, name); }
+ void setEdgeName(int index, const std::string& name) { m_edges.setName(index, name); }
+ void setFaceName(int index, const std::string& name) { m_faces.setName(index, name); }
+ void setSolidName(int index, const std::string& name) { m_solids.setName(index, name); }
+
+ bool hasVertexName(int index) { return m_vertices.hasName(index); }
+ bool hasEdgeName(int index) { return m_edges.hasName(index); }
+ bool hasFaceName(int index) { return m_faces.hasName(index); }
+ bool hasSolidName(int index) { return m_solids.hasName(index); }
+
+ const std::string getVertexReference(int index) { return m_vertices.getReference(index); }
+ const std::string getEdgeReference(int index) { return m_edges.getReference(index); }
+ const std::string getFaceReference(int index) { return m_faces.getReference(index); }
+ const std::string getSolidReference(int index) { return m_solids.getReference(index); }
+ const std::string getElementReference(XAO::Dimension dim, int index) ;
+
+ void setVertexReference(int index, const std::string& reference) ;
+ void setEdgeReference(int index, const std::string& reference) ;
+ void setFaceReference(int index, const std::string& reference) ;
+ void setSolidReference(int index, const std::string& reference) ;
+
+ void setVertex(int index, const std::string& name, const std::string& reference) ;
+ void setEdge(int index, const std::string& name, const std::string& reference) ;
+ void setFace(int index, const std::string& name, const std::string& reference) ;
+ void setSolid(int index, const std::string& name, const std::string& reference) ;
+
+ int getVertexIndexByReference(const std::string& reference) { return m_vertices.getIndexByReference(reference); }
+ int getEdgeIndexByReference(const std::string& reference) { return m_edges.getIndexByReference(reference); }
+ int getFaceIndexByReference(const std::string& reference) { return m_faces.getIndexByReference(reference); }
+ int getSolidIndexByReference(const std::string& reference) { return m_solids.getIndexByReference(reference); }
+ int getElementIndexByReference(XAO::Dimension dim, const std::string& reference) ;
+
+ GeometricElementList::iterator begin(XAO::Dimension dim) ;
+ GeometricElementList::iterator end(XAO::Dimension dim) ;
/**
* Verifies if the geometry is read only.
void setReadOnly() { m_readOnly = true; }
protected:
- void checkReadOnly() throw (XAO_Exception);
+ void checkReadOnly() ;
protected:
std::string m_name;
using namespace XAO;
-Group::Group(const XAO::Dimension& dim, const int& nbElements, const std::string& name)
-throw (XAO_Exception)
+Group::Group(XAO::Dimension dim, int nbElements, const std::string& name)
{
if (dim == XAO::WHOLE)
throw XAO_Exception("Dimension WHOLE is not valid for group.");
{
}
-void Group::checkIndex(const int& element)
-throw (XAO_Exception)
+void Group::checkIndex(int element)
{
if (element < (int)m_elements.size() && element >= 0)
return;
<< m_elements.size()-1 << "]: " << element);
}
-void Group::add(const int& value)
+void Group::add(int value)
{
m_elements.insert(value);
}
-void Group::remove(const int& value)
+void Group::remove(int value)
{
m_elements.erase(value);
}
* @param nbElements the number of geometrical elements for the dimension in the geometry.
* @param name the name of the group.
*/
- Group(const XAO::Dimension& dim, const int& nbElements, const std::string& name = std::string(""))
- throw (XAO_Exception);
+ Group(XAO::Dimension dim, int nbElements, const std::string& name = std::string(""));
/**
* Destructor.
* Gets the dimension of the group.
* \return the dimension of the group.
*/
- const XAO::Dimension getDimension()
+ XAO::Dimension getDimension()
{
return m_dimension;
}
* Gets the numbers of elements in the geometry of the same type than the group.
* \return the number of elements in the associated geometry.
*/
- const int getNbElements()
+ int getNbElements()
{
return m_nbElements;
}
* Gets the number of elements in the group.
* \return the number of elements.
*/
- const int count() const
+ int count() const
{
- return (int)m_elements.size();
+ return m_elements.size();
}
/**
* \return the reference of the element.
* \note use begin() and end() if you need to iterate.
*/
- const int get(const int& index)
+ int get(int index)
{
checkIndex(index);
std::set<int>::iterator it = m_elements.begin();
* Adds an element to the group.
* \param value the index of the element to add.
*/
- void add(const int& value);
+ void add(int value);
/**
* Removes an element from the group.
* \param value the index of the element to remove.
*/
- void remove(const int& value);
+ void remove(int value);
/**
* Gets an iterator on the first element in the group.
* @param element
* @throw XAO_Exception if element is bigger than the number of elements.
*/
- void checkIndex(const int& element)
- throw (XAO_Exception);
+ void checkIndex(int element);
private:
/** The name of the group. */
using namespace XAO;
-IntegerField::IntegerField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name)
+IntegerField::IntegerField(XAO::Dimension dimension, int nbElements, int nbComponents, const std::string& name)
: Field(dimension, nbElements, nbComponents, name)
{
}
-Step* IntegerField::addNewStep(const int& step)
-throw (XAO_Exception)
+Step* IntegerField::addNewStep(int step)
+
{
return addStep(step, 0);
}
-IntegerStep* IntegerField::addStep(const int& step)
-throw (XAO_Exception)
+IntegerStep* IntegerField::addStep(int step)
+
{
return addStep(step, 0);
}
-IntegerStep* IntegerField::addStep(const int& step, const int& stamp)
-throw (XAO_Exception)
+IntegerStep* IntegerField::addStep(int step, int stamp)
+
{
if (hasStep(step))
throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists.");
return bstep;
}
-IntegerStep* IntegerField::getStep(const int& index)
-throw (XAO_Exception)
+IntegerStep* IntegerField::getStep(int index)
+
{
checkStepIndex(index);
return (IntegerStep*)m_steps[index];
* @param nbComponents the number of components.
* @param name the name of the field.
*/
- IntegerField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name);
+ IntegerField(XAO::Dimension dimension, int nbElements, int nbComponents, const std::string& name);
- virtual const XAO::Type getType() { return XAO::INTEGER; }
+ virtual XAO::Type getType() { return XAO::INTEGER; }
- virtual Step* addNewStep(const int& step) throw (XAO_Exception);
+ virtual Step* addNewStep(int step) ;
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- IntegerStep* addStep(const int& step) throw (XAO_Exception);
+ IntegerStep* addStep(int step) ;
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- IntegerStep* addStep(const int& step, const int& stamp) throw (XAO_Exception);
+ IntegerStep* addStep(int step, int stamp) ;
/**
* 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) throw (XAO_Exception);
+ IntegerStep* getStep(int index) ;
};
}
using namespace XAO;
-IntegerStep::IntegerStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents)
+IntegerStep::IntegerStep(int step, int stamp, int nbElements, int nbComponents)
{
m_nbElements = nbElements;
m_nbComponents = nbComponents;
return result;
}
-std::vector<int> IntegerStep::getElement(const int& element)
-throw (XAO_Exception)
+std::vector<int> IntegerStep::getElement(int element)
+
{
checkElementIndex(element);
return result;
}
-std::vector<int> IntegerStep::getComponent(const int& component)
-throw (XAO_Exception)
+std::vector<int> IntegerStep::getComponent(int component)
+
{
checkComponentIndex(component);
return result;
}
-const int IntegerStep::getValue(const int& element, const int& component)
-throw (XAO_Exception)
+int IntegerStep::getValue(int element, int component)
+
{
checkElementIndex(element);
checkComponentIndex(component);
return m_values[element][component];
}
-const std::string IntegerStep::getStringValue(const int& element, const int& component)
-throw (XAO_Exception)
+const std::string IntegerStep::getStringValue(int element, int component)
+
{
return XaoUtils::intToString(getValue(element, component));
}
void IntegerStep::setValues(const std::vector<int>& values)
-throw (XAO_Exception)
+
{
- checkNbValues((int)values.size());
+ checkNbValues(values.size());
for (int i = 0; i < m_nbElements; ++i)
{
}
}
-void IntegerStep::setElement(const int& element, const std::vector<int>& elements)
-throw (XAO_Exception)
+void IntegerStep::setElement(int element, const std::vector<int>& elements)
+
{
checkElementIndex(element);
- checkNbComponents((int)elements.size());
+ checkNbComponents(elements.size());
for (int i = 0; i < m_nbComponents; ++i)
m_values[element][i] = elements[i];
}
-void IntegerStep::setComponent(const int& component, const std::vector<int>& components)
-throw (XAO_Exception)
+void IntegerStep::setComponent(int component, const std::vector<int>& components)
+
{
checkElementIndex(component);
- checkNbElements((int)components.size());
+ checkNbElements(components.size());
for (int i = 0; i < m_nbElements; ++i)
m_values[i][component] = components[i];
}
-void IntegerStep::setValue(const int& element, const int& component, const int& value)
-throw (XAO_Exception)
+void IntegerStep::setValue(int element, int component, int value)
+
{
checkElementIndex(element);
checkComponentIndex(component);
m_values[element][component] = value;
}
-void IntegerStep::setStringValue(const int& element, const int& component, const std::string& value)
-throw (XAO_Exception)
+void IntegerStep::setStringValue(int element, int component, const std::string& value)
+
{
setValue(element, component, XaoUtils::stringToInt(value));
}
* @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(int step, int stamp, int nbElements, int nbComponents);
- virtual const XAO::Type getType() { return XAO::INTEGER; }
+ virtual XAO::Type getType() { return XAO::INTEGER; }
/**
* Gets all the values of the step as a list.
* @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) throw (XAO_Exception);
+ std::vector<int> getElement(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) throw (XAO_Exception);
+ std::vector<int> getComponent(int component) ;
/**
* Gets the value for an element and a component.
* @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) throw (XAO_Exception);
+ int getValue(int element, int component) ;
/**
* Sets all the values from a list.
* @param values the list of values to set.
*/
- void setValues(const std::vector<int>& values) throw (XAO_Exception);
+ 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 setElement(const int& element, const std::vector<int>& elements) throw (XAO_Exception);
+ void setElement(int element, const std::vector<int>& elements) ;
/**
* Sets the values for a component.
* @param component the index of the component to set.
* @param components the values to set.
*/
- void setComponent(const int& component, const std::vector<int>& components) throw (XAO_Exception);
+ void setComponent(int component, const std::vector<int>& components) ;
/**
* Sets the value for an element and a component.
* @param component the index of the component.
* @param value the value.
*/
- void setValue(const int& element, const int& component, const int& value) throw (XAO_Exception);
+ void setValue(int element, int component, int value) ;
- virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception);
- virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception);
+ virtual const std::string getStringValue(int element, int component) ;
+ virtual void setStringValue(int element, int component, const std::string& value) ;
private:
std::vector< std::vector<int> > m_values;
using namespace XAO;
-void Step::checkElementIndex(const int& element)
-throw (XAO_Exception)
+void Step::checkElementIndex(int element)
{
if (element < m_nbElements && element >= 0)
return;
<< m_nbElements-1 << "]: " << element);
}
-void Step::checkComponentIndex(const int& component)
-throw (XAO_Exception)
+void Step::checkComponentIndex(int component)
{
if (component < m_nbComponents && component >= 0)
return;
<< m_nbComponents-1 << "]: " << component);
}
-void Step::checkNbElements(const int& nbElements)
-throw (XAO_Exception)
+void Step::checkNbElements(int nbElements)
{
if (nbElements == m_nbElements)
return;
<< ", expected " << m_nbElements);
}
-void Step::checkNbComponents(const int& nbComponents)
-throw (XAO_Exception)
+void Step::checkNbComponents(int nbComponents)
{
if (nbComponents == m_nbComponents)
return;
<< ", expected " << m_nbComponents);
}
-void Step::checkNbValues(const int& nbValues)
-throw (XAO_Exception)
+void Step::checkNbValues(int nbValues)
{
if (nbValues == m_nbElements * m_nbComponents)
return;
* Gets the type of the step.
* @return
*/
- virtual const XAO::Type getType() = 0;
+ virtual XAO::Type getType() = 0;
/**
* Gets the step index.
* @return the index of the step.
*/
- const int getStep() { return m_step; }
+ int getStep() { return m_step; }
/**
* Sets the number of the step.
* @param step the index to set.
*/
- void setStep(const int& step) { m_step = step; }
+ void setStep(int step) { m_step = step; }
/**
* Gets the stamp of the index.
* @return the stamp of the index.
*/
- const int getStamp() { return m_stamp; }
+ int getStamp() { return m_stamp; }
/**
* Sets the stamp of the index.
* @param stamp the stamp to set.
*/
- void setStamp(const int& stamp) { m_stamp = stamp; }
+ void setStamp(int stamp) { m_stamp = stamp; }
/**
* Gets the number of components of the step.
* @return the number of components.
*/
- const int countComponents() { return m_nbComponents; }
+ int countComponents() { return m_nbComponents; }
/**
* Gets the number of elements for the step.
* @return the number of elements.
*/
- const int countElements() { return m_nbElements; }
+ int countElements() { return m_nbElements; }
/**
* Gets the number of values for the step.
* @return the number of values.
*/
- const int countValues() { return m_nbElements * m_nbComponents; }
+ int countValues() { return m_nbElements * m_nbComponents; }
/**
* Gets a value as a string.
* @param component the index of the component.
* @return the value as a string.
*/
- virtual const std::string getStringValue(const int& element, const int& component) = 0;
+ virtual const std::string getStringValue(int element, int component) = 0;
/**
* Sets a value as a string
* @param value the string value.
* @throw XAO_Exception if the value is not valid.
*/
- virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0;
+ virtual void setStringValue(int element, 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) throw (XAO_Exception);
+ void checkElementIndex(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)throw (XAO_Exception);
+ void checkComponentIndex(int component);
/**
* Checks that the given number of elements is correct.
* @param nbElements the number of elements to check.
*/
- void checkNbElements(const int& nbElements)throw (XAO_Exception);
+ void checkNbElements(int nbElements);
/**
* Checks that the given number of components is correct.
* @param nbComponents the number of components to check.
*/
- void checkNbComponents(const int& nbComponents)throw (XAO_Exception);
+ void checkNbComponents(int nbComponents);
/**
* checks that the given number of values is correct.
* @param nbValues the number of values to check.
*/
- void checkNbValues(const int& nbValues)throw (XAO_Exception);
+ void checkNbValues(int nbValues);
protected:
/** the index of the step. */
using namespace XAO;
-StringField::StringField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name)
+StringField::StringField(XAO::Dimension dimension, int nbElements, int nbComponents, const std::string& name)
: Field(dimension, nbElements, nbComponents, name)
{
}
-Step* StringField::addNewStep(const int& step)
-throw (XAO_Exception)
+Step* StringField::addNewStep(int step)
+
{
return addStep(step, 0);
}
-StringStep* StringField::addStep(const int& step)
-throw (XAO_Exception)
+StringStep* StringField::addStep(int step)
+
{
return addStep(step, 0);
}
-StringStep* StringField::addStep(const int& step, const int& stamp)
-throw (XAO_Exception)
+StringStep* StringField::addStep(int step, int stamp)
+
{
if (hasStep(step))
throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists.");
return bstep;
}
-StringStep* StringField::getStep(const int& index)
-throw (XAO_Exception)
+StringStep* StringField::getStep(int index)
+
{
checkStepIndex(index);
return (StringStep*)m_steps[index];
* @param nbComponents the number of components.
* @param name the name of the field.
*/
- StringField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name);
+ StringField(XAO::Dimension dimension, int nbElements, int nbComponents, const std::string& name);
- virtual const XAO::Type getType() { return XAO::STRING; }
+ virtual XAO::Type getType() { return XAO::STRING; }
- virtual Step* addNewStep(const int& step) throw (XAO_Exception);
+ virtual Step* addNewStep(int step) ;
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- StringStep* addStep(const int& step) throw (XAO_Exception);
+ StringStep* addStep(int step) ;
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- StringStep* addStep(const int& step, const int& stamp) throw (XAO_Exception);
+ StringStep* addStep(int step, 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) throw (XAO_Exception);
+ StringStep* getStep(int index) ;
};
}
using namespace XAO;
-StringStep::StringStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents)
+StringStep::StringStep(int step, int stamp, int nbElements, int nbComponents)
{
m_nbElements = nbElements;
m_nbComponents = nbComponents;
return result;
}
-std::vector<std::string> StringStep::getElement(const int& element)
-throw (XAO_Exception)
+std::vector<std::string> StringStep::getElement(int element)
+
{
checkElementIndex(element);
return result;
}
-std::vector<std::string> StringStep::getComponent(const int& component)
-throw (XAO_Exception)
+std::vector<std::string> StringStep::getComponent(int component)
+
{
checkComponentIndex(component);
return result;
}
-const std::string StringStep::getValue(const int& element, const int& component)
-throw (XAO_Exception)
+const std::string StringStep::getValue(int element, int component)
+
{
checkElementIndex(element);
checkComponentIndex(component);
return m_values[element][component];
}
-const std::string StringStep::getStringValue(const int& element, const int& component)
-throw (XAO_Exception)
+const std::string StringStep::getStringValue(int element, int component)
+
{
return getValue(element, component);
}
void StringStep::setValues(const std::vector<std::string>& values)
-throw (XAO_Exception)
+
{
- checkNbValues((int)values.size());
+ checkNbValues(values.size());
for (int i = 0; i < m_nbElements; ++i)
{
}
}
-void StringStep::setElement(const int& element, const std::vector<std::string>& elements)
-throw (XAO_Exception)
+void StringStep::setElement(int element, const std::vector<std::string>& elements)
+
{
checkElementIndex(element);
- checkNbComponents((int)elements.size());
+ checkNbComponents(elements.size());
for (int i = 0; i < m_nbComponents; ++i)
m_values[element][i] = elements[i];
}
-void StringStep::setComponent(const int& component, const std::vector<std::string>& components)
-throw (XAO_Exception)
+void StringStep::setComponent(int component, const std::vector<std::string>& components)
+
{
checkElementIndex(component);
- checkNbElements((int)components.size());
+ checkNbElements(components.size());
for (int i = 0; i < m_nbElements; ++i)
m_values[i][component] = components[i];
}
-void StringStep::setValue(const int& element, const int& component, const std::string& value)
-throw (XAO_Exception)
+void StringStep::setValue(int element, int component, const std::string& value)
+
{
checkElementIndex(element);
checkComponentIndex(component);
m_values[element][component] = value;
}
-void StringStep::setStringValue(const int& element, const int& component, const std::string& value)
-throw (XAO_Exception)
+void StringStep::setStringValue(int element, int component, const std::string& value)
+
{
setValue(element, component, value);
}
* @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(int step, int stamp, int nbElements, int nbComponents);
- virtual const XAO::Type getType() { return XAO::STRING; }
+ virtual XAO::Type getType() { return XAO::STRING; }
/**
* Gets all the values of the step as a list.
* @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) throw (XAO_Exception);
+ std::vector<std::string> getElement(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) throw (XAO_Exception);
+ std::vector<std::string> getComponent(int component) ;
/**
* Gets the value for an element and a component.
* @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) throw (XAO_Exception);
+ const std::string getValue(int element, 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) throw (XAO_Exception);
+ 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 setElement(const int& element, const std::vector<std::string>& elements) throw (XAO_Exception);
+ void setElement(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 setComponent(const int& component, const std::vector<std::string>& components) throw (XAO_Exception);
+ void setComponent(int component, const std::vector<std::string>& components) ;
/**
* Sets the value for an element and a component.
* @param component the index of the component.
* @param value the value.
*/
- void setValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception);
+ void setValue(int element, int component, const std::string& value) ;
- virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception);
- virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception);
+ virtual const std::string getStringValue(int element, int component) ;
+ virtual void setStringValue(int element, int component, const std::string& value) ;
private:
std::vector< std::vector<std::string> > m_values;
}
}
-const int Xao::countGroups() const
+int Xao::countGroups() const
{
- return (int)m_groups.size();
+ return m_groups.size();
}
-Group* Xao::getGroup(const int& index)
-throw (XAO_Exception)
+Group* Xao::getGroup(int index)
+
{
checkGroupIndex(index);
return NULL;
}
-Group* Xao::addGroup(const XAO::Dimension& dim, const std::string& name)
-throw (XAO_Exception)
+Group* Xao::addGroup(XAO::Dimension dim, const std::string& name)
+
{
checkGeometry();
checkGroupDimension(dim);
return res;
}
-const int Xao::countFields() const
+int Xao::countFields() const
{
- return (int)m_fields.size();
+ return m_fields.size();
}
-const XAO::Type Xao::getFieldType(const int& index)
-throw (XAO_Exception)
+XAO::Type Xao::getFieldType(int index)
+
{
return getField(index)->getType();
}
-Field* Xao::getField(const int& index)
-throw (XAO_Exception)
+Field* Xao::getField(int index)
+
{
checkFieldIndex(index);
throw XAO_Exception("Field not found.");
}
-BooleanField* Xao::getBooleanField(const int& index)
-throw (XAO_Exception)
+BooleanField* Xao::getBooleanField(int index)
+
{
Field* field = getField(index);
if (field->getType() != XAO::BOOLEAN)
return (BooleanField*)field;
}
-DoubleField* Xao::getDoubleField(const int& index)
-throw (XAO_Exception)
+DoubleField* Xao::getDoubleField(int index)
+
{
Field* field = getField(index);
if (field->getType() != XAO::DOUBLE)
return (DoubleField*)field;
}
-IntegerField* Xao::getIntegerField(const int& index)
-throw (XAO_Exception)
+IntegerField* Xao::getIntegerField(int index)
+
{
Field* field = getField(index);
if (field->getType() != XAO::INTEGER)
return (IntegerField*)field;
}
-StringField* Xao::getStringField(const int& index)
-throw (XAO_Exception)
+StringField* Xao::getStringField(int index)
+
{
Field* field = getField(index);
if (field->getType() != XAO::STRING)
return (StringField*)field;
}
-Field* Xao::addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents, const std::string& name)
-throw (XAO_Exception)
+Field* Xao::addField(XAO::Type type, XAO::Dimension dim, int nbComponents, const std::string& name)
+
{
checkGeometry();
int nbElts = m_geometry->countElements(dim);
return field;
}
-IntegerField* Xao::addIntegerField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name)
-throw (XAO_Exception)
+IntegerField* Xao::addIntegerField(XAO::Dimension dim, int nbComponents, const std::string& name)
+
{
checkGeometry();
int nbElts = m_geometry->countElements(dim);
m_fields.push_back(field);
return field;
}
-BooleanField* Xao::addBooleanField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name)
-throw (XAO_Exception)
+BooleanField* Xao::addBooleanField(XAO::Dimension dim, int nbComponents, const std::string& name)
+
{
checkGeometry();
int nbElts = m_geometry->countElements(dim);
m_fields.push_back(field);
return field;
}
-DoubleField* Xao::addDoubleField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name)
-throw (XAO_Exception)
+DoubleField* Xao::addDoubleField(XAO::Dimension dim, int nbComponents, const std::string& name)
+
{
checkGeometry();
int nbElts = m_geometry->countElements(dim);
m_fields.push_back(field);
return field;
}
-StringField* Xao::addStringField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name)
-throw (XAO_Exception)
+StringField* Xao::addStringField(XAO::Dimension dim, int nbComponents, const std::string& name)
+
{
checkGeometry();
int nbElts = m_geometry->countElements(dim);
return res;
}
-const bool Xao::exportXAO(const std::string& fileName, const std::string& shapeFileName)
+bool Xao::exportXAO(const std::string& fileName, const std::string& shapeFileName)
{
return XaoExporter::saveToFile(this, fileName, shapeFileName);
}
return XaoExporter::saveToXml(this);
}
-const bool Xao::importXAO(const std::string& fileName)
+bool Xao::importXAO(const std::string& fileName)
{
return XaoExporter::readFromFile(fileName, this);
}
-const bool Xao::setXML(const std::string& xml)
+bool Xao::setXML(const std::string& xml)
{
return XaoExporter::setXML(xml, this);
}
void Xao::checkGeometry() const
-throw(XAO_Exception)
{
if (m_geometry == NULL)
throw XAO_Exception("Geometry is null");
}
-void Xao::checkGroupIndex(const int& index) const
-throw(XAO_Exception)
+void Xao::checkGroupIndex(int index) const
{
if (index >= 0 && index < countGroups())
return;
<< countGroups()-1 << "]: " << index);
}
-void Xao::checkFieldIndex(const int& index) const
-throw(XAO_Exception)
+void Xao::checkFieldIndex(int index) const
{
if (index >= 0 && index < countFields())
return;
<< countFields()-1 << "]: " << index);
}
-void Xao::checkGroupDimension(const XAO::Dimension& dim) const
-throw(XAO_Exception)
+void Xao::checkGroupDimension(XAO::Dimension dim) const
{
if (dim == XAO::WHOLE)
throw XAO_Exception(MsgBuilder() << "Invalid dimension for group: " << dim);
* Sets the geometry.
* \param geometry the geometry to set.
*/
- void setGeometry(Geometry* geometry) throw (XAO_Exception)
+ void setGeometry(Geometry* geometry)
{
if (m_geometry != NULL)
throw XAO_Exception("Geometry already set.");
* Gets the number of groups.
* \return the number of groups.
*/
- const int countGroups() const;
+ int countGroups() const;
/**
* Gets a group.
* \param index the index of the wanted group.
* \return the group.
*/
- Group* getGroup(const int& index) throw (XAO_Exception);
+ Group* getGroup(int index) ;
/**
* Adds a group.
* \param dim the dimension of the group.
* \param name the name of the group.
* \return the created group.
*/
- Group* addGroup(const XAO::Dimension& dim, const std::string& name = std::string("")) throw (XAO_Exception);
+ Group* addGroup(XAO::Dimension dim, const std::string& name = std::string("")) ;
/**
* Removes a group.
* \param group the group to remove.
* Gets the number of fields.
* \return the number of fields.
*/
- const int countFields() const;
+ int countFields() const;
/**
* Gets the type of a field.
* \param index the index of the wanted field.
* \return the type of the field.
*/
- const XAO::Type getFieldType(const int& index) throw (XAO_Exception);
+ XAO::Type getFieldType(int index) ;
/**
* Gets a field.
* \param index the index of the wanted field.
* \return the field.
*/
- Field* getField(const int& index) throw (XAO_Exception);
+ Field* getField(int index) ;
- BooleanField* getBooleanField(const int& index) throw (XAO_Exception);
- DoubleField* getDoubleField(const int& index) throw (XAO_Exception);
- IntegerField* getIntegerField(const int& index) throw (XAO_Exception);
- StringField* getStringField(const int& index) throw (XAO_Exception);
+ BooleanField* getBooleanField(int index) ;
+ DoubleField* getDoubleField(int index) ;
+ IntegerField* getIntegerField(int index) ;
+ StringField* getStringField(int index) ;
/**
* Adds a field.
* \param name the name of the field.
* \return the created field.
*/
- Field* addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents,
+ Field* addField(XAO::Type type, XAO::Dimension dim, int nbComponents,
const std::string& name = std::string(""))
- throw (XAO_Exception);
+ ;
- BooleanField* addBooleanField(const XAO::Dimension& dim, const int& nbComponents,
- const std::string& name = std::string("")) throw (XAO_Exception);
- IntegerField* addIntegerField(const XAO::Dimension& dim, const int& nbComponents,
- const std::string& name = std::string("")) throw (XAO_Exception);
- DoubleField* addDoubleField(const XAO::Dimension& dim, const int& nbComponents,
- const std::string& name = std::string("")) throw (XAO_Exception);
- StringField* addStringField(const XAO::Dimension& dim, const int& nbComponents,
- const std::string& name = std::string("")) throw (XAO_Exception);
+ 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("")) ;
/**
* Removes a field.
* \param shapeFileName if not empty, export the shape to this external file.
* \return true is the export is successful.
*/
- const bool exportXAO(const std::string& fileName, const std::string& shapeFileName);
+ bool exportXAO(const std::string& fileName, const std::string& shapeFileName);
/**
* Gets the XML corresponding to this XAO.
* \return the XML as a string.
* \param fileName the name of the file to import.
* \return true if the import is successful.
*/
- const bool importXAO(const std::string& fileName);
+ bool importXAO(const std::string& fileName);
/**
* Sets an XML describing an XAO format to this object.
* \param xml the XML to set.
* \return true if the import is successful.
*/
- const bool setXML(const std::string& xml);
+ bool setXML(const std::string& xml);
private:
- void checkGeometry() const throw (XAO_Exception);
- void checkGroupIndex(const int& index) const throw (XAO_Exception);
- void checkFieldIndex(const int& index) const throw (XAO_Exception);
- void checkGroupDimension(const XAO::Dimension& dim) const throw (XAO_Exception);
+ void checkGeometry() const ;
+ void checkGroupIndex(int index) const ;
+ void checkFieldIndex(int index) const ;
+ void checkGroupDimension(XAO::Dimension dim) const ;
private:
/** The author of the file. */
void parseStepElementNode(xmlNodePtr eltNode, Step* step);
std::string readStringProp(xmlNodePtr node, const xmlChar* attribute,
- const bool& required, const std::string& defaultValue,
+ bool required, const std::string& defaultValue,
const std::string& exception = std::string(""));
int readIntegerProp(xmlNodePtr node, const xmlChar* attribute,
- const bool& required, const int& defaultValue,
+ bool required, int defaultValue,
const std::string& exception = std::string(""));
std::string readStringProp(xmlNodePtr node, const xmlChar* attribute,
- const bool& required, const std::string& defaultValue,
+ bool required, const std::string& defaultValue,
const std::string& exception /*= std::string() */)
{
xmlChar* strAttr = xmlGetProp(node, attribute);
}
int readIntegerProp(xmlNodePtr node, const xmlChar* attribute,
- const bool& required, const int& defaultValue,
+ bool required, int defaultValue,
const std::string& exception /*= std::string() */)
{
xmlChar* strAttr = xmlGetProp(node, attribute);
{
// export the shape in the XAO file
std::string txtShape = xaoGeometry->getShapeString();
- xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), (int)txtShape.size());
+ xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), txtShape.size());
xmlAddChild(shape, cdata);
}
else
}
}
-const bool XaoExporter::saveToFile(Xao* xaoObject, const std::string& fileName, const std::string& shapeFileName)
-throw (XAO_Exception)
+bool XaoExporter::saveToFile(Xao* xaoObject, const std::string& fileName, const std::string& shapeFileName)
+
{
xmlDocPtr doc = exportXMLDoc(xaoObject, shapeFileName);
xmlSaveFormatFileEnc(fileName.c_str(), doc, "UTF-8", 1); // format = 1 for node indentation
}
const std::string XaoExporter::saveToXml(Xao* xaoObject)
-throw (XAO_Exception)
+
{
xmlDocPtr doc = exportXMLDoc(xaoObject, "");
return (char*)xmlbuff;
}
-const bool XaoExporter::readFromFile(const std::string& fileName, Xao* xaoObject)
-throw (XAO_Exception)
+bool XaoExporter::readFromFile(const std::string& fileName, Xao* xaoObject)
+
{
// parse the file and get the DOM
int options = XML_PARSE_HUGE | XML_PARSE_NOCDATA;
return true;
}
-const bool XaoExporter::setXML(const std::string& xml, Xao* xaoObject)
-throw (XAO_Exception)
+bool XaoExporter::setXML(const std::string& xml, Xao* xaoObject)
+
{
int options = XML_PARSE_HUGE | XML_PARSE_NOCDATA;
xmlDocPtr doc = xmlReadDoc(BAD_CAST xml.c_str(), "", NULL, options);
* @param shapeFileName if not empty save the shape in an this external file.
* @return true if the export was successful, false otherwise.
*/
- static const bool saveToFile(Xao* xaoObject, const std::string& fileName, const std::string& shapeFileName)
- throw (XAO_Exception);
+ static bool saveToFile(Xao* xaoObject, const std::string& fileName, const std::string& shapeFileName)
+ ;
/**
* Saves the XAO object to a XML string.
* @return the XML string.
*/
static const std::string saveToXml(Xao* xaoObject)
- throw (XAO_Exception);
+ ;
/**
* Reads a XAO object from a file.
* @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)
- throw (XAO_Exception);
+ static bool readFromFile(const std::string& fileName, Xao* xaoObject)
+ ;
/**
* Reads a XAO object from an 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)
- throw (XAO_Exception);
+ static bool setXML(const std::string& xml, Xao* xaoObject)
+ ;
};
}
using namespace XAO;
-const std::string XaoUtils::intToString(const int& value)
+std::string XaoUtils::intToString(int value)
{
std::ostringstream str;
str << value;
return str.str();
}
-const int XaoUtils::stringToInt(const std::string& value)
-throw(XAO_Exception)
+int XaoUtils::stringToInt(const std::string& value)
{
int res;
std::istringstream convert(value);
return res;
}
-const std::string XaoUtils::doubleToString(const double& value)
+std::string XaoUtils::doubleToString(double value)
{
std::ostringstream str;
str << value;
return str.str();
}
-const double XaoUtils::stringToDouble(const std::string& value)
-throw(XAO_Exception)
+double XaoUtils::stringToDouble(const std::string& value)
{
double res;
std::istringstream convert(value);
return res;
}
-const std::string XaoUtils::booleanToString(const bool& value)
+std::string XaoUtils::booleanToString(bool value)
{
- if (value)
- return "true";
- return "false";
+ return value ? "true" : "false";
}
-const bool XaoUtils::stringToBoolean(const std::string& value)
-throw(XAO_Exception)
+bool XaoUtils::stringToBoolean(const std::string& value)
{
if (value == "true" || value == "1")
return true;
throw XAO_Exception(MsgBuilder() << "Invalid boolean value: " << value);
}
-const std::string XaoUtils::dimensionToString(const XAO::Dimension& dimension)
-throw(XAO_Exception)
+std::string XaoUtils::dimensionToString(XAO::Dimension dimension)
{
if (dimension == XAO::VERTEX)
return "vertex";
throw XAO_Exception(MsgBuilder() << "Bad dimension: " << dimension);
}
-const XAO::Dimension XaoUtils::stringToDimension(const std::string& dimension)
-throw(XAO_Exception)
+XAO::Dimension XaoUtils::stringToDimension(const std::string& dimension)
{
if (dimension == "vertex")
return XAO::VERTEX;
throw XAO_Exception(MsgBuilder() << "Bad dimension: " << dimension);
}
-const std::string XaoUtils::fieldTypeToString(const XAO::Type& type)
-throw(XAO_Exception)
+std::string XaoUtils::fieldTypeToString(XAO::Type type)
{
if (type ==XAO:: BOOLEAN)
return "boolean";
throw XAO_Exception(MsgBuilder() << "Bad type: " << type);
}
-const XAO::Type XaoUtils::stringToFieldType(const std::string& type)
-throw(XAO_Exception)
+XAO::Type XaoUtils::stringToFieldType(const std::string& type)
{
if (type == "boolean")
return XAO::BOOLEAN;
throw XAO_Exception(MsgBuilder() << "Bad type: " << type);
}
-const std::string XaoUtils::shapeFormatToString(const XAO::Format& format)
-throw(XAO_Exception)
+std::string XaoUtils::shapeFormatToString(XAO::Format format)
{
if (format == XAO::BREP)
return "BREP";
throw XAO_Exception(MsgBuilder() << "Bad format: " << format);
}
-const XAO::Format XaoUtils::stringToShapeFormat(const std::string& format)
-throw(XAO_Exception)
+XAO::Format XaoUtils::stringToShapeFormat(const std::string& format)
{
if (format == "BREP")
return XAO::BREP;
* \param value the integer to convert.
* \return the string.
*/
- static const std::string intToString(const int& value);
+ static std::string intToString(int value);
/**
* Converts a string into an integer.
* \return the integer value.
* \throw XAO_Exception if value cannot be converted to string.
*/
- static const int stringToInt(const std::string& value) throw(XAO_Exception);
+ static int stringToInt(const std::string& value);
/**
* Converts a double into a string.
* \param value the double to convert.
* \return the string.
*/
- static const std::string doubleToString(const double& value);
+ static std::string doubleToString(double value);
/**
* Converts a string into a double.
* \param value the string to convert.
* \return the double value.
* \throw XAO_Exception if value cannot be converted to string.
*/
- static const double stringToDouble(const std::string& value) throw(XAO_Exception);
+ static double stringToDouble(const std::string& value);
/**
* Converts a boolean into a string.
* \param value the boolean to convert.
* \return the string.
*/
- static const std::string booleanToString(const bool& value);
+ static std::string booleanToString(bool value);
/**
* Converts a string into a boolean.
* \param value the string to convert.
* \throw XAO_Exception if value cannot be converted to boolean.
* \note accepted values are "true", "1", "false", "0".
*/
- static const bool stringToBoolean(const std::string& value) throw(XAO_Exception);
+ static bool stringToBoolean(const std::string& value);
/**
* Converts a Dimension to string.
* \return the dimension as a string.
* \throw XAO_Exception
*/
- static const std::string dimensionToString(const XAO::Dimension& dimension) throw(XAO_Exception);
+ static std::string dimensionToString(XAO::Dimension dimension);
/**
* Converts a string into a Dimension.
* \return the converted Dimension.
* \throw XAO_Exception if dimension cannot be converted.
*/
- static const XAO::Dimension stringToDimension(const std::string& dimension) throw(XAO_Exception);
+ static XAO::Dimension stringToDimension(const std::string& dimension);
/**
* Converts a Type to string.
* \return the Type as a string.
* \throw XAO_Exception
*/
- static const std::string fieldTypeToString(const XAO::Type& type) throw(XAO_Exception);
+ static std::string fieldTypeToString(XAO::Type type);
/**
* Converts a string into a Type.
* \return the converted Type.
* \throw XAO_Exception if type cannot be converted.
*/
- static const XAO::Type stringToFieldType(const std::string& type) throw(XAO_Exception);
+ static XAO::Type stringToFieldType(const std::string& type);
/**
* Converts a Format to string.
* \return the Format as a string.
* \throw XAO_Exception
*/
- static const std::string shapeFormatToString(const XAO::Format& format) throw(XAO_Exception);
+ static std::string shapeFormatToString(XAO::Format format);
/**
* Converts a string into a Format.
* \return the converted Format.
* \throw XAO_Exception if format cannot be converted.
*/
- static const XAO::Format stringToShapeFormat(const std::string& format) throw(XAO_Exception);
+ static XAO::Format stringToShapeFormat(const std::string& format);
};
/**