Salome HOME
Merging with the MAN_SALOME2 branch
[modules/med.git] / src / MedClient / src / MESHClient.cxx
index 4a530dfe91c8f8c55cb6cc5b190b19e5338c7c5d..a9d8e57daf13436872d56f003216612fa783def0 100644 (file)
@@ -1,10 +1,15 @@
 #include "MESHClient.hxx"
-#include <convert.hxx>
+#include "MEDMEM_convert.hxx"
 #include "UtilClient.hxx"
 #include "COORDINATEClient.hxx"
 #include "CONNECTIVITYClient.hxx"
 #include "FAMILYClient.hxx"
 #include "GROUPClient.hxx"
+//=============================================================================
+/*!
+ * Constructeur
+ */
+//=============================================================================
 
 MESHClient::MESHClient(const SALOME_MED::MESH_ptr m) : 
   MESH(), 
@@ -23,97 +28,122 @@ MESHClient::MESHClient(const SALOME_MED::MESH_ptr m) :
 
   END_OF("MESHClient::MESHClient(SALOME_MED::MESH_ptr m)");
 }
+//=============================================================================
+/*!
+ * Transforme un IOR Famille en Famille Client
+ */
+//=============================================================================
 
-FAMILY * convertFamily(const SALOME_MED::FAMILY_ptr &F, MESH *M) {
+FAMILY * convertFamily(const SALOME_MED::FAMILY_ptr &F, MESH *M) 
+{
   return new FAMILYClient(F, M);
 }
-
-GROUP * convertGroup(const SALOME_MED::GROUP_ptr &F, MESH *M) {
+//=============================================================================
+/*!
+ * Transforme un IOR groupe en groupe Client
+ */
+//=============================================================================
+GROUP * convertGroup(const SALOME_MED::GROUP_ptr &F, MESH *M) 
+{
   return new GROUPClient(F, M);
 }
-
+//=============================================================================
+/*!
+ * Remplit les informations générales 
+ */
+//=============================================================================
 void MESHClient::blankCopy()
 {
   BEGIN_OF("MESHClient::blankCopy()");
-
-  CORBA::String_var s;
+  SALOME_MED::MESH::meshInfos * all  = new SALOME_MED::MESH::meshInfos;
+  all = IOR_Mesh->getMeshGlobal();
+
+  //CORBA::String_var s;
+  //s= IOR_Mesh->getName(); _name = s;
+  //_spaceDimension = IOR_Mesh->getSpaceDimension();
+  //_meshDimension  = IOR_Mesh->getMeshDimension();
+  //_numberOfNodes  = IOR_Mesh->getNumberOfNodes();
   
-  s= IOR_Mesh->getName(); _name = s;
-  _spaceDimension = IOR_Mesh->getSpaceDimension();
-  _meshDimension  = IOR_Mesh->getMeshDimension();
-  _numberOfNodes  = IOR_Mesh->getNumberOfNodes();
-  
-   COORDINATEClient *_coord 
-     = dynamic_cast<COORDINATEClient*>(_coordinate);
-   ASSERT(_coord);
+  _name           = all->name;
+  _spaceDimension = all->spaceDimension;
+  _meshDimension  = all->meshDimension;
+  _numberOfNodes  = all->numberOfNodes;
+
+  COORDINATEClient *_coord 
+    = dynamic_cast<COORDINATEClient*>(_coordinate);
+  ASSERT(_coord);
   CONNECTIVITYClient *_connect 
     = dynamic_cast<CONNECTIVITYClient*>(_connectivity);
   ASSERT(_connect);
 
-   _coord->blankCopy();
+  _coord->blankCopy();
   _connect->blankCopy();
 
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::FAMILY_ptr>
     (_familyNode, 
      _numberOfNodesFamilies, 
-     IOR_Mesh->getFamilies(MED_NODE),
+     //IOR_Mesh->getFamilies(MED_NODE),
+     &all->famNode,
      (void *) (convertFamily), this);
  
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::FAMILY_ptr>
     (_familyEdge, 
      _numberOfEdgesFamilies, 
-     IOR_Mesh->getFamilies(MED_EDGE),
+     //IOR_Mesh->getFamilies(MED_EDGE),
+     &all->famEdge,
      (void *) (convertFamily), this);
  
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::FAMILY_ptr>
     (_familyFace, 
      _numberOfFacesFamilies, 
-     IOR_Mesh->getFamilies(MED_FACE),
+     //IOR_Mesh->getFamilies(MED_FACE),
+     &all->famFace,
      (void *) (convertFamily), this);
  
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::FAMILY_ptr>
     (_familyCell, 
      _numberOfCellsFamilies, 
-     IOR_Mesh->getFamilies(MED_CELL),
+     //IOR_Mesh->getFamilies(MED_CELL),
+     &all->famCell,
      (void *) (convertFamily), this);
  
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::GROUP_ptr>
     (_groupNode, 
      _numberOfNodesGroups, 
-     IOR_Mesh->getGroups(MED_NODE),
+     //IOR_Mesh->getGroups(MED_NODE),
+     &all->groupNode,
      (void *) (convertGroup), this);
  
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::GROUP_ptr>
     (_groupEdge, 
      _numberOfEdgesGroups, 
-     IOR_Mesh->getGroups(MED_EDGE),
+     //IOR_Mesh->getGroups(MED_EDGE),
+     &all->groupEdge,
      (void *) (convertGroup), this);
  
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::GROUP_ptr>
     (_groupFace, 
      _numberOfFacesGroups, 
-     IOR_Mesh->getGroups(MED_FACE),
+     //IOR_Mesh->getGroups(MED_FACE),
+     &all->groupFace,
      (void *) (convertGroup), this);
  
-  MESSAGE("");
   convertCorbaArray<SALOME_MED::GROUP_ptr>
     (_groupCell, 
      _numberOfCellsGroups, 
-     IOR_Mesh->getGroups(MED_CELL),
+     //IOR_Mesh->getGroups(MED_CELL),
+     &all->groupCell,
      (void *) (convertGroup), this);
  
-  MESSAGE("");
   _complete = false;
 
   END_OF("MESHClient::blankCopy()");
 }
+//=============================================================================
+/*!
+ * Remplit les informations sur les coordonnees et la connectivite 
+ */
+//=============================================================================
 
 void MESHClient::fillCopy()
 {
@@ -134,6 +164,11 @@ void MESHClient::fillCopy()
   END_OF("MESHClient::fillCopy()");
 }
 
+//=============================================================================
+/*!
+ * Destructeur
+ */
+//=============================================================================
 
 MESHClient::~MESHClient()
 {