Salome HOME
Merge V9_dev branch into master
[modules/smesh.git] / src / SMESH_I / SMESH_PreMeshInfo.cxx
index 7db67ae582d658b8b00bc540f60bd3625cedcf09..886f4a6d1cfa34de335b7b94ead6c435fc20d77b 100644 (file)
@@ -950,7 +950,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
             if ( isNode ) {
               SMDS_PositionPtr pos = aPositionCreator.MakePosition( smType[ smID ]);
               SMDS_MeshNode* node = const_cast<SMDS_MeshNode*>( static_cast<const SMDS_MeshNode*>( elem ));
-              node->SetPosition( pos );
+              node->SetPosition( pos, sm->GetID() );
               sm->AddNode( node );
             } else {
               sm->AddElement( elem );
@@ -1051,8 +1051,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
             // -- Most probably a bad study was saved when there were
             // not fixed bugs in SMDS_MeshInfo
             if ( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ) {
-              SMDS_FacePosition* fPos = const_cast<SMDS_FacePosition*>
-                ( static_cast<const SMDS_FacePosition*>( aPos ));
+              SMDS_FacePositionPtr fPos = aPos;
               fPos->SetUParameter( aUPos[ iNode ]);
               fPos->SetVParameter( aVPos[ iNode ]);
             }
@@ -1060,9 +1059,8 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const
           else {
             // ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE );-- issue 20182
             if ( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ) {
-              SMDS_EdgePosition* fPos = const_cast<SMDS_EdgePosition*>
-                ( static_cast<const SMDS_EdgePosition*>( aPos ));
-              fPos->SetUParameter( aUPos[ iNode ]);
+              SMDS_EdgePositionPtr ePos = aPos;
+              ePos->SetUParameter( aUPos[ iNode ]);
             }
           }
         }