From 733d21856679ea22bf4663c5d5307b2a5f0c6879 Mon Sep 17 00:00:00 2001 From: ptv Date: Fri, 19 Dec 2008 10:42:37 +0000 Subject: [PATCH] fix problem with Preview result when server and client launched as independant processes --- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 5 +++-- src/SMESH_I/SMESH_Gen_i.cxx | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 1ee70b28e..ccac8521a 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1776,10 +1776,11 @@ void SMESHGUI_PrecomputeOp::onPreview() SMESH::MeshPreviewStruct_var previewData = gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId); - if ( previewData.operator->() ) + SMESH::MeshPreviewStruct* previewRes = previewData._retn(); + if ( previewRes && previewRes->nodesXYZ.length() > 0 ) { computeFailed = false; - myPreviewDisplayer->SetData( previewData._retn() ); + myPreviewDisplayer->SetData( previewRes ); // append shape indeces with computed mesh entities for ( int i = 0, n = aShapesId->length(); i < n; i++ ) myMapShapeId[ aShapesId[ i ] ] = 0; diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 56e227039..1441e1bb5 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -1389,7 +1389,7 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM ); - SMESH::MeshPreviewStruct_var result = 0; + SMESH::MeshPreviewStruct_var result = new SMESH::MeshPreviewStruct; try { // get mesh servant SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( theMesh ).in() ); @@ -1413,7 +1413,6 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh int nbShapeId = shapeIds.size(); theShapesId.length( nbShapeId ); // iterates on shapes and collect mesh entities into mesh preview - result = new SMESH::MeshPreviewStruct; TSetOfInt::const_iterator idIt = shapeIds.begin(); TSetOfInt::const_iterator idEnd = shapeIds.end(); std::map< int, int > mapOfShIdNb; -- 2.39.2