Salome HOME
projects
/
modules
/
smesh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
33dc437
)
InLoad(): restore algorithms before hypotheses (PAL7914), nullify the main shape...
author
eap
<eap@opencascade.com>
Fri, 28 Jan 2005 10:46:49 +0000
(10:46 +0000)
committer
eap
<eap@opencascade.com>
Fri, 28 Jan 2005 10:46:49 +0000
(10:46 +0000)
src/SMESH_I/SMESH_Gen_i.cxx
patch
|
blob
|
history
diff --git
a/src/SMESH_I/SMESH_Gen_i.cxx
b/src/SMESH_I/SMESH_Gen_i.cxx
index bf046ac9b97119c6bc9939d871f6c530960bfb4a..db273b20366fbf0c7af485c3ff6e336df52fedbf 100644
(file)
--- a/
src/SMESH_I/SMESH_Gen_i.cxx
+++ b/
src/SMESH_I/SMESH_Gen_i.cxx
@@
-992,11
+992,6
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
}
}
}
}
}
}
- // maybe a shape was deleted in the study
- if ( !shapeRefFound && !mySMESHDSMesh->ShapeToMesh().IsNull() ) {
- TopoDS_Shape nullShape;
- myLocMesh.ShapeToMesh( nullShape ); // remove shape referring data
- }
// write applied hypotheses if exist
SALOMEDS::SObject_var myHypBranch;
// write applied hypotheses if exist
SALOMEDS::SObject_var myHypBranch;
@@
-1043,7
+1038,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
// write applied algorithms if exist
SALOMEDS::SObject_var myAlgoBranch;
found = gotBranch->FindSubObject( GetRefOnAppliedAlgorithmsTag(), myAlgoBranch );
// write applied algorithms if exist
SALOMEDS::SObject_var myAlgoBranch;
found = gotBranch->FindSubObject( GetRefOnAppliedAlgorithmsTag(), myAlgoBranch );
- if ( found && !shapeRefFound ) { // remove applied
hyp
s
+ if ( found && !shapeRefFound ) { // remove applied
algo
s
myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
}
if ( found && shapeRefFound ) {
myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch );
}
if ( found && shapeRefFound ) {
@@
-1112,7
+1107,7
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
mySMESHDSMesh->GetHypothesis( S );
list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
while ( hyp != hypList.end() ) {
mySMESHDSMesh->GetHypothesis( S );
list<const SMESHDS_Hypothesis*>::const_iterator hyp = hypList.begin();
while ( hyp != hypList.end() ) {
- int hypID = (*hyp++)->GetID(); // goto next here because
+ int hypID = (*hyp++)->GetID(); // goto next h
yp h
ere because
myLocMesh.RemoveHypothesis( S, hypID ); // hypList changes here
}
}
myLocMesh.RemoveHypothesis( S, hypID ); // hypList changes here
}
}
@@
-1251,7
+1246,8
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
}
}
// All sub-meshes will be stored in MED file
}
}
// All sub-meshes will be stored in MED file
- myWriter.AddAllSubMeshes();
+ if ( shapeRefFound )
+ myWriter.AddAllSubMeshes();
// groups root sub-branch
SALOMEDS::SObject_var myGroupsBranch;
// groups root sub-branch
SALOMEDS::SObject_var myGroupsBranch;
@@
-1347,6
+1343,11
@@
SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
// Flush current mesh information into MED file
myWriter.Perform();
// Flush current mesh information into MED file
myWriter.Perform();
+ // maybe a shape was deleted in the study
+ if ( !shapeRefFound && !mySMESHDSMesh->ShapeToMesh().IsNull() ) {
+ TopoDS_Shape nullShape;
+ myLocMesh.ShapeToMesh( nullShape ); // remove shape referring data
+ }
// Store node positions on sub-shapes (SMDS_Position):
// Store node positions on sub-shapes (SMDS_Position):
@@
-1878,17
+1879,18
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
}
}
}
}
- // try to get applied
hypothese
s
- if ( aTopGroup->ExistInternalObject( "Applied
Hypothese
s" ) ) {
- aGroup = new HDFgroup( "Applied
Hypothese
s", aTopGroup );
+ // try to get applied
algorithm
s
+ if ( aTopGroup->ExistInternalObject( "Applied
Algorithm
s" ) ) {
+ aGroup = new HDFgroup( "Applied
Algorithm
s", aTopGroup );
aGroup->OpenOnDisk();
aGroup->OpenOnDisk();
- // get number of applied
hypothese
s
+ // get number of applied
algorithm
s
int aNbSubObjects = aGroup->nInternalObjects();
int aNbSubObjects = aGroup->nInternalObjects();
+ if(MYDEBUG) MESSAGE( "VSR - number of applied algos " << aNbSubObjects );
for ( int j = 0; j < aNbSubObjects; j++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aGroup->InternalObjectIndentify( j, name_dataset );
for ( int j = 0; j < aNbSubObjects; j++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aGroup->InternalObjectIndentify( j, name_dataset );
- // check if it is a
hypothesis
- if ( string( name_dataset ).substr( 0,
3 ) == string( "Hyp
" ) ) {
+ // check if it is a
n algorithm
+ if ( string( name_dataset ).substr( 0,
4 ) == string( "Algo
" ) ) {
aDataset = new HDFdataset( name_dataset, aGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
aDataset = new HDFdataset( name_dataset, aGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
@@
-1896,7
+1898,7
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
- // san - it is impossible to recover applied
hypothese
s using their entries within Load() method
+ // san - it is impossible to recover applied
algorithm
s using their entries within Load() method
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
@@
-1915,18
+1917,17
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
aGroup->CloseOnDisk();
}
aGroup->CloseOnDisk();
}
- // try to get applied
algorithm
s
- if ( aTopGroup->ExistInternalObject( "Applied
Algorithm
s" ) ) {
- aGroup = new HDFgroup( "Applied
Algorithm
s", aTopGroup );
+ // try to get applied
hypothese
s
+ if ( aTopGroup->ExistInternalObject( "Applied
Hypothese
s" ) ) {
+ aGroup = new HDFgroup( "Applied
Hypothese
s", aTopGroup );
aGroup->OpenOnDisk();
aGroup->OpenOnDisk();
- // get number of applied
algorithm
s
+ // get number of applied
hypothese
s
int aNbSubObjects = aGroup->nInternalObjects();
int aNbSubObjects = aGroup->nInternalObjects();
- if(MYDEBUG) MESSAGE( "VSR - number of applied algos " << aNbSubObjects );
for ( int j = 0; j < aNbSubObjects; j++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aGroup->InternalObjectIndentify( j, name_dataset );
for ( int j = 0; j < aNbSubObjects; j++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aGroup->InternalObjectIndentify( j, name_dataset );
- // check if it is a
n algorithm
- if ( string( name_dataset ).substr( 0,
4 ) == string( "Algo
" ) ) {
+ // check if it is a
hypothesis
+ if ( string( name_dataset ).substr( 0,
3 ) == string( "Hyp
" ) ) {
aDataset = new HDFdataset( name_dataset, aGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
aDataset = new HDFdataset( name_dataset, aGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
@@
-1934,7
+1935,7
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
- // san - it is impossible to recover applied
algorithm
s using their entries within Load() method
+ // san - it is impossible to recover applied
hypothese
s using their entries within Load() method
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
@@
-2039,25
+2040,25
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
// myReader.GetSubMesh( aSubMeshDS, subid );
// }
// myReader.GetSubMesh( aSubMeshDS, subid );
// }
- // try to get applied
hypothese
s
- if ( aSubGroup->ExistInternalObject( "Applied
Hypothese
s" ) ) {
- // open "applied
hypothese
s" HDF group
- aSubSubGroup = new HDFgroup( "Applied
Hypothese
s", aSubGroup );
+ // try to get applied
algorithm
s
+ if ( aSubGroup->ExistInternalObject( "Applied
Algorithm
s" ) ) {
+ // open "applied
algorithm
s" HDF group
+ aSubSubGroup = new HDFgroup( "Applied
Algorithm
s", aSubGroup );
aSubSubGroup->OpenOnDisk();
aSubSubGroup->OpenOnDisk();
- // get number of applied
hypothese
s
+ // get number of applied
algorithm
s
int aNbSubObjects = aSubSubGroup->nInternalObjects();
for ( int l = 0; l < aNbSubObjects; l++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aSubSubGroup->InternalObjectIndentify( l, name_dataset );
int aNbSubObjects = aSubSubGroup->nInternalObjects();
for ( int l = 0; l < aNbSubObjects; l++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aSubSubGroup->InternalObjectIndentify( l, name_dataset );
- // check if it is a
hypothesis
- if ( string( name_dataset ).substr( 0,
3 ) == string( "Hyp
" ) ) {
+ // check if it is a
n algorithm
+ if ( string( name_dataset ).substr( 0,
4 ) == string( "Algo
" ) ) {
aDataset = new HDFdataset( name_dataset, aSubSubGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
char* refFromFile = new char[ size ];
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
aDataset = new HDFdataset( name_dataset, aSubSubGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
char* refFromFile = new char[ size ];
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
-
+
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
int id = atoi( refFromFile );
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
int id = atoi( refFromFile );
@@
-2072,29
+2073,29
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
}
}
}
}
}
}
- // close "applied
hypothese
s" HDF group
+ // close "applied
algorithm
s" HDF group
aSubSubGroup->CloseOnDisk();
}
aSubSubGroup->CloseOnDisk();
}
-
- // try to get applied
algorithm
s
- if ( aSubGroup->ExistInternalObject( "Applied
Algorithm
s" ) ) {
- // open "applied
algorithm
s" HDF group
- aSubSubGroup = new HDFgroup( "Applied
Algorithm
s", aSubGroup );
+
+ // try to get applied
hypothese
s
+ if ( aSubGroup->ExistInternalObject( "Applied
Hypothese
s" ) ) {
+ // open "applied
hypothese
s" HDF group
+ aSubSubGroup = new HDFgroup( "Applied
Hypothese
s", aSubGroup );
aSubSubGroup->OpenOnDisk();
aSubSubGroup->OpenOnDisk();
- // get number of applied
algorithm
s
+ // get number of applied
hypothese
s
int aNbSubObjects = aSubSubGroup->nInternalObjects();
for ( int l = 0; l < aNbSubObjects; l++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aSubSubGroup->InternalObjectIndentify( l, name_dataset );
int aNbSubObjects = aSubSubGroup->nInternalObjects();
for ( int l = 0; l < aNbSubObjects; l++ ) {
char name_dataset[ HDF_NAME_MAX_LEN+1 ];
aSubSubGroup->InternalObjectIndentify( l, name_dataset );
- // check if it is a
n algorithm
- if ( string( name_dataset ).substr( 0,
4 ) == string( "Algo
" ) ) {
+ // check if it is a
hypothesis
+ if ( string( name_dataset ).substr( 0,
3 ) == string( "Hyp
" ) ) {
aDataset = new HDFdataset( name_dataset, aSubSubGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
char* refFromFile = new char[ size ];
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
aDataset = new HDFdataset( name_dataset, aSubSubGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
char* refFromFile = new char[ size ];
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
-
+
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
int id = atoi( refFromFile );
//SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile );
//CORBA::Object_var hypObject = SObjectToObject( hypSO );
int id = atoi( refFromFile );
@@
-2109,10
+2110,10
@@
bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
}
}
}
}
}
}
- // close "applied
algorithm
s" HDF group
+ // close "applied
hypothese
s" HDF group
aSubSubGroup->CloseOnDisk();
}
aSubSubGroup->CloseOnDisk();
}
-
+
// close submesh HDF group
aSubGroup->CloseOnDisk();
}
// close submesh HDF group
aSubGroup->CloseOnDisk();
}