Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits
[modules/smesh.git] / src / SMESH_I / SMESH_PreMeshInfo.cxx
index c92372a9634476886bcaf59b33338ce2e5125ecb..838a77ebeb9cf736878cc99202dc1af9e40732b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  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
@@ -72,7 +72,7 @@ namespace
    */
   //================================================================================
 
-  void meshInfoLoaded( SMESH_Mesh_i* mesh )
+  void meshInfoLoaded( SMESH_Mesh_i* /*mesh*/ )
   {
     theMeshCounter++;
   }
@@ -82,7 +82,7 @@ namespace
    */
   //================================================================================
 
-  void filesNoMoreNeeded(SMESH_Mesh_i* mesh,
+  void filesNoMoreNeeded(SMESH_Mesh_i* /*mesh*/,
                          std::string   medFile,
                          std::string   hdfFile)
   {
@@ -242,9 +242,9 @@ namespace
    */
   //================================================================================
 
-  void meshInfo2hdf( SMESH::long_array_var meshInfo,
-                     const std::string&    name,
-                     HDFgroup*             hdfGroup)
+  void meshInfo2hdf( SMESH::smIdType_array_var meshInfo,
+                     const std::string&        name,
+                     HDFgroup*                 hdfGroup)
   {
     // we use med identification of element (MED::EGeometrieElement) types
     // but not enum SMDSAbs_EntityType because values of SMDSAbs_EntityType may
@@ -456,7 +456,7 @@ bool SMESH_PreMeshInfo::readPreInfoFromHDF()
                                                mapOfNames );
       }
     }
-       infoHdfGroup->CloseOnDisk();
+    infoHdfGroup->CloseOnDisk();
   }
 
   aFile->CloseOnDisk();
@@ -479,7 +479,7 @@ bool SMESH_PreMeshInfo::readMeshInfo()
   MED::PMeshInfo medMeshInfo = aMed->CrMeshInfo(3,3,SMESH_Comment( _meshID ));
 
   // read nb nodes
-  int nbNodes = std::max( 0, aMed->GetNbNodes( medMeshInfo ));
+  int nbNodes = Max( 0, aMed->GetNbNodes( medMeshInfo ));
   if ( nbNodes > 0 )
   {
     setNb( SMDSEntity_Node, nbNodes);
@@ -841,8 +841,9 @@ void SMESH_PreMeshInfo::FullLoadFromFile() const
   meshDS->Modified();
 
   // load dependent meshes referring/referred via hypotheses
-  mesh.GetSubMesh( mesh.GetShapeToMesh() )->
-    ComputeStateEngine (SMESH_subMesh::SUBMESH_LOADED);
+  SMESH_subMesh* mainSub = mesh.GetSubMesh( mesh.GetShapeToMesh() );
+  mainSub->ComputeStateEngine (SMESH_subMesh::SUBMESH_RESTORED); // #16648 
+  mainSub->ComputeStateEngine (SMESH_subMesh::SUBMESH_LOADED);
 
   MYDEBUGOUT( "END FullLoadFromFile()" );
 }
@@ -1197,9 +1198,9 @@ SMESH::array_of_ElementType* SMESH_PreMeshInfo::GetTypes() const
  */
 //================================================================================
 
-SMESH::long_array* SMESH_PreMeshInfo::GetMeshInfo() const
+SMESH::smIdType_array* SMESH_PreMeshInfo::GetMeshInfo() const
 {
-  SMESH::long_array_var aRes = new SMESH::long_array();
+  SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
   aRes->length(SMESH::Entity_Last);
   for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
     aRes[i] = 0;
@@ -1232,7 +1233,7 @@ void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr sme
 {
   if ( theMeshCounter > 0 )
   {
-    SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( smeshComp );
+    SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->NewChildIterator( smeshComp );
     for ( ; itBig->More(); itBig->Next() ) {
       SALOMEDS::SObject_wrap gotBranch = itBig->Value();
       CORBA::Object_var       anObject = SMESH_Gen_i::SObjectToObject( gotBranch );