PAL13473 (Build repetitive mesh):

Set shape to all meshes before hypo assignation
This commit is contained in:
eap 2006-12-08 14:43:46 +00:00
parent b25e607851
commit 48578200ac

View File

@ -2389,6 +2389,32 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
string iorString = GetORB()->object_to_string( myNewMesh ); string iorString = GetORB()->object_to_string( myNewMesh );
int newId = myStudyContext->findId( iorString ); int newId = myStudyContext->findId( iorString );
myStudyContext->mapOldToNew( id, newId ); myStudyContext->mapOldToNew( id, newId );
// try to read and set reference to shape
GEOM::GEOM_Object_var aShapeObject;
if ( aTopGroup->ExistInternalObject( "Ref on shape" ) ) {
// load mesh "Ref on shape" - it's an entry to SObject
aDataset = new HDFdataset( "Ref on shape", aTopGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
char* refFromFile = new char[ size ];
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
if ( strlen( refFromFile ) > 0 ) {
SALOMEDS::SObject_var shapeSO = myCurrentStudy->FindObjectID( refFromFile );
// Make sure GEOM data are loaded first
//loadGeomData( shapeSO->GetFatherComponent() );
CORBA::Object_var shapeObject = SObjectToObject( shapeSO );
if ( !CORBA::is_nil( shapeObject ) ) {
aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject );
if ( !aShapeObject->_is_nil() )
myNewMeshImpl->SetShape( aShapeObject );
}
}
}
} }
} }
} }
@ -2414,6 +2440,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
::SMESH_Mesh& myLocMesh = myNewMeshImpl->GetImpl(); ::SMESH_Mesh& myLocMesh = myNewMeshImpl->GetImpl();
SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS();
GEOM::GEOM_Object_var aShapeObject = myNewMeshImpl->GetShapeToMesh();
bool hasData = false; bool hasData = false;
// get mesh old id // get mesh old id
@ -2439,31 +2466,6 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
} }
} }
// try to read and set reference to shape
GEOM::GEOM_Object_var aShapeObject;
if ( aTopGroup->ExistInternalObject( "Ref on shape" ) ) {
// load mesh "Ref on shape" - it's an entry to SObject
aDataset = new HDFdataset( "Ref on shape", aTopGroup );
aDataset->OpenOnDisk();
size = aDataset->GetSize();
char* refFromFile = new char[ size ];
aDataset->ReadFromDisk( refFromFile );
aDataset->CloseOnDisk();
if ( strlen( refFromFile ) > 0 ) {
SALOMEDS::SObject_var shapeSO = myCurrentStudy->FindObjectID( refFromFile );
// Make sure GEOM data are loaded first
//loadGeomData( shapeSO->GetFatherComponent() );
CORBA::Object_var shapeObject = SObjectToObject( shapeSO );
if ( !CORBA::is_nil( shapeObject ) ) {
aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject );
if ( !aShapeObject->_is_nil() )
myNewMeshImpl->SetShape( aShapeObject );
}
}
}
// try to get applied algorithms // try to get applied algorithms
if ( aTopGroup->ExistInternalObject( "Applied Algorithms" ) ) { if ( aTopGroup->ExistInternalObject( "Applied Algorithms" ) ) {
aGroup = new HDFgroup( "Applied Algorithms", aTopGroup ); aGroup = new HDFgroup( "Applied Algorithms", aTopGroup );