From 48578200acb2cb13cb3c3b30aa35f167cf842a7f Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 8 Dec 2006 14:43:46 +0000 Subject: [PATCH] PAL13473 (Build repetitive mesh): Set shape to all meshes before hypo assignation --- src/SMESH_I/SMESH_Gen_i.cxx | 52 +++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 067e88089..9673f56b4 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2389,6 +2389,32 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, string iorString = GetORB()->object_to_string( myNewMesh ); int newId = myStudyContext->findId( iorString ); 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(); SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); + GEOM::GEOM_Object_var aShapeObject = myNewMeshImpl->GetShapeToMesh(); bool hasData = false; // 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 if ( aTopGroup->ExistInternalObject( "Applied Algorithms" ) ) { aGroup = new HDFgroup( "Applied Algorithms", aTopGroup );