/*!
* SMESH_Gen_i::CheckCompatibility
*
- * Check compatibility of file with MED format being used.
+ * Check compatibility of file with MED format being used, read only.
*/
//================================================================================
CORBA::Boolean SMESH_Gen_i::CheckCompatibility(const char* theFileName)
return MED::CheckCompatibility( theFileName );
}
+//================================================================================
+/*!
+ * SMESH_Gen_i::CheckWriteCompatibility
+ *
+ * Check compatibility of file with MED format being used, for append on write.
+ */
+//================================================================================
+CORBA::Boolean SMESH_Gen_i::CheckWriteCompatibility(const char* theFileName)
+{
+ return MED::CheckCompatibility( theFileName, true );
+}
+
//================================================================================
/*!
* SMESH_Gen_i::GetMeshNames
//================================================================================
SMESH::string_array* SMESH_Gen_i::GetMeshNames(const char* theFileName)
{
+ //MESSAGE("GetMeshNames " << theFileName);
SMESH::string_array_var aResult = new SMESH::string_array();
MED::PWrapper aMed = MED::CrWrapperR( theFileName );
MED::TErr anErr;
MED::TInt aNbMeshes = aMed->GetNbMeshes( &anErr );
+ //MESSAGE("---" << aNbMeshes);
if( anErr >= 0 ) {
aResult->length( aNbMeshes );
for( MED::TInt i = 0; i < aNbMeshes; i++ ) {
myMesh->Load(); // load from study file if not yet done
TPythonDump pd; // not to dump GetGroups()
SMESH::ListOfGroups_var groups = myMesh->GetGroups();
- pd << ""; // to avoid optimizing pd out
for ( CORBA::ULong i = 0; i < groups->length(); ++i )
{
SMESH_GroupBase_i* grImpl = SMESH::DownCast<SMESH_GroupBase_i*>( groups[i]);
}
}
+ // Store file info
+ std::string info = myImpl->FileInfoToString();
+ if ( !info.empty() )
+ {
+ aSize[ 0 ] = info.size();
+ aDataset = new HDFdataset( "file info", aTopGroup, HDF_STRING, aSize, 1 );
+ aDataset->CreateOnDisk();
+ aDataset->WriteOnDisk( (char*) info.data() );
+ aDataset->CloseOnDisk();
+ }
+
// write applied hypotheses if exist
SALOMEDS::SObject_wrap myHypBranch;
found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
const char* theURL,
bool isMultiFile )
{
- if (!myStudyContext)
+ //if (!myStudyContext)
UpdateStudy();
SALOMEDS::Study_var aStudy = getStudyServant();
/* if( !theComponent->_is_nil() )
myNewMeshImpl->GetImpl().GetMeshDS()->SetPersistentId( *meshPersistentId );
delete [] meshPersistentId;
}
+
+ // Restore file info
+ if ( aTopGroup->ExistInternalObject( "file info" ))
+ {
+ aDataset = new HDFdataset( "file info", aTopGroup );
+ aDataset->OpenOnDisk();
+ size = aDataset->GetSize();
+ std::string info( size, ' ');
+ aDataset->ReadFromDisk( (char*) info.data() );
+ aDataset->CloseOnDisk();
+ myNewMeshImpl->FileInfoFromString( info );
+ }
}
}
} // reading MESHes
// remove the tmp files meshes are loaded from
SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );
+ // Clean trace of API methods calls
+ CleanPythonTrace();
+
return;
}