-// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2022 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
}
}
-const int Xao::countGroups() const
+int Xao::countGroups() const
{
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 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);