Salome HOME
Merge multi-study removal branch.
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPlugin_GHS3D_i.cxx
index 198f25848981ea7567bb185ceae7e1698c4b9512..ba7dbeba937d1ef576079b7c8967a58b780ee9ac 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2004-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2004-2016  CEA/DEN, EDF R&D
 //
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  $Header$
 //
 #include "GHS3DPlugin_GHS3D_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh_i.hxx"
-#include "SMESH_Gen_i.hxx"
+
 #include "GHS3DPlugin_GHS3D.hxx"
-#include "SMESH_PythonDump.hxx"
+#include "GHS3DPlugin_Optimizer.hxx"
+
+#include <SMESH_Gen.hxx>
+#include <SMESH_Gen_i.hxx>
+#include <SMESH_Mesh_i.hxx>
+#include <SMESH_PythonDump.hxx>
 
-#include "utilities.h"
+#include <utilities.h>
 #include <cstring>
 
 //=============================================================================
 //=============================================================================
 
 GHS3DPlugin_GHS3D_i::GHS3DPlugin_GHS3D_i (PortableServer::POA_ptr thePOA,
-                                          int                     theStudyId,
                                           ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
        SMESH_Algo_i( thePOA ),
        SMESH_3D_Algo_i( thePOA )
 {
-  MESSAGE( "GHS3DPlugin_GHS3D_i::GHS3DPlugin_GHS3D_i" );
   myBaseImpl = new ::GHS3DPlugin_GHS3D (theGenImpl->GetANewId(),
-                                        theStudyId,
                                         theGenImpl );
 }
 
@@ -65,7 +65,6 @@ GHS3DPlugin_GHS3D_i::GHS3DPlugin_GHS3D_i (PortableServer::POA_ptr thePOA,
 
 GHS3DPlugin_GHS3D_i::~GHS3DPlugin_GHS3D_i()
 {
-  MESSAGE( "GHS3DPlugin_GHS3D_i::~GHS3DPlugin_GHS3D_i" );
 }
 
 //=============================================================================
@@ -78,7 +77,6 @@ GHS3DPlugin_GHS3D_i::~GHS3DPlugin_GHS3D_i()
 
 ::GHS3DPlugin_GHS3D* GHS3DPlugin_GHS3D_i::GetImpl()
 {
-  MESSAGE( "GHS3DPlugin_GHS3D_i::GetImpl" );
   return ( ::GHS3DPlugin_GHS3D* )myBaseImpl;
 }
 
@@ -92,17 +90,16 @@ GHS3DPlugin_GHS3D_i::~GHS3DPlugin_GHS3D_i()
 
 SMESH::SMESH_Mesh_ptr GHS3DPlugin_GHS3D_i::importGMFMesh(const char* theGMFFileName)
 {
-  MESSAGE( "GHS3DPlugin_GHS3D_i::importGMFMesh" );
   SMESH_Gen_i* smeshGen = SMESH_Gen_i::GetSMESHGen();
   SMESH::SMESH_Mesh_ptr theMesh = smeshGen->CreateEmptyMesh();
-  smeshGen->RemoveLastFromPythonScript(smeshGen->GetCurrentStudy()->StudyId());
-  SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(), theMesh);
+  smeshGen->RemoveLastFromPythonScript();
+  SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(theMesh);
 #ifdef WINNT
 #define SEP '\\'
 #else
 #define SEP '/'
 #endif
-  string strFileName (theGMFFileName);
+  std::string strFileName (theGMFFileName);
   strFileName = strFileName.substr(strFileName.rfind(SEP)+1);
   strFileName.erase(strFileName.rfind('.'));
   smeshGen->SetName(theSMesh, strFileName.c_str());
@@ -114,3 +111,23 @@ SMESH::SMESH_Mesh_ptr GHS3DPlugin_GHS3D_i::importGMFMesh(const char* theGMFFileN
   }
   return theMesh;
 }
+
+//=============================================================================
+/*!
+ *  GHS3DPlugin_Optimizer_i::GHS3DPlugin_Optimizer_i
+ *
+ *  Constructor
+ */
+//=============================================================================
+
+GHS3DPlugin_Optimizer_i::GHS3DPlugin_Optimizer_i (PortableServer::POA_ptr thePOA,
+                                                  ::SMESH_Gen*            theGenImpl )
+  : SALOME::GenericObj_i( thePOA ),
+    SMESH_Hypothesis_i( thePOA ),
+    SMESH_Algo_i( thePOA ),
+    SMESH_3D_Algo_i( thePOA )
+{
+  myBaseImpl = new ::GHS3DPlugin_Optimizer (theGenImpl->GetANewId(),
+                                            theGenImpl );
+}
+