Salome HOME
Update to match the new implementation of SMDS
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i.cxx
index 113b80eb0ac398e6f3d89a10108b10e38fd1a4bc..fa5152ed2c257e1a491fa917d507e17899ec1531 100644 (file)
@@ -1,14 +1,32 @@
-using namespace std;
-//=============================================================================
-// File      : SMESH_Gen_i.cxx
-// Created   : lun mai  6 13:41:35 CEST 2002
-// Author    : Paul RASCLE, EDF
-// Project   : SALOME
-// Copyright : EDF 2002
-// $Header$
-//=============================================================================
-using namespace std;
+//  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  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 
+//
+//
+//
+//  File   : SMESH_Gen_i.cxx
+//  Author : Paul RASCLE, EDF
+//  Module : SMESH
+//  $Header$
 
+using namespace std;
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
@@ -553,7 +571,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
        int meshId = myMesh->GetId();
        SMESH_Mesh_i* meshServant = myStudyContext->mapMesh_i[meshId];
        ::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
-       Handle(SMESHDS_Mesh) mySMESHDSMesh = myLocMesh.GetMeshDS();
+       SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS();
        
        SCRUTE(mySMESHDSMesh->NbNodes());
        if (mySMESHDSMesh->NbNodes()>0) {//checks if the mesh is not empty
@@ -831,6 +849,13 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
   return aStreamFile._retn();
 }
 
+SALOMEDS::TMPFile* SMESH_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
+                                         const char* theURL,
+                                         bool isMultiFile) {
+  SALOMEDS::TMPFile_var aStreamFile = Save(theComponent, theURL, isMultiFile);
+  return aStreamFile._retn();
+}
+
 //=============================================================================
 /*!
  *  
@@ -877,7 +902,7 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
   _NS->init_orb( _orb ) ;
   SALOME_LifeCycleCORBA* myEnginesLifeCycle = new SALOME_LifeCycleCORBA(_NS);
   Engines::Component_var geomEngine =
-    myEnginesLifeCycle->FindOrLoad_Component("FactoryServer","Geometry");
+    myEnginesLifeCycle->FindOrLoad_Component("FactoryServer","GEOM");
   GEOM::GEOM_Gen_var myGeomEngine = GEOM::GEOM_Gen::_narrow(geomEngine);
 
 
@@ -1111,7 +1136,7 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
              int meshId = myNewMesh->GetId();
              SMESH_Mesh_i* meshServant = myStudyContext->mapMesh_i[meshId];
              ::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
-             Handle(SMESHDS_Mesh) mySMESHDSMesh = myLocMesh.GetMeshDS();
+             SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS();
                    
              DriverMED_R_SMESHDS_Mesh* myReader = new DriverMED_R_SMESHDS_Mesh;
                    
@@ -1404,6 +1429,13 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
   return true;
 }
 
+bool SMESH_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
+                           const SALOMEDS::TMPFile& theStream,
+                           const char* theURL,
+                           bool isMultiFile) {
+  return Load(theComponent, theStream, theURL, isMultiFile);
+}
+
 //=============================================================================
 /*!
  *  
@@ -1493,7 +1525,8 @@ char* SMESH_Gen_i::ComponentDataType()
 
 char* SMESH_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
                                          const char* IORString,
-                                         CORBA::Boolean isMultiFile)
+                                         CORBA::Boolean isMultiFile,
+                                         CORBA::Boolean isASCII)
 {
   MESSAGE("SMESH_Gen_i::IORToLocalPersistentID");
 
@@ -1548,7 +1581,8 @@ char* SMESH_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
 
 char* SMESH_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
                                          const char* aLocalPersistentID,
-                                         CORBA::Boolean isMultiFile)
+                                         CORBA::Boolean isMultiFile,
+                                         CORBA::Boolean isASCII)
 {
   MESSAGE("SMESH_Gen_i::LocalPersistentIDToIOR");
   SCRUTE(aLocalPersistentID);