Salome HOME
MEDcoupling pour la dimension du maillage
[modules/smesh.git] / src / SMESHClient / SMESH_Client.cxx
index a2a29c7bc38a02fa74f79506667f1ac770bf9966..0c1b1aeabd9e365bac26bb24e5ba8f89825f2a2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //  Module : SMESH
 
 #include "SMESH_Client.hxx"
-#include "SMESH_Mesh.hxx"
+
+#include "SMESHDS_Mesh.hxx"
 #include "SMESHDS_Script.hxx"
+#include "SMESH_Mesh.hxx"
 
 #include "SALOME_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
@@ -54,7 +56,7 @@
 #endif
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -743,9 +745,9 @@ namespace
   //=======================================================================
   //function : ChangePolyhedronNodes
   //=======================================================================
-  inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh,
+  inline void ChangePolyhedronNodes (SMDS_Mesh*            theMesh,
                                      SMESH::log_array_var& theSeq,
-                                     CORBA::Long theId)
+                                     CORBA::Long           theId)
   {
     const SMESH::long_array& anIndexes = theSeq[theId].indexes;
     CORBA::Long iind = 0, aNbElems = theSeq[theId].number;
@@ -815,22 +817,19 @@ SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB,
   mySMESHDSMesh(NULL),
   mySMDSMesh(NULL)
 {
-  MESSAGE("SMESH_Client::SMESH_Client");
+  if ( MYDEBUG ) MESSAGE("SMESH_Client::SMESH_Client");
   myMeshServer->Register();
 
   CORBA::Boolean anIsEmbeddedMode;
   GetSMESHGen(theORB,anIsEmbeddedMode);
   if(anIsEmbeddedMode){
-    if ( MYDEBUG )
-      MESSAGE("Info: The same process, update mesh by pointer ");
+    if ( MYDEBUG ) MESSAGE("Info: The same process, update mesh by pointer ");
     // just set client mesh pointer to server mesh pointer
     //SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*>(theMesh->GetMeshPtr());
     CORBA::LongLong pointeur = theMesh->GetMeshPtr();
-    if( MYDEBUG )
-      MESSAGE("SMESH_Client::SMESH_Client pointeur "<<pointeur);
+    if( MYDEBUG ) MESSAGE("SMESH_Client::SMESH_Client pointeur "<<pointeur);
     SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*> (pointeur);
-    if ( MYDEBUG )
-      MESSAGE("SMESH_Client::SMESH_Client aMesh "<<aMesh);
+    if ( MYDEBUG ) MESSAGE("SMESH_Client::SMESH_Client aMesh "<<aMesh);
     //if(aMesh->GetMeshDS()->IsEmbeddedMode()){
     if(anIsEmbeddedMode){
       mySMESHDSMesh = aMesh->GetMeshDS();
@@ -886,20 +885,22 @@ bool
 SMESH_Client::Update(bool theIsClear)
 {
   bool anIsModified = true;
-  if(mySMESHDSMesh){
-        MESSAGE("Update mySMESHDSMesh");
+  if(mySMESHDSMesh)
+  {
+    if ( MYDEBUG ) MESSAGE("Update mySMESHDSMesh");
     SMESHDS_Script* aScript = mySMESHDSMesh->GetScript();
     anIsModified = aScript->IsModified();
     aScript->SetModified(false);
-  }else{
-        MESSAGE("Update CORBA");
+  }
+  else
+  {
+    if ( MYDEBUG ) MESSAGE("Update CORBA");
     SMESH::log_array_var aSeq = myMeshServer->GetLog( theIsClear );
     CORBA::Long aLength = aSeq->length();
     anIsModified = aLength > 0;
-    if( MYDEBUG )
-      MESSAGE( "Update: length of the script is "<<aLength );
+    if ( MYDEBUG ) MESSAGE( "Update: length of the script is "<<aLength );
 
-    if(!anIsModified)
+    if ( !anIsModified )
       return false;
 
     // update client mesh structure by logged changes commands
@@ -985,10 +986,10 @@ SMESH_Client::Update(bool theIsClear)
           ChangePolyhedronNodes(mySMDSMesh, aSeq, anId);
           break;
         case SMESH::RENUMBER:
-          for(CORBA::Long i=0; anElemId < aNbElems; anElemId++, i+=3)
-          {
-            mySMDSMesh->Renumber( anIndexes[i], anIndexes[i+1], anIndexes[i+2] );
-          }
+          // for(CORBA::Long i=0; anElemId < aNbElems; anElemId++, i+=3)
+          // {
+          //   mySMDSMesh->Renumber( anIndexes[i], anIndexes[i+1], anIndexes[i+2] );
+          // }
           break;
 
         default:;