-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 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
#include "SMESH_TryCatch.hxx"
+#include <memory>
+
#include CORBA_SERVER_HEADER(SALOME_Session)
using namespace std;
namespace
{
- enum { GroupOnFilter_OutOfDate = -1 };
+ enum { GroupOnFilter_OutOfDate = -777 };
// count not yet loaded meshes
static int theMeshCounter = 0;
*/
//================================================================================
- void meshInfoLoaded( SMESH_Mesh_i* mesh )
+ void meshInfoLoaded( SMESH_Mesh_i* /*mesh*/ )
{
theMeshCounter++;
}
*/
//================================================================================
- void filesNoMoreNeeded(SMESH_Mesh_i* mesh,
+ void filesNoMoreNeeded(SMESH_Mesh_i* /*mesh*/,
std::string medFile,
std::string hdfFile)
{
*/
//================================================================================
- 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
std::vector<int> data;
for ( size_t i = 0; i < meshInfo->length(); ++i )
- if ( meshInfo[i] > 0 )
+ if ( meshInfo[i] > 0 || meshInfo[i] == GroupOnFilter_OutOfDate )
{
data.push_back( DriverMED::GetMedGeoType( SMDSAbs_EntityType( i ))); //medTypes[ i ] );
data.push_back( meshInfo[ i ] );
if ( !data.empty() )
{
- hdf_size datasetSize[] = { data.size() };
- HDFarray* anArray = new HDFarray(0, HDF_INT32, 1, datasetSize);
+ hdf_size *datasetSize = new hdf_size[1]; datasetSize[0] = data.size();
+ std::unique_ptr<HDFarray> anArray( new HDFarray(0, HDF_INT32, 1, datasetSize) );
anArray->CreateOnDisk();
datasetSize[0] = 1;
HDFdataset* dataset = new HDFdataset( name.c_str(), hdfGroup, HDF_ARRAY, datasetSize, 1 );
mapOfNames );
}
}
+ infoHdfGroup->CloseOnDisk();
}
aFile->CloseOnDisk();
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);
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()" );
}
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 );
// -- 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 ]);
}
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 ]);
}
}
}
*/
//================================================================================
-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;
{
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 );