XAO_XaoExporter.cxx
libXAO_la_CPPFLAGS = \
- $(GEOM_CXXFLAGS) \
$(CAS_CPPFLAGS) \
$(LIBXML_INCLUDES) \
-I$(top_builddir) \
libXAO_la_LDFLAGS = \
$(CAS_LDPATH) \
$(LIBXML_LIBS) \
- $(KERNEL_LDFLAGS) \
- $(GEOM_LDFLAGS) \
- -lOpUtil -lTKBRep -lTKTopAlgo -lxml2
+ -lTKBRep -lTKTopAlgo -lxml2
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_BooleanField.hxx"
#include "XAO_BooleanStep.hxx"
#include "XAO_XaoUtils.hxx"
}
Step* BooleanField::addNewStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
BooleanStep* BooleanField::addStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
BooleanStep* BooleanField::addStep(const int& step, const int& stamp)
+throw (XAO_Exception)
{
if (hasStep(step))
- throw SALOME_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
+ throw XAO_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
BooleanStep* bstep = new BooleanStep(step, stamp, m_nbElements, m_nbComponents);
m_steps.push_back(bstep);
}
BooleanStep* BooleanField::getStep(const int& index)
+throw (XAO_Exception)
{
checkStepIndex(index);
return (BooleanStep*)m_steps[index];
virtual const XAO::Type getType() { return XAO::BOOLEAN; }
- virtual Step* addNewStep(const int& step);
+ virtual Step* addNewStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- BooleanStep* addStep(const int& step);
+ BooleanStep* addStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- BooleanStep* addStep(const int& step, const int& stamp);
+ BooleanStep* addStep(const int& step, const int& stamp)
+ throw (XAO_Exception);
/**
* Gets the step of given index.
* @param index the index.
* @return the step for the given index.
*/
- BooleanStep* getStep(const int& index);
+ BooleanStep* getStep(const int& index) throw (XAO_Exception);
};
}
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_BooleanStep.hxx"
#include "XAO_XaoUtils.hxx"
}
std::vector<bool> BooleanStep::getElement(const int& element)
+throw (XAO_Exception)
{
checkElementIndex(element);
}
std::vector<bool> BooleanStep::getComponent(const int& component)
+throw (XAO_Exception)
{
checkComponentIndex(component);
}
const bool BooleanStep::getValue(const int& element, const int& component)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
const std::string BooleanStep::getStringValue(const int& element, const int& component)
+throw (XAO_Exception)
{
return XaoUtils::booleanToString(getValue(element, component));
}
void BooleanStep::setValues(const std::vector<bool>& values)
+throw (XAO_Exception)
{
checkNbValues((int)values.size());
}
void BooleanStep::setElements(const int& element, const std::vector<bool>& elements)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkNbComponents(elements.size());
}
void BooleanStep::setComponents(const int& component, const std::vector<bool>& components)
+throw (XAO_Exception)
{
checkComponentIndex(component);
checkNbElements(components.size());
}
void BooleanStep::setValue(const int& element, const int& component, const bool& value)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
void BooleanStep::setStringValue(const int& element, const int& component, const std::string& value)
+throw (XAO_Exception)
{
setValue(element, component, XaoUtils::stringToBoolean(value));
}
* @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);
+ std::vector<bool> getElement(const int& element) throw (XAO_Exception);
/**
* 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);
+ std::vector<bool> getComponent(const int& component) throw (XAO_Exception);
/**
* 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);
+ const bool getValue(const int& element, const int& component) throw (XAO_Exception);
/**
* Sets all the values from a list.
* @param values the list of values to set.
*/
- void setValues(const std::vector<bool>& values);
+ void setValues(const std::vector<bool>& values) throw (XAO_Exception);
/**
* Sets the values for an element.
* @param element the index of the element to set.
* @param elements the values to set.
*/
- void setElements(const int& element, const std::vector<bool>& elements);
+ void setElements(const int& element, const std::vector<bool>& elements) throw (XAO_Exception);
/**
* Sets the values for a component.
* @param component the index of the component to set.
* @param components the values to set.
*/
- void setComponents(const int& component, const std::vector<bool>& components);
+ void setComponents(const int& component, const std::vector<bool>& components) throw (XAO_Exception);
/**
* 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);
+ void setValue(const int& element, const int& component, const bool& value) throw (XAO_Exception);
- virtual const std::string getStringValue(const int& element, const int& component);
- virtual void setStringValue(const int& element, const 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);
private:
std::vector< std::vector<bool> > m_values;
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_BrepGeometry.hxx"
#include "XAO_XaoUtils.hxx"
}
TopoDS_Shape BrepGeometry::getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex)
+throw (XAO_Exception)
{
TopTools_MapOfShape mapShape;
TopTools_ListOfShape listShape;
}
}
- throw SALOME_Exception(MsgBuilder() << "Shape with reference [" << shapeIndex << "] not found.");
+ throw XAO_Exception(MsgBuilder() << "Shape with reference [" << shapeIndex << "] not found.");
}
// -----------------------------
}
void BrepGeometry::getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord)
+throw (XAO_Exception)
{
xCoord = 0.;
yCoord = 0.;
TopoDS_Shape vertex = getSubShape(m_shape, TopAbs_VERTEX, vertexIndex);
if (vertex.ShapeType() != TopAbs_VERTEX)
- throw SALOME_Exception(MsgBuilder() << "Shape " << vertexIndex<< " is not a point.");
+ throw XAO_Exception(MsgBuilder() << "Shape " << vertexIndex<< " is not a point.");
TopoDS_Vertex point = TopoDS::Vertex(vertex);
if (!point.IsNull())
// -----------------------------
const int BrepGeometry::findElement(const XAO::Dimension& dim, const int& id)
+throw (XAO_Exception)
{
if (dim == XAO::VERTEX)
return findVertex(id);
if (dim == XAO::SOLID)
return findSolid(id);
- throw SALOME_Exception(MsgBuilder() << "Unknown Dimension: " << dim);
+ throw XAO_Exception(MsgBuilder() << "Unknown Dimension: " << dim);
}
const int BrepGeometry::findVertex(const int& id)
// -----------------------------
void BrepGeometry::changeVertexName(const int& id, const std::string& name)
+throw (XAO_Exception)
{
setVertexName(findVertex(id), name);
}
void BrepGeometry::changeEdgeName(const int& id, const std::string& name)
+throw (XAO_Exception)
{
setEdgeName(findEdge(id), name);
}
void BrepGeometry::changeFaceName(const int& id, const std::string& name)
+throw (XAO_Exception)
{
setFaceName(findFace(id), name);
}
void BrepGeometry::changeSolidName(const int& id, const std::string& name)
+throw (XAO_Exception)
{
setSolidName(findSolid(id), name);
}
* @param yCoord the Y coordinate.
* @param zCoord the Z coordinate.
*/
- void getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord);
+ void getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord)
+ throw (XAO_Exception);
/**
* Gets the length of an edge.
* @param id the ID of the vertex.
* @param name the name to set.
*/
- void changeVertexName(const int& id, const std::string& name);
+ void changeVertexName(const int& id, const std::string& name) throw (XAO_Exception);
/**
* 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);
+ void changeEdgeName(const int& id, const std::string& name) throw (XAO_Exception);
/**
* 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);
+ void changeFaceName(const int& id, const std::string& name) throw (XAO_Exception);
/**
* 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);
+ void changeSolidName(const int& id, const std::string& name) throw (XAO_Exception);
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);
+ 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);
+ const int findElement(const XAO::Dimension& dim, const int& id)
+ throw (XAO_Exception);
private:
TopoDS_Shape m_shape;
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_DoubleField.hxx"
#include "XAO_DoubleStep.hxx"
#include "XAO_XaoUtils.hxx"
}
Step* DoubleField::addNewStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
DoubleStep* DoubleField::addStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
DoubleStep* DoubleField::addStep(const int& step, const int& stamp)
+throw (XAO_Exception)
{
if (hasStep(step))
- throw SALOME_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
+ throw XAO_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
DoubleStep* bstep = new DoubleStep(step, stamp, m_nbElements, m_nbComponents);
m_steps.push_back(bstep);
}
DoubleStep* DoubleField::getStep(const int& index)
+throw (XAO_Exception)
{
checkStepIndex(index);
return (DoubleStep*)m_steps[index];
virtual const XAO::Type getType() { return XAO::DOUBLE; }
- virtual Step* addNewStep(const int& step);
+ virtual Step* addNewStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- DoubleStep* addStep(const int& step);
+ DoubleStep* addStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- DoubleStep* addStep(const int& step, const int& stamp);
+ DoubleStep* addStep(const int& step, const int& stamp) throw (XAO_Exception);
/**
* Gets the step of given index.
* @param index the index.
* @return the step for the given index.
*/
- DoubleStep* getStep(const int& index);
+ DoubleStep* getStep(const int& index) throw (XAO_Exception);
};
}
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_DoubleStep.hxx"
#include "XAO_XaoUtils.hxx"
}
std::vector<double> DoubleStep::getElement(const int& element)
+throw (XAO_Exception)
{
checkElementIndex(element);
}
std::vector<double> DoubleStep::getComponent(const int& component)
+throw (XAO_Exception)
{
checkComponentIndex(component);
}
const double DoubleStep::getValue(const int& element, const int& component)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
const std::string DoubleStep::getStringValue(const int& element, const int& component)
+throw (XAO_Exception)
{
return XaoUtils::doubleToString(getValue(element, component));
}
void DoubleStep::setValues(const std::vector<double>& values)
+throw (XAO_Exception)
{
checkNbValues(values.size());
}
void DoubleStep::setElements(const int& element, const std::vector<double>& elements)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkNbComponents(elements.size());
}
void DoubleStep::setComponents(const int& component, const std::vector<double>& components)
+throw (XAO_Exception)
{
checkElementIndex(component);
checkNbElements(components.size());
}
void DoubleStep::setValue(const int& element, const int& component, const double& value)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
void DoubleStep::setStringValue(const int& element, const int& component, const std::string& value)
+throw (XAO_Exception)
{
setValue(element, component, XaoUtils::stringToDouble(value));
}
* @param element the index of the element.
* @return a vector containing all the values for the given element.
*/
- std::vector<double> getElement(const int& element);
+ std::vector<double> getElement(const int& element) throw (XAO_Exception);
/**
* Gets all the values for a given component.
* @param component the index of the component.
* @return a vector containing all the values for the given component.
*/
- std::vector<double> getComponent(const int& component);
+ std::vector<double> getComponent(const int& component) throw (XAO_Exception);
/**
* 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);
+ const double getValue(const int& element, const int& component) throw (XAO_Exception);
/**
* Sets all the values from a list.
* @param values the list of values to set.
*/
- void setValues(const std::vector<double>& values);
+ void setValues(const std::vector<double>& values) throw (XAO_Exception);
/**
* Sets the values for an element.
* @param element the index of the element to set.
* @param elements the values to set.
*/
- void setElements(const int& element, const std::vector<double>& elements);
+ void setElements(const int& element, const std::vector<double>& elements) throw (XAO_Exception);
/**
* Sets the values for a component.
* @param component the index of the component to set.
* @param components the values to set.
*/
- void setComponents(const int& component, const std::vector<double>& components);
+ void setComponents(const int& component, const std::vector<double>& components) throw (XAO_Exception);
/**
* 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);
+ void setValue(const int& element, const int& component, const double& value) throw (XAO_Exception);
- virtual const std::string getStringValue(const int& element, const int& component);
- virtual void setStringValue(const int& element, const 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);
private:
std::vector< std::vector<double> > m_values;
--- /dev/null
+/*
+ * XAO_Exception.hxx
+ *
+ * Created on: 12 sept. 2013
+ * Author: salome
+ */
+
+#ifndef __XAO_EXCEPTION_HXX__
+#define __XAO_EXCEPTION_HXX__
+
+namespace XAO
+{
+
+ class XAO_Exception : public std::exception
+ {
+ public:
+ XAO_Exception(const char* message) : m_message(message)
+ {
+ }
+
+ virtual const char* what() const throw () { return m_message; }
+
+ private:
+ const char* m_message;
+ };
+}
+
+#endif /* __XAO_EXCEPTION_HXX__ */
#include <string>
#include <iostream>
-#include <Utils_SALOME_Exception.hxx>
#include "XAO_Xao.hxx"
#include "XAO_Field.hxx"
Field* Field::createField(const XAO::Type& type, const XAO::Dimension& dimension,
const int& nbElements, const int& nbComponents)
+throw (XAO_Exception)
{
return createField(type, "", dimension, nbElements, nbComponents);
}
Field* Field::createField(const XAO::Type& type, const std::string& name, const XAO::Dimension& dimension,
const int& nbElements, const int& nbComponents)
+throw (XAO_Exception)
{
if (type == XAO::BOOLEAN)
return new BooleanField(name, dimension, nbElements, nbComponents);
if (type == XAO::STRING)
return new StringField(name, dimension, nbElements, nbComponents);
- throw SALOME_Exception(MsgBuilder() << "Bad Type: " << type);
+ throw XAO_Exception(MsgBuilder() << "Bad Type: " << type);
}
const std::string Field::getComponentName(const int& index)
+throw (XAO_Exception)
{
checkComponent(index);
return m_components[index];
}
void Field::setComponentName(const int& index, const std::string& name)
+throw (XAO_Exception)
{
checkComponent(index);
m_components[index] = name;
}
void Field::checkComponent(const int& component)
+throw (XAO_Exception)
{
if (component < m_nbComponents && component >= 0)
return;
- throw SALOME_Exception(MsgBuilder() << "Step index is out of range [0, "
- << m_nbComponents << "]: " << component);
+ throw XAO_Exception(MsgBuilder() << "Step index is out of range [0, "
+ << m_nbComponents << "]: " << component);
}
void Field::checkStepIndex(const int& step)
+throw (XAO_Exception)
{
if (step < m_steps.size() && step >= 0)
return;
- throw SALOME_Exception(MsgBuilder() << "Step index is out of range [0, "
- << m_steps.size() << "]: " << step);
+ throw XAO_Exception(MsgBuilder() << "Step index is out of range [0, "
+ << m_steps.size() << "]: " << step);
}
* @return the created field.
*/
static Field* createField(const XAO::Type& type, const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents);
+ const int& nbElements, const int& nbComponents)
+ throw (XAO_Exception);
/**
/**
* @return the created field.
*/
static Field* createField(const XAO::Type& type, const std::string& name, const XAO::Dimension& dimension,
- const int& nbElements, const int& nbComponents);
+ const int& nbElements, const int& nbComponents)
+ throw (XAO_Exception);
/**
* Destructor.
* @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);
+ const std::string getComponentName(const int& index) throw (XAO_Exception);
/**
* 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);
+ void setComponentName(const int& componentIndex, const std::string& name) throw (XAO_Exception);
/**
* Adds a new step of the same type than the field.
stepIterator end() { return m_steps.end(); }
protected:
- /** Ensures that component is valid (< m_nbComponents). */
- void checkComponent(const int& component);
- void checkStepIndex(const int& step);
+ void checkComponent(const int& component) throw (XAO_Exception);
+ void checkStepIndex(const int& step) throw (XAO_Exception);
protected:
/** The name of the Field. */
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_GeometricElement.hxx"
#include "XAO_XaoUtils.hxx"
}
void GeometricElementList::checkElementIndex(const int& index) const
+throw (XAO_Exception)
{
if (m_count >= 0 && index < m_count)
return;
- throw SALOME_Exception(MsgBuilder() << "Index of element is out of range [0, " << m_count<< "]: " << index);
+ throw XAO_Exception(MsgBuilder() << "Index of element is out of range [0, " << m_count<< "]: " << index);
}
void GeometricElementList::setElement(const int& index, const std::string& name, const std::string& reference)
+throw (XAO_Exception)
{
checkElementIndex(index);
m_elements[index].setName(name);
}
const std::string GeometricElementList::getName(const int& index)
+throw (XAO_Exception)
{
checkElementIndex(index);
return m_elements[index].getName();
}
void GeometricElementList::setName(const int& index, const std::string& name)
+throw (XAO_Exception)
{
checkElementIndex(index);
m_elements[index].setName(name);
}
const bool GeometricElementList::hasName(const int& index)
+throw (XAO_Exception)
{
checkElementIndex(index);
return m_elements[index].hasName();
}
const std::string GeometricElementList::getReference(const int& index)
+throw (XAO_Exception)
{
checkElementIndex(index);
return m_elements[index].getReference();
}
void GeometricElementList::setReference(const int& index, const std::string& name)
+throw (XAO_Exception)
{
checkElementIndex(index);
m_elements[index].setReference(name);
}
const int GeometricElementList::getIndexByReference(const std::string& ref)
+throw (XAO_Exception)
{
for (int index = 0; index < m_count; ++index)
{
return index;
}
- throw SALOME_Exception(MsgBuilder() << "Reference not found: " << ref);
+ throw XAO_Exception(MsgBuilder() << "Reference not found: " << ref);
}
#include <string>
#include <map>
+#include "XAO_Exception.hxx"
namespace XAO
{
* \param index the index of the element to set.
* \param name the name to set.
* \param reference the reference to set.
- * \throw SALOME_Exception if index is bigger than the size of the list.
+ * \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);
+ void setElement(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception);
/**
* 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 SALOME_Exception if index is bigger than the size of the list.
+ * \throw XAO_Exception if index is bigger than the size of the list.
*/
- const std::string getName(const int& index);
+ const std::string getName(const int& index) throw (XAO_Exception);
/**
* Sets the name of an element.
* \param index the index of the element.
* \param name the name to set.
- * \throw SALOME_Exception if index is bigger than the size of the list.
+ * \throw XAO_Exception if index is bigger than the size of the list.
*/
- void setName(const int& index, const std::string& name);
+ void setName(const int& index, const std::string& name) throw (XAO_Exception);
/**
* 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);
+ const bool hasName(const int& index) throw (XAO_Exception);
/**
* Gets the reference of an element.
* \param index the index of the element.
* \return the reference of the element.
- * \throw SALOME_Exception if index is bigger than the size of the list.
+ * \throw XAO_Exception if index is bigger than the size of the list.
*/
- const std::string getReference(const int& index);
+ const std::string getReference(const int& index) throw (XAO_Exception);
/**
* Sets the reference of an element.
* \param index the index of the element to set.
* \param reference the reference to set.
- * \throw SALOME_Exception if index is bigger than the size of the list.
+ * \throw XAO_Exception if index is bigger than the size of the list.
*/
- void setReference(const int& index, const std::string& reference);
+ void setReference(const int& index, const std::string& reference) throw (XAO_Exception);
/**
* 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);
+ const int getIndexByReference(const std::string& reference) throw (XAO_Exception);
/**
* Iterator on the element of the list.
iterator end() { return m_elements.end(); }
private:
- void checkElementIndex(const int& index) const;
+ void checkElementIndex(const int& index) const throw (XAO_Exception);
private:
int m_count;
//
// Author : Nathalie Gore (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_XaoUtils.hxx"
#include "XAO_Geometry.hxx"
#include "XAO_BrepGeometry.hxx"
}
Geometry* Geometry::createGeometry(const XAO::Format& format)
+throw (XAO_Exception)
{
return createGeometry(format, "");
}
Geometry* Geometry::createGeometry(const XAO::Format& format, const std::string& name)
+throw (XAO_Exception)
{
if (format == XAO::BREP)
return new BrepGeometry(name);
- throw SALOME_Exception(MsgBuilder() << "Geometry format not supported: " << format);
+ throw XAO_Exception(MsgBuilder() << "Geometry format not supported: " << format);
}
Geometry::~Geometry()
{
}
-const int Geometry::countElements(const XAO::Dimension& dim)
+const int Geometry::countElements(const XAO::Dimension& dim) const
+throw (XAO_Exception)
{
if (dim == XAO::VERTEX)
return countVertices();
if (dim == XAO::SOLID)
return countSolids();
- throw SALOME_Exception(MsgBuilder() << "Unknown dimension:" << dim);
+ throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
const std::string Geometry::getElementReference(const XAO::Dimension& dim, const int& index)
+throw (XAO_Exception)
{
if (dim == XAO::VERTEX)
return getVertexReference(index);
if (dim == XAO::SOLID)
return getSolidReference(index);
- throw SALOME_Exception(MsgBuilder() << "Unknown dimension:" << dim);
+ throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
const int Geometry::getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference)
+throw (XAO_Exception)
{
if (dim == XAO::VERTEX)
return getVertexIndexByReference(reference);
if (dim == XAO::SOLID)
return getSolidIndexByReference(reference);
- throw SALOME_Exception(MsgBuilder() << "Unknown dimension:" << dim);
+ throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
GeometricElementList::iterator Geometry::begin(const XAO::Dimension& dim)
+throw (XAO_Exception)
{
if (dim == XAO::VERTEX)
return m_vertices.begin();
if (dim == XAO::SOLID)
return m_solids.begin();
- throw SALOME_Exception(MsgBuilder() << "Unknown dimension:" << dim);
+ throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
GeometricElementList::iterator Geometry::end(const XAO::Dimension& dim)
+throw (XAO_Exception)
{
if (dim == XAO::VERTEX)
return m_vertices.end();
if (dim == XAO::SOLID)
return m_solids.end();
- throw SALOME_Exception(MsgBuilder() << "Unknown dimension:" << dim);
+ throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim);
}
* @param format the format of the geometry.
* @return the created geometry.
*/
- static Geometry* createGeometry(const XAO::Format& format);
+ static Geometry* createGeometry(const XAO::Format& format) throw (XAO_Exception);
/**
* Constructor.
* @name name the name of the geometry.
* @return the created geometry.
*/
- static Geometry* createGeometry(const XAO::Format& format, const std::string& name);
+ static Geometry* createGeometry(const XAO::Format& format, const std::string& name)
+ throw (XAO_Exception);
/** Destructor. */
~Geometry();
virtual const std::string getShape() = 0;
virtual void setShape(const std::string& shape) = 0;
- const int countElements(const XAO::Dimension& dim);
- const int countVertices() { return m_vertices.getSize(); }
- const int countEdges() { return m_edges.getSize(); }
- const int countFaces() { return m_faces.getSize(); }
- const int countSolids() { return m_solids.getSize(); }
+ 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) { m_vertices.setSize(nb); }
void setCountEdges(const int& nb) { m_edges.setSize(nb); }
void setCountFaces(const int& nb) { m_faces.setSize(nb); }
void setCountSolids(const int& nb) { m_solids.setSize(nb); }
- const std::string getVertexName(const int& index) { return m_vertices.getName(index); }
- const std::string getEdgeName(const int& index) { return m_edges.getName(index); }
- const std::string getFaceName(const int& index) { return m_faces.getName(index); }
- const std::string getSolidName(const int& index) { return m_solids.getName(index); }
+ 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) { m_vertices.setName(index, name); }
- void setEdgeName(const int& index, const std::string& name) { m_edges.setName(index, name); }
- void setFaceName(const int& index, const std::string& name) { m_faces.setName(index, name); }
- void setSolidName(const int& index, const std::string& name) { m_solids.setName(index, name); }
+ 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) { return m_vertices.hasName(index); }
- const bool hasEdgeName(const int& index) { return m_edges.hasName(index); }
- const bool hasFaceName(const int& index) { return m_faces.hasName(index); }
- const bool hasSolidName(const int& index) { return m_solids.hasName(index); }
+ 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) { return m_vertices.getReference(index); }
const std::string getEdgeReference(const int& index) { return m_edges.getReference(index); }
const std::string getFaceReference(const int& index) { return m_faces.getReference(index); }
const std::string getSolidReference(const int& index) { return m_solids.getReference(index); }
- const std::string getElementReference(const XAO::Dimension& dim, const int& index);
+ const std::string getElementReference(const XAO::Dimension& dim, const int& index) throw (XAO_Exception);
void setVertexReference(const int& index, const std::string& reference) { m_vertices.setReference(index, reference); }
void setEdgeReference(const int& index, const std::string& reference) { m_edges.setReference(index, 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);
+ const int getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference) throw (XAO_Exception);
- GeometricElementList::iterator begin(const XAO::Dimension& dim);
- GeometricElementList::iterator end(const XAO::Dimension& dim);
+ GeometricElementList::iterator begin(const XAO::Dimension& dim) throw (XAO_Exception);
+ GeometricElementList::iterator end(const XAO::Dimension& dim) throw (XAO_Exception);
protected:
std::string m_name;
//
// Author : Nathalie Gore (OpenCascade), Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_XaoUtils.hxx"
#include "XAO_Group.hxx"
Group::Group(const XAO::Dimension& dim, const int& nbElements)
+throw (XAO_Exception)
{
initGroup("", dim, nbElements);
}
Group::Group(const std::string& name, const XAO::Dimension& dim, const int& nbElements)
+throw (XAO_Exception)
{
initGroup(name, dim, nbElements);
}
void Group::initGroup(const std::string& name, const XAO::Dimension& dim, const int& nbElements)
+throw (XAO_Exception)
{
if (dim == XAO::WHOLE)
- throw SALOME_Exception("Dimension WHOLE is not valid for group.");
+ throw XAO_Exception("Dimension WHOLE is not valid for group.");
m_name = name;
m_dimension = dim;
}
void Group::checkIndex(const int& element)
+throw (XAO_Exception)
{
if (element < m_elements.size() && element >= 0)
return;
- throw SALOME_Exception(MsgBuilder() << "Index of element is out of range [0, "
- << m_elements.size()-1 << "]: " << element);
+ throw XAO_Exception(MsgBuilder() << "Index of element is out of range [0, "
+ << m_elements.size()-1 << "]: " << element);
}
void Group::add(const int& value)
* @param dim the dimension of the group.
* @param nbElements the number of geometrical elements for the dimension in the geometry.
*/
- Group(const XAO::Dimension& dim, const int& nbElements);
+ Group(const XAO::Dimension& dim, const int& nbElements) throw (XAO_Exception);
/**
* Constructor.
* @param dim the dimension of the group.
* @param nbElements the number of geometrical elements for the dimension in the geometry.
*/
- Group(const std::string& name, const XAO::Dimension& dim, const int& nbelements);
+ Group(const std::string& name, const XAO::Dimension& dim, const int& nbelements) throw (XAO_Exception);
/**
* Destructor.
* @param dim the dimension of the group.
* @param nbElements the number of elements in the geometry for the dimension.
*/
- void initGroup(const std::string& name, const XAO::Dimension& dim, const int& nbElements);
+ void initGroup(const std::string& name, const XAO::Dimension& dim, const int& nbElements)
+ throw (XAO_Exception);
/**
* Ensures that the given element is valid.
* @param element
- * @throw SALOME_Exception if element is bigger than the number of elements.
+ * @throw XAO_Exception if element is bigger than the number of elements.
*/
- void checkIndex(const int& element);
+ void checkIndex(const int& element)
+ throw (XAO_Exception);
private:
/** The name of the group. */
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_IntegerField.hxx"
#include "XAO_IntegerStep.hxx"
#include "XAO_XaoUtils.hxx"
}
Step* IntegerField::addNewStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
IntegerStep* IntegerField::addStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
IntegerStep* IntegerField::addStep(const int& step, const int& stamp)
+throw (XAO_Exception)
{
if (hasStep(step))
- throw SALOME_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
+ throw XAO_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
IntegerStep* bstep = new IntegerStep(step, stamp, m_nbElements, m_nbComponents);
m_steps.push_back(bstep);
}
IntegerStep* IntegerField::getStep(const int& index)
+throw (XAO_Exception)
{
checkStepIndex(index);
return (IntegerStep*)m_steps[index];
virtual const XAO::Type getType() { return XAO::INTEGER; }
- virtual Step* addNewStep(const int& step);
+ virtual Step* addNewStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- IntegerStep* addStep(const int& step);
+ IntegerStep* addStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- IntegerStep* addStep(const int& step, const int& stamp);
+ IntegerStep* addStep(const int& step, const int& stamp) throw (XAO_Exception);
/**
* 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);
+ IntegerStep* getStep(const int& index) throw (XAO_Exception);
};
}
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_IntegerStep.hxx"
#include "XAO_XaoUtils.hxx"
}
std::vector<int> IntegerStep::getElement(const int& element)
+throw (XAO_Exception)
{
checkElementIndex(element);
}
std::vector<int> IntegerStep::getComponent(const int& component)
+throw (XAO_Exception)
{
checkComponentIndex(component);
}
const int IntegerStep::getValue(const int& element, const int& component)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
const std::string IntegerStep::getStringValue(const int& element, const int& component)
+throw (XAO_Exception)
{
return XaoUtils::intToString(getValue(element, component));
}
void IntegerStep::setValues(const std::vector<int>& values)
+throw (XAO_Exception)
{
checkNbValues(values.size());
}
void IntegerStep::setElements(const int& element, const std::vector<int>& elements)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkNbComponents(elements.size());
}
void IntegerStep::setComponents(const int& component, const std::vector<int>& components)
+throw (XAO_Exception)
{
checkElementIndex(component);
checkNbElements(components.size());
}
void IntegerStep::setValue(const int& element, const int& component, const int& value)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
void IntegerStep::setStringValue(const int& element, const int& component, const std::string& value)
+throw (XAO_Exception)
{
setValue(element, component, XaoUtils::stringToInt(value));
}
* @param element the index of the element.
* @return a vector containing all the values for the given element.
*/
- std::vector<int> getElement(const int& element);
+ std::vector<int> getElement(const int& element) throw (XAO_Exception);
/**
* Gets all the values for a given component.
* @param component the index of the component.
* @return a vector containing all the values for the given component.
*/
- std::vector<int> getComponent(const int& component);
+ std::vector<int> getComponent(const int& component) throw (XAO_Exception);
/**
* 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);
+ const int getValue(const int& element, const int& component) throw (XAO_Exception);
/**
* Sets all the values from a list.
* @param values the list of values to set.
*/
- void setValues(const std::vector<int>& values);
+ void setValues(const std::vector<int>& values) throw (XAO_Exception);
/**
* Sets the values for an element.
* @param element the index of the element to set.
* @param elements the values to set.
*/
- void setElements(const int& element, const std::vector<int>& elements);
+ void setElements(const int& element, const std::vector<int>& elements) throw (XAO_Exception);
/**
* Sets the values for a component.
* @param component the index of the component to set.
* @param components the values to set.
*/
- void setComponents(const int& component, const std::vector<int>& components);
+ void setComponents(const int& component, const std::vector<int>& components) throw (XAO_Exception);
/**
* 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);
+ void setValue(const int& element, const int& component, const int& value) throw (XAO_Exception);
- virtual const std::string getStringValue(const int& element, const int& component);
- virtual void setStringValue(const int& element, const 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);
private:
std::vector< std::vector<int> > m_values;
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_Xao.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Step.hxx"
using namespace XAO;
void Step::checkElementIndex(const int& element)
+throw (XAO_Exception)
{
if (element < m_nbElements && element >= 0)
return;
- throw SALOME_Exception(MsgBuilder() << "Element index is out of range [0, "
+ throw XAO_Exception(MsgBuilder() << "Element index is out of range [0, "
<< m_nbElements-1 << "]: " << element);
}
void Step::checkComponentIndex(const int& component)
+throw (XAO_Exception)
{
if (component < m_nbComponents && component >= 0)
return;
- throw SALOME_Exception(MsgBuilder() << "Component index is out of range [0, "
+ throw XAO_Exception(MsgBuilder() << "Component index is out of range [0, "
<< m_nbComponents-1 << "]: " << component);
}
void Step::checkNbElements(const int& nbElements)
+throw (XAO_Exception)
{
if (nbElements == m_nbElements)
return;
- throw SALOME_Exception(MsgBuilder() << "Invalid number of elements: " << nbElements
+ throw XAO_Exception(MsgBuilder() << "Invalid number of elements: " << nbElements
<< ", expected " << m_nbElements);
}
void Step::checkNbComponents(const int& nbComponents)
+throw (XAO_Exception)
{
if (nbComponents == m_nbComponents)
return;
- throw SALOME_Exception(MsgBuilder() << "Invalid number of components: " << nbComponents
+ throw XAO_Exception(MsgBuilder() << "Invalid number of components: " << nbComponents
<< ", expected " << m_nbComponents);
}
void Step::checkNbValues(const int& nbValues)
+throw (XAO_Exception)
{
if (nbValues == m_nbElements * m_nbComponents)
return;
- throw SALOME_Exception(MsgBuilder() << "Invalid number of values:" << nbValues
+ throw XAO_Exception(MsgBuilder() << "Invalid number of values:" << nbValues
<< ", expected " << m_nbElements * m_nbComponents);
}
* @param element the index of the element.
* @param component the index of the component.
* @param value the string value.
- * @throw SALOME_Exception if the value is not valid.
+ * @throw XAO_Exception if the value is not valid.
*/
virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0;
* Checks that given element index is in the range of element indexes.
* @param element the index to check.
*/
- void checkElementIndex(const int& element);
+ void checkElementIndex(const int& element) throw (XAO_Exception);
/**
* Checks that given component index is in the range of component indexes.
* @param component the index to check.
*/
- void checkComponentIndex(const int& component);
+ void checkComponentIndex(const int& component)throw (XAO_Exception);
/**
* Checks that the given number of elements is correct.
* @param nbElements the number of elements to check.
*/
- void checkNbElements(const int& nbElements);
+ void checkNbElements(const int& nbElements)throw (XAO_Exception);
/**
* Checks that the given number of components is correct.
* @param nbComponents the number of components to check.
*/
- void checkNbComponents(const int& nbComponents);
+ void checkNbComponents(const int& nbComponents)throw (XAO_Exception);
/**
* checks that the given number of values is correct.
* @param nbValues the number of values to check.
*/
- void checkNbValues(const int& nbValues);
+ void checkNbValues(const int& nbValues)throw (XAO_Exception);
protected:
/** the index of the step. */
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_StringField.hxx"
#include "XAO_StringStep.hxx"
#include "XAO_XaoUtils.hxx"
}
Step* StringField::addNewStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
StringStep* StringField::addStep(const int& step)
+throw (XAO_Exception)
{
return addStep(step, 0);
}
StringStep* StringField::addStep(const int& step, const int& stamp)
+throw (XAO_Exception)
{
if (hasStep(step))
- throw SALOME_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
+ throw XAO_Exception(MsgBuilder() << "Step with number " << step << "already exists.");
StringStep* bstep = new StringStep(step, stamp, m_nbElements, m_nbComponents);
m_steps.push_back(bstep);
}
StringStep* StringField::getStep(const int& index)
+throw (XAO_Exception)
{
checkStepIndex(index);
return (StringStep*)m_steps[index];
virtual const XAO::Type getType() { return XAO::STRING; }
- virtual Step* addNewStep(const int& step);
+ virtual Step* addNewStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param step the number of the step.
* @return the newly created step.
*/
- StringStep* addStep(const int& step);
+ StringStep* addStep(const int& step) throw (XAO_Exception);
/**
* Adds a new step.
* @param stamp the stamp of the step.
* @return the newly created step.
*/
- StringStep* addStep(const int& step, const int& stamp);
+ StringStep* addStep(const int& step, const int& stamp) throw (XAO_Exception);
/**
* Gets the step of given index.
* @param index the index of the step.
* @return the step for the given index.
*/
- StringStep* getStep(const int& index);
+ StringStep* getStep(const int& index) throw (XAO_Exception);
};
}
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_StringStep.hxx"
using namespace XAO;
}
std::vector<std::string> StringStep::getElement(const int& element)
+throw (XAO_Exception)
{
checkElementIndex(element);
}
std::vector<std::string> StringStep::getComponent(const int& component)
+throw (XAO_Exception)
{
checkComponentIndex(component);
}
const std::string StringStep::getValue(const int& element, const int& component)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
const std::string StringStep::getStringValue(const int& element, const int& component)
+throw (XAO_Exception)
{
return getValue(element, component);
}
void StringStep::setValues(const std::vector<std::string>& values)
+throw (XAO_Exception)
{
checkNbValues(values.size());
}
void StringStep::setElements(const int& element, const std::vector<std::string>& elements)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkNbComponents(elements.size());
}
void StringStep::setComponents(const int& component, const std::vector<std::string>& components)
+throw (XAO_Exception)
{
checkElementIndex(component);
checkNbElements(components.size());
}
void StringStep::setValue(const int& element, const int& component, const std::string& value)
+throw (XAO_Exception)
{
checkElementIndex(element);
checkComponentIndex(component);
}
void StringStep::setStringValue(const int& element, const int& component, const std::string& value)
+throw (XAO_Exception)
{
setValue(element, component, value);
}
* @param element the index of the element.
* @return a vector containing all the values for the given element.
*/
- std::vector<std::string> getElement(const int& element);
+ std::vector<std::string> getElement(const int& element) throw (XAO_Exception);
/**
* Gets all the values for a given component.
* @param component the index of the component.
* @return a vector containing all the values for the given component.
*/
- std::vector<std::string> getComponent(const int& component);
+ std::vector<std::string> getComponent(const int& component) throw (XAO_Exception);
/**
* 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);
+ const std::string getValue(const int& element, const int& component) throw (XAO_Exception);
/**
* Sets all the values from a list.
* @param values the list of values to set.
*/
- void setValues(const std::vector<std::string>& values);
+ void setValues(const std::vector<std::string>& values) throw (XAO_Exception);
/**
* Sets the values for an element.
* @param element the index of the element to set.
* @param elements the values to set.
*/
- void setElements(const int& element, const std::vector<std::string>& elements);
+ void setElements(const int& element, const std::vector<std::string>& elements) throw (XAO_Exception);
/**
* Sets the values for a component.
* @param component the index of the component to set.
* @param components the values to set.
*/
- void setComponents(const int& component, const std::vector<std::string>& components);
+ void setComponents(const int& component, const std::vector<std::string>& components) throw (XAO_Exception);
/**
* 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);
+ void setValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception);
- virtual const std::string getStringValue(const int& element, const int& component);
- virtual void setStringValue(const int& element, const 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);
private:
std::vector< std::vector<std::string> > m_values;
//
// Author : Nathalie Gore (OpenCascade), Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "XAO_XaoUtils.hxx"
#include "XAO_Xao.hxx"
#include "XAO_Geometry.hxx"
}
Group* Xao::getGroup(const int& index)
+throw (XAO_Exception)
{
checkGroupIndex(index);
}
Group* Xao::addGroup(const XAO::Dimension& dim)
+throw (XAO_Exception)
{
return addGroup("", dim);
}
Group* Xao::addGroup(const std::string& name, const XAO::Dimension& dim)
+throw (XAO_Exception)
{
checkGeometry();
+ checkGroupDimension(dim);
+
Group* group = new Group(name, dim, m_geometry->countElements(dim));
m_groups.push_back(group);
return group;
}
Field* Xao::getField(const int& index)
+throw (XAO_Exception)
{
checkFieldIndex(index);
}
Field* Xao::addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents)
+throw (XAO_Exception)
{
return addField(type, "", dim, nbComponents);
}
Field* Xao::addField(const XAO::Type& type, const std::string& name, const XAO::Dimension& dim, const int& nbComponents)
+throw (XAO_Exception)
{
checkGeometry();
int nbElts = m_geometry->countElements(dim);
}
void Xao::checkGeometry() const
+throw(XAO_Exception)
{
if (m_geometry == NULL)
- throw SALOME_Exception("Geometry is null");
+ throw XAO_Exception("Geometry is null");
}
void Xao::checkGroupIndex(const int& index) const
+throw(XAO_Exception)
{
if (index >= 0 && index < countGroups())
return;
- throw SALOME_Exception(MsgBuilder() << "Group index is out of range [0, "
- << countGroups()-1 << "]: " << index);
+ throw XAO_Exception(MsgBuilder() << "Group index is out of range [0, "
+ << countGroups()-1 << "]: " << index);
}
void Xao::checkFieldIndex(const int& index) const
+throw(XAO_Exception)
{
if (index >= 0 && index < countFields())
return;
- throw SALOME_Exception(MsgBuilder() << "Field index is out of range [0, "
- << countFields()-1 << "]: " << index);
+ throw XAO_Exception(MsgBuilder() << "Field index is out of range [0, "
+ << countFields()-1 << "]: " << index);
+}
+
+void Xao::checkGroupDimension(const XAO::Dimension& dim) const
+throw(XAO_Exception)
+{
+ if (dim == XAO::WHOLE)
+ throw XAO_Exception(MsgBuilder() << "Invalid dimension for group: " << dim);
}
#include <string>
#include <list>
+#include "XAO_Exception.hxx"
namespace XAO
{
/**
* Gets a group.
* \param index the index of the wanted group.
- * \return the group or NULL if index is bigger than the number of groups.
+ * \return the group.
*/
- Group* getGroup(const int& index);
+ Group* getGroup(const int& index) throw (XAO_Exception);
/**
* Adds a group.
* \param dim the dimension of the group.
* \return the created group.
*/
- Group* addGroup(const XAO::Dimension& dim);
+ Group* addGroup(const XAO::Dimension& dim) throw (XAO_Exception);
/**
* Adds a group.
* \param name the name of the group.
* \param dim the dimension of the group.
* \return the created group.
*/
- Group* addGroup(const std::string& name, const XAO::Dimension& dim);
+ Group* addGroup(const std::string& name, const XAO::Dimension& dim) throw (XAO_Exception);
/**
* Removes a group.
* \param group the group to remove.
/**
* Gets a field.
* \param index the index of the wanted field.
- * \return the field or NULL if the index is bigger than the number of fields.
+ * \return the field.
*/
- Field* getField(const int& index);
+ Field* getField(const int& index) throw (XAO_Exception);
/**
* Adds a field.
* \param type the type of the field.
* \param nbComponents the number of components in the field.
* \return the created field.
*/
- Field* addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents);
+ Field* addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents)
+ throw (XAO_Exception);
/**
* Adds a field.
* \param type the type of the field.
* \param nbComponents the number of components in the field.
* \return the created field.
*/
- Field* addField(const XAO::Type& type, const std::string& name, const XAO::Dimension& dim, const int& nbComponents);
+ Field* addField(const XAO::Type& type, const std::string& name, const XAO::Dimension& dim, const int& nbComponents)
+ throw (XAO_Exception);
/**
* Removes a field.
* \param field the field to remove.
const bool setXML(const std::string& xml);
private:
- void checkGeometry() const;
- void checkGroupIndex(const int& index) const;
- void checkFieldIndex(const int& index) const;
+ 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);
private:
/** The author of the file. */
#include <libxml/parser.h>
-#include <Utils_SALOME_Exception.hxx>
#include "XAO_XaoExporter.hxx"
#include "XAO_Xao.hxx"
if (required)
{
if (exception.size() > 0)
- throw SALOME_Exception(exception.c_str());
+ throw XAO_Exception(exception.c_str());
- throw SALOME_Exception(MsgBuilder() << "Line " << node->line << ": "
- << "Property " << (char*)attribute << " is required.");
+ throw XAO_Exception(MsgBuilder() << "Line " << node->line << ": "
+ << "Property " << (char*)attribute << " is required.");
}
return defaultValue;
if (required)
{
if (exception.size() > 0)
- throw SALOME_Exception(exception.c_str());
+ throw XAO_Exception(exception.c_str());
- throw SALOME_Exception(MsgBuilder() << "Line " << node->line << ": "
- << "Property " << (char*)attribute << " is required.");
+ throw XAO_Exception(MsgBuilder() << "Line " << node->line << ": "
+ << "Property " << (char*)attribute << " is required.");
}
return defaultValue;
}
const bool XaoExporter::saveToFile(Xao* xaoObject, const std::string& fileName)
+throw (XAO_Exception)
{
xmlDocPtr doc = exportXMLDoc(xaoObject);
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);
}
const bool XaoExporter::readFromFile(const std::string& fileName, Xao* xaoObject)
+throw (XAO_Exception)
{
// parse the file and get the DOM
int options = XML_PARSE_HUGE || XML_PARSE_NOCDATA;
xmlDocPtr doc = xmlReadFile(fileName.c_str(), NULL, options);
if (doc == NULL)
{
- throw SALOME_Exception("Cannot read XAO file");
+ throw XAO_Exception("Cannot read XAO file");
}
parseXMLDoc(doc, xaoObject);
}
const bool XaoExporter::setXML(const std::string& xml, Xao* xaoObject)
+throw (XAO_Exception)
{
int options = XML_PARSE_HUGE || XML_PARSE_NOCDATA;
xmlDocPtr doc = xmlReadDoc(BAD_CAST xml.c_str(), "", NULL, options);
if (doc == NULL)
{
- throw SALOME_Exception("Cannot read XAO stream");
+ throw XAO_Exception("Cannot read XAO stream");
}
parseXMLDoc(doc, xaoObject);
// Get the root element node
xmlNodePtr root = xmlDocGetRootElement(doc);
if (xmlStrcmp(root->name , C_TAG_XAO) != 0)
- throw SALOME_Exception("Cannot read XAO file: invalid format XAO node not found");
+ throw XAO_Exception("Cannot read XAO file: invalid format XAO node not found");
parseXaoNode(doc, root, xaoObject);
{
xmlChar* data = xmlNodeGetContent(shapeNode->children);
if (data == NULL)
- throw SALOME_Exception("Missing BREP");
+ throw XAO_Exception("Missing BREP");
geometry->setShape((char*)data);
xmlFree(data);
}
else
{
- throw SALOME_Exception(MsgBuilder() << "Shape format not supported: "
- << XaoUtils::shapeFormatToString(geometry->getFormat()));
+ throw XAO_Exception(MsgBuilder() << "Shape format not supported: "
+ << XaoUtils::shapeFormatToString(geometry->getFormat()));
}
}
// ensure that the components node is defined
if (componentsNode == NULL)
{
- throw SALOME_Exception(MsgBuilder() << "Line " << fieldNode->line << ": "
- << "No components defined for field.");
+ throw XAO_Exception(MsgBuilder() << "Line " << fieldNode->line << ": "
+ << "No components defined for field.");
}
// create the field
if (data == NULL)
{
- throw SALOME_Exception(MsgBuilder() << "Line " << valNode->line << ": no content for value.");
+ throw XAO_Exception(MsgBuilder() << "Line " << valNode->line << ": no content for value.");
}
std::string value = (char*)data;
* @param fileName the path of the file to create.
* @return true if the export was successful, false otherwise.
*/
- static const bool saveToFile(Xao* xaoObject, const std::string& fileName);
+ static const bool saveToFile(Xao* xaoObject, const std::string& fileName)
+ throw (XAO_Exception);
/**
* Saves the XAO object to a XML string.
* @param xaoObject the object to export.
* @return the XML string.
*/
- static const std::string saveToXml(Xao* xaoObject);
+ static const std::string saveToXml(Xao* xaoObject)
+ 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);
+ static const bool readFromFile(const std::string& fileName, Xao* xaoObject)
+ throw (XAO_Exception);
/**
* 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);
+ static const bool setXML(const std::string& xml, Xao* xaoObject)
+ throw (XAO_Exception);
private:
static xmlDocPtr exportXMLDoc(Xao* xaoObject);
//
// Author : Frederic Pons (OpenCascade)
-#include <cstring>
#include <sstream>
-#include <iosfwd>
-#include <Utils_SALOME_Exception.hxx>
#include "XAO_Xao.hxx"
#include "XAO_XaoUtils.hxx"
}
const int XaoUtils::stringToInt(const std::string& value)
+throw(XAO_Exception)
{
int res;
std::istringstream convert(value);
if ( !(convert >> res) )
- throw SALOME_Exception(MsgBuilder() << "Cannot convert '" << value << "' to integer.");
+ throw XAO_Exception(MsgBuilder() << "Cannot convert '" << value << "' to integer.");
return res;
}
}
const double XaoUtils::stringToDouble(const std::string& value)
+throw(XAO_Exception)
{
double res;
std::istringstream convert(value);
if ( !(convert >> res) )
- throw SALOME_Exception(MsgBuilder() << "Cannot convert '" << value << "' to double.");
+ throw XAO_Exception(MsgBuilder() << "Cannot convert '" << value << "' to double.");
return res;
}
}
const bool XaoUtils::stringToBoolean(const std::string& value)
+throw(XAO_Exception)
{
if (value == "true" || value == "1")
return true;
if (value == "false" || value == "0")
return false;
- throw SALOME_Exception(MsgBuilder() << "Invalid boolean value: " << value);
+ throw XAO_Exception(MsgBuilder() << "Invalid boolean value: " << value);
}
const std::string XaoUtils::dimensionToString(const XAO::Dimension& dimension)
+throw(XAO_Exception)
{
if (dimension == XAO::VERTEX)
return "vertex";
if (dimension == XAO::WHOLE)
return "whole";
- throw SALOME_Exception(MsgBuilder() << "Bad dimension: " << dimension);
+ throw XAO_Exception(MsgBuilder() << "Bad dimension: " << dimension);
}
const XAO::Dimension XaoUtils::stringToDimension(const std::string& dimension)
+throw(XAO_Exception)
{
if (dimension == "vertex")
return XAO::VERTEX;
if (dimension == "whole")
return XAO::WHOLE;
- throw SALOME_Exception(MsgBuilder() << "Bad dimension: " << dimension);
+ throw XAO_Exception(MsgBuilder() << "Bad dimension: " << dimension);
}
const std::string XaoUtils::fieldTypeToString(const XAO::Type& type)
+throw(XAO_Exception)
{
if (type ==XAO:: BOOLEAN)
return "boolean";
if (type == XAO::STRING)
return "string";
- throw SALOME_Exception(MsgBuilder() << "Bad type: " << type);
+ throw XAO_Exception(MsgBuilder() << "Bad type: " << type);
}
const XAO::Type XaoUtils::stringToFieldType(const std::string& type)
+throw(XAO_Exception)
{
if (type == "boolean")
return XAO::BOOLEAN;
if (type == "string")
return XAO::STRING;
- throw SALOME_Exception(MsgBuilder() << "Bad type: " << type);
+ throw XAO_Exception(MsgBuilder() << "Bad type: " << type);
}
const std::string XaoUtils::shapeFormatToString(const XAO::Format& format)
+throw(XAO_Exception)
{
if (format == XAO::BREP)
return "BREP";
if (format == XAO::STEP)
return "STEP";
- throw SALOME_Exception(MsgBuilder() << "Bad format: " << format);
+ throw XAO_Exception(MsgBuilder() << "Bad format: " << format);
}
const XAO::Format XaoUtils::stringToShapeFormat(const std::string& format)
+throw(XAO_Exception)
{
if (format == "BREP")
return XAO::BREP;
if (format == "STEP")
return XAO::STEP;
- throw SALOME_Exception(MsgBuilder() << "Bad format: " << format);
+ throw XAO_Exception(MsgBuilder() << "Bad format: " << format);
}
#include <sstream>
#include <string>
+#include <exception>
#include "XAO_Xao.hxx"
-#include "XAO_Field.hxx"
+#include "XAO_Exception.hxx"
+
namespace XAO
{
* Converts a string into an integer.
* \param value the string to convert.
* \return the integer value.
+ * \throw XAO_Exception if value cannot be converted to string.
*/
- static const int stringToInt(const std::string& value);
+ static const int stringToInt(const std::string& value) throw(XAO_Exception);
/**
* Converts a double into a string.
- * @param value the double to convert.
- * @return the string.
+ * \param value the double to convert.
+ * \return the string.
*/
static const std::string doubleToString(const double& value);
/**
* Converts a string into a double.
- * @param value the string to convert.
- * @return the double value.
+ * \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);
+ static const double stringToDouble(const std::string& value) throw(XAO_Exception);
/**
* Converts a boolean into a string.
- * @param value the boolean to convert.
- * @return the string.
+ * \param value the boolean to convert.
+ * \return the string.
*/
static const std::string booleanToString(const bool& value);
/**
* Converts a string into a boolean.
- * @param value the string to convert.
- * @return the boolean value.
+ * \param value the string to convert.
+ * \return the boolean value.
+ * \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);
+ static const bool stringToBoolean(const std::string& value) throw(XAO_Exception);
/**
* Converts a Dimension to string.
* \param dimension the Dimension to convert.
* \return the dimension as a string.
- * \throw SALOME_Exception
+ * \throw XAO_Exception
*/
- static const std::string dimensionToString(const XAO::Dimension& dimension);
+ static const std::string dimensionToString(const XAO::Dimension& dimension) throw(XAO_Exception);
/**
* Converts a string into a Dimension.
* \param dimension the dimension as a string.
* \return the converted Dimension.
- * \throw SALOME_Exception
+ * \throw XAO_Exception if dimension cannot be converted.
*/
- static const XAO::Dimension stringToDimension(const std::string& dimension);
+ static const XAO::Dimension stringToDimension(const std::string& dimension) throw(XAO_Exception);
/**
* Converts a Type to string.
* \param type the Type to convert.
* \return the Type as a string.
- * \throw SALOME_Exception
+ * \throw XAO_Exception
*/
- static const std::string fieldTypeToString(const XAO::Type& type);
+ static const std::string fieldTypeToString(const XAO::Type& type) throw(XAO_Exception);
/**
* Converts a string into a Type.
* \param type the Type as a string.
* \return the converted Type.
- * \throw SALOME_Exception
+ * \throw XAO_Exception if type cannot be converted.
*/
- static const XAO::Type stringToFieldType(const std::string& type);
+ static const XAO::Type stringToFieldType(const std::string& type) throw(XAO_Exception);
/**
* Converts a Format to string.
* \param format the Format to convert.
* \return the Format as a string.
- * \throw SALOME_Exception
+ * \throw XAO_Exception
*/
- static const std::string shapeFormatToString(const XAO::Format& format);
+ static const std::string shapeFormatToString(const XAO::Format& format) throw(XAO_Exception);
/**
* Converts a string into a Format.
* \param format the Format as a string.
* \return the converted Format.
- * \throw SALOME_Exception
+ * \throw XAO_Exception if format cannot be converted.
*/
- static const XAO::Format stringToShapeFormat(const std::string& format);
+ static const XAO::Format stringToShapeFormat(const std::string& format) throw(XAO_Exception);
};
/**
#include <vector>
-#include <Utils_SALOME_Exception.hxx>
#include "TestUtils.hxx"
#include "BrepGeometryTest.hxx"
+#include "../XAO_XaoUtils.hxx"
#include "../XAO_Xao.hxx"
#include "../XAO_BrepGeometry.hxx"
CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findVertexName(id));
geom->changeVertexName(id, std::string("va"));
CPPUNIT_ASSERT_EQUAL(std::string("va"), geom->findVertexName(id));
- CPPUNIT_ASSERT_THROW(geom->changeVertexName(100, "a"), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(geom->findVertexName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->changeVertexName(100, "a"), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(geom->findVertexName(100), XAO_Exception);
// edge of index 1 has id = 8
id = 8;
CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findEdgeName(id));
geom->changeEdgeName(id, std::string("ea"));
CPPUNIT_ASSERT_EQUAL(std::string("ea"), geom->findEdgeName(id));
- CPPUNIT_ASSERT_THROW(geom->changeEdgeName(100, "a"), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(geom->findEdgeName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->changeEdgeName(100, "a"), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(geom->findEdgeName(100), XAO_Exception);
// face of index 1 has id = 13
id = 13;
CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findFaceName(id));
geom->changeFaceName(id, std::string("fa"));
CPPUNIT_ASSERT_EQUAL(std::string("fa"), geom->findFaceName(id));
- CPPUNIT_ASSERT_THROW(geom->changeFaceName(100, "a"), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(geom->findFaceName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->changeFaceName(100, "a"), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(geom->findFaceName(100), XAO_Exception);
// solid of index 0 has id = 1
id = 1;
CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findSolidName(id));
geom->changeSolidName(id, std::string("sa"));
CPPUNIT_ASSERT_EQUAL(std::string("sa"), geom->findSolidName(id));
- CPPUNIT_ASSERT_THROW(geom->changeSolidName(100, "a"), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(geom->findSolidName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->changeSolidName(100, "a"), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(geom->findSolidName(100), XAO_Exception);
delete geom;
}
#include <vector>
-#include <Utils_SALOME_Exception.hxx>
#include "FieldTest.hxx"
#include "../XAO_Xao.hxx"
CPPUNIT_ASSERT_EQUAL(std::string("x"), f->getComponentName(0));
CPPUNIT_ASSERT_EQUAL(std::string("y"), f->getComponentName(1));
CPPUNIT_ASSERT_EQUAL(std::string("z"), f->getComponentName(2));
- CPPUNIT_ASSERT_THROW(f->setComponentName(3, "a"), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(f->getComponentName(3), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(f->setComponentName(3, "a"), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(f->getComponentName(3), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(0, f->countSteps());
Step* step = f->addNewStep(0);
step = f->addNewStep(1);
step = f->addNewStep(2);
CPPUNIT_ASSERT_EQUAL(3, f->countSteps());
- CPPUNIT_ASSERT_THROW(f->addNewStep(2), SALOME_Exception); // step already exists
+ CPPUNIT_ASSERT_THROW(f->addNewStep(2), XAO_Exception); // step already exists
CPPUNIT_ASSERT_EQUAL(true, f->removeStep(step));
CPPUNIT_ASSERT_EQUAL(2, f->countSteps());
BooleanStep* step = f->getStep(0);
CPPUNIT_ASSERT_EQUAL(XAO::BOOLEAN, step->getType());
CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL);
- CPPUNIT_ASSERT_THROW(f->getStep(2), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception);
step = f->addStep(10);
CPPUNIT_ASSERT_EQUAL(XAO::BOOLEAN, step->getType());
CPPUNIT_ASSERT_EQUAL(3, f->countSteps());
- CPPUNIT_ASSERT_THROW(f->addStep(10), SALOME_Exception); // step already exists
+ CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists
}
void FieldTest::testIntegerField()
IntegerStep* step = f->getStep(0);
CPPUNIT_ASSERT_EQUAL(XAO::INTEGER, step->getType());
CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL);
- CPPUNIT_ASSERT_THROW(f->getStep(2), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception);
step = f->addStep(10);
CPPUNIT_ASSERT_EQUAL(XAO::INTEGER, step->getType());
CPPUNIT_ASSERT_EQUAL(3, f->countSteps());
- CPPUNIT_ASSERT_THROW(f->addStep(10), SALOME_Exception); // step already exists
+ CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists
}
void FieldTest::testDoubleField()
{
DoubleStep* step = f->getStep(0);
CPPUNIT_ASSERT_EQUAL(XAO::DOUBLE, step->getType());
CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL);
- CPPUNIT_ASSERT_THROW(f->getStep(2), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception);
step = f->addStep(10);
CPPUNIT_ASSERT_EQUAL(XAO::DOUBLE, step->getType());
CPPUNIT_ASSERT_EQUAL(3, f->countSteps());
- CPPUNIT_ASSERT_THROW(f->addStep(10), SALOME_Exception); // step already exists
+ CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists
}
void FieldTest::testStringField()
{
StringStep* step = f->getStep(0);
CPPUNIT_ASSERT_EQUAL(XAO::STRING, step->getType());
CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL);
- CPPUNIT_ASSERT_THROW(f->getStep(2), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception);
step = f->addStep(10);
CPPUNIT_ASSERT_EQUAL(XAO::STRING, step->getType());
CPPUNIT_ASSERT_EQUAL(3, f->countSteps());
- CPPUNIT_ASSERT_THROW(f->addStep(10), SALOME_Exception); // step already exists
+ CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists
}
void FieldTest::testStep(XAO::Type type, Step* step)
CPPUNIT_ASSERT_EQUAL(true, step->getValue(1, 2));
CPPUNIT_ASSERT_EQUAL(std::string("true"), step->getStringValue(1, 2));
- CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception);
// get all values
std::vector<bool> values;
// get one element
values = step->getElement(2);
- CPPUNIT_ASSERT_THROW(step->getElement(nbElements), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size());
for (int i = 0; i < nbComponents; ++i)
CPPUNIT_ASSERT((i % 2 == 0) == values[i]);
// get one component
values = step->getComponent(1);
- CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size());
for (int i = 0; i < nbElements; ++i)
CPPUNIT_ASSERT(false == values[i]);
std::vector<bool> newEltValues;
// only one value
newEltValues.push_back(true);
- CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), XAO_Exception);
// all values
for (int i = 1; i < nbComponents; ++i)
newEltValues.push_back(true);
std::vector<bool> newCompValues;
// only one value
newCompValues.push_back(true);
- CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), XAO_Exception);
// all values
for (int i = 1; i < nbElements; ++i)
newCompValues.push_back(true);
// set string value
step->setStringValue(0, 0, "true");
- CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), XAO_Exception);
// set all values
std::vector<bool> allValues;
// only one value
allValues.push_back(true);
- CPPUNIT_ASSERT_THROW(step->setValues(allValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception);
// all values
for (int i = 1; i < nbElements*nbComponents; ++i)
allValues.push_back(true);
}
CPPUNIT_ASSERT_EQUAL(12, step->getValue(1, 2));
- CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception);
// get all values
std::vector<int> values;
// get one element
values = step->getElement(2);
- CPPUNIT_ASSERT_THROW(step->getElement(nbElements), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size());
for (int i = 0; i < nbComponents; ++i)
CPPUNIT_ASSERT_EQUAL(20+i, values[i]);
// get one component
values = step->getComponent(1);
- CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size());
for (int i = 0; i < nbElements; ++i)
CPPUNIT_ASSERT_EQUAL(10*i+1, values[i]);
// set one element
std::vector<int> newEltValues;
newEltValues.push_back(1);
- CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), XAO_Exception);
for (int i = 1; i < nbComponents; ++i)
newEltValues.push_back(1);
step->setElements(2, newEltValues);
// set one component
std::vector<int> newCompValues;
newCompValues.push_back(100);
- CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), XAO_Exception);
for (int i = 1; i < nbElements; ++i)
newCompValues.push_back(100);
step->setComponents(1, newCompValues);
// set string value
step->setStringValue(0, 0, "0");
- CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), XAO_Exception);
// set all values
std::vector<int> allValues;
// only one value
allValues.push_back(11);
- CPPUNIT_ASSERT_THROW(step->setValues(allValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception);
// all values
for (int i = 1; i < nbElements*nbComponents; ++i)
allValues.push_back(11);
}
CPPUNIT_ASSERT_EQUAL(10.2, step->getValue(1, 2));
- CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception);
// get all values
std::vector<double> values;
// get one element
values = step->getElement(2);
- CPPUNIT_ASSERT_THROW(step->getElement(nbElements), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size());
for (int i = 0; i < nbComponents; ++i)
CPPUNIT_ASSERT_EQUAL(20+i*0.1, values[i]);
// get one component
values = step->getComponent(1);
- CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size());
for (int i = 0; i < nbElements; ++i)
CPPUNIT_ASSERT_EQUAL(10*i+0.1, values[i]);
// set one element
std::vector<double> newEltValues;
newEltValues.push_back(1.);
- CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), XAO_Exception);
for (int i = 1; i < nbComponents; ++i)
newEltValues.push_back(1.);
step->setElements(2, newEltValues);
// set one component
std::vector<double> newCompValues;
newCompValues.push_back(100.0);
- CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), XAO_Exception);
for (int i = 1; i < nbElements; ++i)
newCompValues.push_back(100.0);
step->setComponents(1, newCompValues);
// set string value
step->setStringValue(0, 0, "0.2");
- CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), XAO_Exception);
std::vector<double> allValues;
// only one value
allValues.push_back(1.1);
- CPPUNIT_ASSERT_THROW(step->setValues(allValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception);
// all values
for (int i = 1; i < nbElements*nbComponents; ++i)
allValues.push_back(1.1);
}
CPPUNIT_ASSERT_EQUAL(std::string("12"), step->getValue(1, 2));
- CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception);
// get all values
std::vector<std::string> values;
// get one element
values = step->getElement(2);
- CPPUNIT_ASSERT_THROW(step->getElement(nbElements), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size());
for (int i = 0; i < nbComponents; ++i)
CPPUNIT_ASSERT_EQUAL(XaoUtils::intToString(20+i), values[i]);
// get one component
values = step->getComponent(1);
- CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size());
for (int i = 0; i < nbElements; ++i)
CPPUNIT_ASSERT_EQUAL(XaoUtils::intToString(10*i+1), values[i]);
// set one element
std::vector<std::string> newEltValues;
newEltValues.push_back("1");
- CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setElements(2, newEltValues), XAO_Exception);
for (int i = 1; i < nbComponents; ++i)
newEltValues.push_back("1");
step->setElements(2, newEltValues);
// set one component
std::vector<std::string> newCompValues;
newCompValues.push_back("100");
- CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setComponents(1, newCompValues), XAO_Exception);
for (int i = 1; i < nbElements; ++i)
newCompValues.push_back("100");
step->setComponents(1, newCompValues);
std::vector<std::string> allValues;
// only one value
allValues.push_back("abc");
- CPPUNIT_ASSERT_THROW(step->setValues(allValues), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception);
// all values
for (int i = 1; i < nbElements*nbComponents; ++i)
allValues.push_back("abc");
#include <vector>
-#include <Utils_SALOME_Exception.hxx>
#include "TestUtils.hxx"
#include "GeometryTest.hxx"
+#include "../XAO_XaoUtils.hxx"
#include "../XAO_Geometry.hxx"
#include "../XAO_GeometricElement.hxx"
CPPUNIT_ASSERT_EQUAL(std::string(""), otherLst.getName(0));
CPPUNIT_ASSERT_EQUAL(std::string(""), otherLst.getReference(0));
- CPPUNIT_ASSERT_THROW(otherLst.getName(20), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(otherLst.getReference(20), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(otherLst.hasName(20), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(otherLst.getName(20), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(otherLst.getReference(20), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(otherLst.hasName(20), XAO_Exception);
otherLst.setName(0, "aa");
CPPUNIT_ASSERT_EQUAL(std::string("aa"), otherLst.getName(0));
- CPPUNIT_ASSERT_THROW(otherLst.setName(20, "aa"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(otherLst.setName(20, "aa"), XAO_Exception);
otherLst.setReference(0, "bb");
CPPUNIT_ASSERT_EQUAL(std::string("bb"), otherLst.getReference(0));
- CPPUNIT_ASSERT_THROW(otherLst.setReference(20, "aa"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(otherLst.setReference(20, "aa"), XAO_Exception);
otherLst.setSize(10);
CPPUNIT_ASSERT_EQUAL(std::string(""), otherLst.getName(0));
CPPUNIT_ASSERT_EQUAL(std::string("name"), otherLst.getName(3));
CPPUNIT_ASSERT_EQUAL(std::string("ref"), otherLst.getReference(3));
CPPUNIT_ASSERT_EQUAL(true, otherLst.hasName(3));
- CPPUNIT_ASSERT_THROW(otherLst.setElement(30, "name", "ref"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(otherLst.setElement(30, "name", "ref"), XAO_Exception);
// ---- create elements "name i", "Ri"
for (int i = 0; i < otherLst.getSize(); ++i)
}
CPPUNIT_ASSERT_EQUAL(8, otherLst.getIndexByReference("R8"));
- CPPUNIT_ASSERT_THROW(otherLst.getIndexByReference("ZZ"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(otherLst.getIndexByReference("ZZ"), XAO_Exception);
GeometricElementList::iterator first = otherLst.begin();
GeometricElement firstElt = first->second;
void GeometryTest::testGeometryErrors()
{
- CPPUNIT_ASSERT_THROW(Geometry::createGeometry(XAO::STEP), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(Geometry::createGeometry(XAO::STEP), XAO_Exception);
}
void GeometryTest::testSetElement()
{
Geometry* geom = Geometry::createGeometry(XAO::BREP, "cube");
- CPPUNIT_ASSERT_THROW(geom->setVertexName(0, "aa"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->setVertexName(0, "aa"), XAO_Exception);
char* txt = TestUtils::readTextFile(TestUtils::getTestFilePath("Box_1.brep"));
geom->setShape(txt);
geom->setVertexName(0, "va");
CPPUNIT_ASSERT_EQUAL(true, geom->hasVertexName(0));
CPPUNIT_ASSERT_EQUAL(std::string("va"), geom->getVertexName(0));
- CPPUNIT_ASSERT_THROW(geom->getVertexName(100), SALOME_Exception);
- CPPUNIT_ASSERT_THROW(geom->hasVertexName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->getVertexName(100), XAO_Exception);
+ CPPUNIT_ASSERT_THROW(geom->hasVertexName(100), XAO_Exception);
geom->setEdgeName(0, "ea");
CPPUNIT_ASSERT_EQUAL(std::string("ea"), geom->getEdgeName(0));
- CPPUNIT_ASSERT_THROW(geom->getEdgeName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->getEdgeName(100), XAO_Exception);
geom->setFaceName(0, "fa");
CPPUNIT_ASSERT_EQUAL(std::string("fa"), geom->getFaceName(0));
- CPPUNIT_ASSERT_THROW(geom->getFaceName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->getFaceName(100), XAO_Exception);
geom->setSolidName(0, "sa");
CPPUNIT_ASSERT_EQUAL(std::string("sa"), geom->getSolidName(0));
- CPPUNIT_ASSERT_THROW(geom->getSolidName(100), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->getSolidName(100), XAO_Exception);
delete geom;
}
#include <vector>
-#include <Utils_SALOME_Exception.hxx>
#include "TestUtils.hxx"
#include "GroupTest.hxx"
+#include "../XAO_XaoUtils.hxx"
#include "../XAO_Xao.hxx"
#include "../XAO_Group.hxx"
CPPUNIT_ASSERT_EQUAL(10, group->get(0));
CPPUNIT_ASSERT_EQUAL(12, group->get(1));
- CPPUNIT_ASSERT_THROW(group->get(2), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(group->get(2), XAO_Exception);
group->remove(15);
CPPUNIT_ASSERT_EQUAL(2, group->count());
void GroupTest::testGroupErrors()
{
- CPPUNIT_ASSERT_THROW(new Group(XAO::WHOLE, 20), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(new Group(XAO::WHOLE, 20), XAO_Exception);
}
//
// Author : Frederic Pons (OpenCascade)
-#include <Utils_SALOME_Exception.hxx>
-
#include "TestUtils.hxx"
#include "ImportExportTest.hxx"
+#include "../XAO_XaoUtils.hxx"
#include "../XAO_Geometry.hxx"
#include "../XAO_Group.hxx"
#include "../XAO_Field.hxx"
xao.setGeometry(geom);
geom->setCountVertices(2);
- CPPUNIT_ASSERT_THROW(geom->setVertex(3, "v4", "4"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(geom->setVertex(3, "v4", "4"), XAO_Exception);
}
void ImportExportTest::testImportXao()
TestXAO_CPPFLAGS= \
@CPPUNIT_INCLUDES@ @PTHREAD_CFLAGS@ \
- $(GEOM_CXXFLAGS) \
$(CAS_CPPFLAGS) \
$(LIBXML_INCLUDES) \
-I$(srcdir)
@CPPUNIT_LIBS@ \
$(CAS_LDPATH) \
$(LIBXML_LIBS) \
- $(GEOM_LDFLAGS) \
../libXAO.la
dist_TestXAO_SOURCES = \
#include <vector>
-#include <Utils_SALOME_Exception.hxx>
#include "TestUtils.hxx"
#include "XaoTest.hxx"
+#include "../XAO_XaoUtils.hxx"
#include "../XAO_Xao.hxx"
#include "../XAO_BrepGeometry.hxx"
#include "../XAO_Group.hxx"
void XaoTest::testGroups()
{
Xao obj;
- CPPUNIT_ASSERT_THROW(obj.addGroup(XAO::FACE), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(obj.addGroup(XAO::FACE), XAO_Exception);
BrepGeometry* geom = new BrepGeometry("test");
obj.setGeometry(geom);
Group* agr = obj.getGroup(0);
CPPUNIT_ASSERT(gr == agr);
- CPPUNIT_ASSERT_THROW(obj.getGroup(10), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(obj.getGroup(10), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(true, obj.removeGroup(gr2));
CPPUNIT_ASSERT(gr2 != NULL);
void XaoTest::testFields()
{
Xao obj;
- CPPUNIT_ASSERT_THROW(obj.addField(XAO::INTEGER, XAO::FACE, 3), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(obj.addField(XAO::INTEGER, XAO::FACE, 3), XAO_Exception);
BrepGeometry* geom = new BrepGeometry("test");
obj.setGeometry(geom);
Field* fd = obj.addField(XAO::DOUBLE, XAO::FACE, 3);
Field* fs = obj.addField(XAO::STRING, XAO::FACE, 3);
CPPUNIT_ASSERT_EQUAL(4, obj.countFields());
- CPPUNIT_ASSERT_THROW(obj.getField(10), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(obj.getField(10), XAO_Exception);
CPPUNIT_ASSERT_EQUAL(true, obj.removeField(fb));
CPPUNIT_ASSERT(fb != NULL);
-#include <Utils_SALOME_Exception.hxx>
-
#include "XaoUtilsTest.hxx"
#include "../XAO_Xao.hxx"
#include "../XAO_XaoUtils.hxx"
CPPUNIT_ASSERT_EQUAL(true, XaoUtils::stringToBoolean("1"));
CPPUNIT_ASSERT_EQUAL(false, XaoUtils::stringToBoolean("false"));
CPPUNIT_ASSERT_EQUAL(false, XaoUtils::stringToBoolean("0"));
- CPPUNIT_ASSERT_THROW(XaoUtils::stringToBoolean("abc"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(XaoUtils::stringToBoolean("abc"), XAO_Exception);
}
void XaoUtilsTest::testInteger()
CPPUNIT_ASSERT_EQUAL(std::string("123"), XaoUtils::intToString(123));
CPPUNIT_ASSERT_EQUAL(123, XaoUtils::stringToInt("123"));
- CPPUNIT_ASSERT_THROW(XaoUtils::stringToInt("abc"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(XaoUtils::stringToInt("abc"), XAO_Exception);
}
void XaoUtilsTest::testDouble()
CPPUNIT_ASSERT_EQUAL(std::string("12.3"), XaoUtils::doubleToString(12.3));
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.123, XaoUtils::stringToDouble("0.123"), 1e-3);
- CPPUNIT_ASSERT_THROW(XaoUtils::stringToDouble("abc"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(XaoUtils::stringToDouble("abc"), XAO_Exception);
}
void XaoUtilsTest::testDimension()
CPPUNIT_ASSERT_EQUAL(XAO::FACE, XaoUtils::stringToDimension("face"));
CPPUNIT_ASSERT_EQUAL(XAO::SOLID, XaoUtils::stringToDimension("solid"));
CPPUNIT_ASSERT_EQUAL(XAO::WHOLE, XaoUtils::stringToDimension("whole"));
- CPPUNIT_ASSERT_THROW(XaoUtils::stringToDimension("zz"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(XaoUtils::stringToDimension("zz"), XAO_Exception);
}
void XaoUtilsTest::testType()
CPPUNIT_ASSERT_EQUAL(XAO::INTEGER, XaoUtils::stringToFieldType("integer"));
CPPUNIT_ASSERT_EQUAL(XAO::DOUBLE, XaoUtils::stringToFieldType("double"));
CPPUNIT_ASSERT_EQUAL(XAO::STRING, XaoUtils::stringToFieldType("string"));
- CPPUNIT_ASSERT_THROW(XaoUtils::stringToFieldType("zz"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(XaoUtils::stringToFieldType("zz"), XAO_Exception);
}
void XaoUtilsTest::testFormat()
CPPUNIT_ASSERT_EQUAL(XAO::BREP, XaoUtils::stringToShapeFormat("BREP"));
CPPUNIT_ASSERT_EQUAL(XAO::STEP, XaoUtils::stringToShapeFormat("STEP"));
- CPPUNIT_ASSERT_THROW(XaoUtils::stringToShapeFormat("zz"), SALOME_Exception);
+ CPPUNIT_ASSERT_THROW(XaoUtils::stringToShapeFormat("zz"), XAO_Exception);
}