X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_ComputeDlg.cxx;h=429531fd28919106e398c59cf2775f7339b2e467;hp=0a333894788ce449d14d0abe0025461210680dfc;hb=8b8b2deedb4a7c0d3683037a91c1a340e426828c;hpb=38136d541c504d7e558c2a2f954911aaf95446ee diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 0a3338947..429531fd2 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -23,22 +23,20 @@ // #include "SMESHGUI_ComputeDlg.h" +#include "SMDS_Mesh.hxx" +#include "SMDS_SetIterator.hxx" #include "SMESHGUI.h" #include "SMESHGUI_GEOMGenUtils.h" -#include "SMESHGUI_MeshUtils.h" -#include "SMESHGUI_VTKUtils.h" -#include "SMESHGUI_MeshInfosBox.h" #include "SMESHGUI_HypothesesUtils.h" #include "SMESHGUI_MeshEditPreview.h" -#include "SMESHGUI_MeshOrderOp.h" +#include "SMESHGUI_MeshInfosBox.h" #include "SMESHGUI_MeshOrderDlg.h" - +#include "SMESHGUI_MeshOrderOp.h" +#include "SMESHGUI_MeshUtils.h" +#include "SMESHGUI_VTKUtils.h" #include "SMESH_Actor.h" #include "SMESH_ActorUtils.h" -#include -#include - // SALOME GEOM includes #include #include @@ -67,18 +65,17 @@ #include CORBA_SERVER_HEADER(SMESH_Group) // OCCT includes +#include +#include #include +#include +#include #include #include +#include #include #include -#include -#include -#include -#include -#include - #include // Qt includes @@ -490,7 +487,7 @@ namespace SMESH //======================================================================= SMESHGUI_ComputeDlg::SMESHGUI_ComputeDlg( QWidget* parent, bool ForEval ) - : SMESHGUI_Dialog( parent, false, true, Close/* | Help*/ ) + : SMESHGUI_Dialog( parent, false, true, Close | Help ) { QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame()); aDlgLay->setMargin( 0 ); @@ -1485,6 +1482,7 @@ QTableWidget* SMESHGUI_BaseComputeOp::table() SMESHGUI_ComputeOp::SMESHGUI_ComputeOp() : SMESHGUI_BaseComputeOp() { + myHelpFileName = "constructing_meshes_page.html#compute_anchor"; } @@ -1548,13 +1546,12 @@ LightApp_Dialog* SMESHGUI_ComputeOp::dlg() const //================================================================================ SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp() - : SMESHGUI_BaseComputeOp(), - myDlg( 0 ), - myOrderMgr( 0 ), - myActiveDlg( 0 ), - myPreviewDisplayer( 0 ) + : SMESHGUI_BaseComputeOp(), + myDlg( 0 ), + myOrderMgr( 0 ), + myActiveDlg( 0 ), + myPreviewDisplayer( 0 ) { - myHelpFileName = "constructing_meshes_page.html#preview_mesh_anchor"; } //================================================================================ @@ -1595,6 +1592,8 @@ LightApp_Dialog* SMESHGUI_PrecomputeOp::dlg() const void SMESHGUI_PrecomputeOp::startOperation() { + myHelpFileName = "constructing_meshes_page.html#preview_anchor"; // other anchor onCompute() + if ( !myDlg ) { myDlg = new SMESHGUI_PrecomputeDlg( desktop() ); @@ -1729,13 +1728,14 @@ void SMESHGUI_PrecomputeOp::initDialog() void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh, QMap& theModeMap) { - _PTR(SObject) aHypRoot; + if ( !theMesh ) return; + _PTR(SObject) aHypFolder; _PTR(GenericAttribute) anAttr; int aPart = SMESH::Tag_RefOnAppliedAlgorithms; - if ( theMesh && theMesh->FindSubObject( aPart, aHypRoot ) ) + if ( theMesh->FindSubObject( aPart, aHypFolder ) ) { _PTR(ChildIterator) anIter = - SMESH::GetActiveStudyDocument()->NewChildIterator( aHypRoot ); + SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder ); for ( ; anIter->More(); anIter->Next() ) { _PTR(SObject) anObj = anIter->Value(); @@ -1744,16 +1744,60 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh, anObj = aRefObj; else continue; - + if ( anObj->FindAttribute( anAttr, "AttributeName" ) ) { CORBA::Object_var aVar = _CAST(SObject,anObj)->GetObject(); if ( CORBA::is_nil( aVar ) ) continue; - + + SMESH::SMESH_Algo_var algo; + for( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ ) + { + switch(dim) { + case SMESH::DIM_1D: algo = SMESH::SMESH_1D_Algo::_narrow( aVar ); break; + case SMESH::DIM_2D: algo = SMESH::SMESH_2D_Algo::_narrow( aVar ); break; + case SMESH::DIM_3D: algo = SMESH::SMESH_3D_Algo::_narrow( aVar ); break; + default: break; + } + if ( !algo->_is_nil() ) + { + theModeMap[ dim ] = 0; + if ( theModeMap.size() == 3 ) + return; + break; + } + } + } + } + } + + // check sub-meshes + for ( aPart = SMESH::Tag_SubMeshOnEdge; aPart < SMESH::Tag_LastSubMesh; ++aPart ) + { + if ( !theMesh->FindSubObject( aPart, aHypFolder )) + continue; + + _PTR(ChildIterator) anIter = + SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder ); + for ( anIter->InitEx(true); anIter->More(); anIter->Next() ) + { + _PTR(SObject) anObj = anIter->Value(); + _PTR(SObject) aRefObj; + if ( anObj->ReferencedObject( aRefObj ) ) + anObj = aRefObj; + else + continue; + + if ( anObj->FindAttribute( anAttr, "AttributeName" )) + { + CORBA::Object_var aVar = _CAST(SObject,anObj)->GetObject(); + if ( CORBA::is_nil( aVar ) ) + continue; + + SMESH::SMESH_Algo_var algo; for( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ ) { - SMESH::SMESH_Algo_var algo; switch(dim) { case SMESH::DIM_1D: algo = SMESH::SMESH_1D_Algo::_narrow( aVar ); break; case SMESH::DIM_2D: algo = SMESH::SMESH_2D_Algo::_narrow( aVar ); break; @@ -1761,7 +1805,12 @@ void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh, default: break; } if ( !algo->_is_nil() ) + { theModeMap[ dim ] = 0; + if ( theModeMap.size() == 3 ) + return; + break; + } } } } @@ -1781,6 +1830,7 @@ void SMESHGUI_PrecomputeOp::onCompute() myOrderMgr->SetMeshOrder(); myMapShapeId.clear(); myActiveDlg = computeDlg(); + myHelpFileName = "constructing_meshes_page.html#compute_anchor"; computeMesh(); } @@ -1811,7 +1861,7 @@ void SMESHGUI_PrecomputeOp::onCancel() // remove all submeshes for collected shapes QMap::const_iterator it = myMapShapeId.constBegin(); for ( ; it != myMapShapeId.constEnd(); ++it ) - myMesh->ClearSubMesh( *it ); + myMesh->ClearSubMesh( it.key() ); isRestoreOrder = true; } } @@ -1853,19 +1903,19 @@ void SMESHGUI_PrecomputeOp::onPreview() if (myOrderMgr && myOrderMgr->IsOrderChanged()) myOrderMgr->SetMeshOrder(); - // Compute preview of mesh, + // Compute preview of mesh, // i.e. compute mesh till indicated dimension int dim = myDlg->getPreviewMode(); - + SMESH::MemoryReserve aMemoryReserve; - + SMESH::compute_error_array_var aCompErrors; QString aHypErrors; bool computeFailed = true, memoryLack = false; SMESHGUI_ComputeDlg* aCompDlg = computeDlg(); - aCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() ); + aCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() ); SMESHGUI* gui = getSMESHGUI(); SMESH::SMESH_Gen_var gen = gui->GetSMESHGen(); @@ -1965,6 +2015,7 @@ SMESHGUI_PrecomputeDlg::SMESHGUI_PrecomputeDlg( QWidget* parent ) setButtonText( OK, tr( "COMPUTE" ) ); QFrame* main = mainFrame(); + main->setMinimumWidth( 300 ); QVBoxLayout* layout = new QVBoxLayout( main ); @@ -2048,6 +2099,7 @@ SMESHGUI_MeshOrderBox* SMESHGUI_PrecomputeDlg::getMeshOrderBox() const SMESHGUI_EvaluateOp::SMESHGUI_EvaluateOp() : SMESHGUI_BaseComputeOp() { + myHelpFileName = "constructing_meshes_page.html#evaluate_anchor"; }