Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/smesh.git] / src / SMESH_I / SMESH_MEDSupport_i.cxx
index 0db6c4095e9300ff7ef67e836828f3d58eacb9ba..e9b45e00903772663bf998deb81057b8c44e6fed 100644 (file)
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  File   : SMESH_MEDSupport_i.cxx
 //  Module : SMESH
 
-using namespace std;
 #include "SMESH_MEDSupport_i.hxx"
 #include "utilities.h"
 #include "Utils_CorbaException.hxx"
+#include "Utils_ExceptHandlers.hxx"
 
 #include <TopoDS_Iterator.hxx>
 #include "SMESHDS_Mesh.hxx"
@@ -36,6 +36,9 @@ using namespace std;
 #include "SMESH_Mesh_i.hxx"
 #include "SMESH_subMesh_i.hxx"
 
+using namespace std;
+
+
 //=============================================================================
 /*!
  * Default constructor
@@ -296,6 +299,7 @@ CORBA::Long SMESH_MEDSupport_i::getNumberOfElements(SALOME_MED::
 SALOME_MED::long_array * SMESH_MEDSupport_i::getNumber(
        SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
 {
+  Unexpect aCatch(SALOME_SalomeException);
        if (_subMeshDS==NULL)
                THROW_SALOME_CORBA_EXCEPTION("No associated Support",
                        SALOME::INTERNAL_ERROR);
@@ -309,13 +313,12 @@ SALOME_MED::long_array * SMESH_MEDSupport_i::getNumber(
        int i = 0;
        myseq->length(_subMeshDS->NbNodes());
 
-       SMDS_Iterator<const SMDS_MeshNode*> * it = _subMeshDS->GetNodes();
+       SMDS_NodeIteratorPtr it = _subMeshDS->GetNodes();
        while(it->more())
        {
                myseq[i] = it->next()->GetID();
                i++;
        };
-       delete it;
 
        SCRUTE(myseq->length());
        MESSAGE("End of SMESH_MEDSupport_i::getNumber");
@@ -323,6 +326,18 @@ SALOME_MED::long_array * SMESH_MEDSupport_i::getNumber(
 
 }
 
+//=============================================================================
+/*!
+ * CORBA: get Nodes from file
+ */
+//=============================================================================
+
+SALOME_MED::long_array * SMESH_MEDSupport_i::getNumberFromFile(
+       SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
+{
+  return getNumber(geomElement);
+}
+
 //=============================================================================
 /*!
  * CORBA: Global Nodes Index (optionnaly designed by the user)
@@ -337,7 +352,6 @@ SALOME_MED::long_array *
        THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
        return NULL;
 }
-
 //=============================================================================
 /*!
  * CORBA: Array containing indexes for elements included in the support