Salome HOME
Increment version: 8.1.0
[plugins/hexablockplugin.git] / src / HEXABLOCKPlugin / HEXABLOCKPlugin_Hypothesis_i.cxx
index 4e864eaffcd17d4d12f96d86e3f9f04b3454eb71..cc8a630ba69c15badaf04a6b098851f2b78c2c0b 100755 (executable)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2009-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
 #include <SMESH_PythonDump.hxx>
 #include <SMESH_Mesh_i.hxx>
 
-#include "HEXABLOCK.hxx"
+// #include "HEXABLOCK.hxx"
 #include "HEXABLOCKPlugin_Hypothesis_i.hxx"
-#include "HexDocument_impl.hxx"
+// #include "HexDocument_impl.hxx"    // Perime
+#include "HexDocument.hxx"
 
 #include <Utils_CorbaException.hxx>
 #include <utilities.h>
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = HEXA_NS::on_debug ();
 #else
 static int MYDEBUG = 0;
 #endif
@@ -43,8 +44,8 @@ static int MYDEBUG = 0;
 //=======================================================================
 
 HEXABLOCKPlugin_Hypothesis_i::HEXABLOCKPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
-                                                    ::SMESH_Gen*            theGenImpl)
+                                  int             theStudyId,
+                                  ::SMESH_Gen*    theGenImpl)
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
@@ -91,22 +92,20 @@ CORBA::Boolean HEXABLOCKPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension ty
  * Define the document to be meshed, mandatory
  */
 //================================================================================
-
-HEXABLOCK_ORB::Document_ptr HEXABLOCKPlugin_Hypothesis_i::GetDocument() {
-  ASSERT(myBaseImpl);
-  HEXA_NS::Document* d = this->GetImpl()->GetDocument();
-  Document_impl* servantCorba = new Document_impl(_poa, d);
-  HEXABLOCK_ORB::Document_ptr result = servantCorba->_this();
-  return result;
+// ================================================================= GetDocument
+char* HEXABLOCKPlugin_Hypothesis_i::GetDocument ()
+{
+  ASSERT (myBaseImpl);
+  cpchar xml = this->GetImpl()->GetXmlFlow ();
+  return CORBA::string_dup (xml);
 }
 
-void HEXABLOCKPlugin_Hypothesis_i::SetDocument(HEXABLOCK_ORB::Document_ptr doc) {
-  Document_impl* docServant = ::DownCast<Document_impl*>(doc);
-  if ( docServant ) {
-    HEXA_NS::Document* d = docServant->GetImpl();
-    ASSERT(myBaseImpl);
-    this->GetImpl()->SetDocument(d);
-  }
+// ================================================================= SetDocument
+void HEXABLOCKPlugin_Hypothesis_i::SetDocument (const char* name)
+{
+    ASSERT (myBaseImpl);
+    // this->GetImpl()->SetXmlFlow (xml);
+    this->GetImpl()->SetDocument (name);
 }
 
 //================================================================================