mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 18:30:35 +05:00
PAL13330( When mesh generation does not success, trace where )
+ case 701: // Compute mesh + op = new SMESHGUI_ComputeOp(); + break;
This commit is contained in:
parent
665a9c773a
commit
d5f44a9c1d
@ -66,6 +66,7 @@
|
|||||||
#include "SMESHGUI_Displayer.h"
|
#include "SMESHGUI_Displayer.h"
|
||||||
#include "SMESHGUI_MakeNodeAtPointDlg.h"
|
#include "SMESHGUI_MakeNodeAtPointDlg.h"
|
||||||
#include "SMESHGUI_BuildCompoundDlg.h"
|
#include "SMESHGUI_BuildCompoundDlg.h"
|
||||||
|
#include "SMESHGUI_ComputeDlg.h"
|
||||||
|
|
||||||
#include "SMESHGUI_Utils.h"
|
#include "SMESHGUI_Utils.h"
|
||||||
#include "SMESHGUI_GEOMGenUtils.h"
|
#include "SMESHGUI_GEOMGenUtils.h"
|
||||||
@ -1362,82 +1363,83 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
{
|
{
|
||||||
if (checkLock(aStudy)) break;
|
if (checkLock(aStudy)) break;
|
||||||
|
|
||||||
LightApp_SelectionMgr *Sel = selectionMgr();
|
startOperation( 701 );
|
||||||
SALOME_ListIO selected; Sel->selectedObjects( selected );
|
// LightApp_SelectionMgr *Sel = selectionMgr();
|
||||||
|
// SALOME_ListIO selected; Sel->selectedObjects( selected );
|
||||||
|
|
||||||
int nbSel = selected.Extent();
|
// int nbSel = selected.Extent();
|
||||||
if (nbSel != 1) {
|
// if (nbSel != 1) {
|
||||||
SUIT_MessageBox::warn1(desktop(),
|
// SUIT_MessageBox::warn1(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
// tr("SMESH_WRN_WARNING"),
|
||||||
tr("SMESH_WRN_NO_AVAILABLE_DATA"),
|
// tr("SMESH_WRN_NO_AVAILABLE_DATA"),
|
||||||
tr("SMESH_BUT_OK"));
|
// tr("SMESH_BUT_OK"));
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
|
|
||||||
SMESH::SMESH_Mesh_var aMesh;
|
// SMESH::SMESH_Mesh_var aMesh;
|
||||||
SMESH::SMESH_subMesh_var aSubMesh;
|
// SMESH::SMESH_subMesh_var aSubMesh;
|
||||||
Handle(SALOME_InteractiveObject) IObject = selected.First();
|
// Handle(SALOME_InteractiveObject) IObject = selected.First();
|
||||||
if (IObject->hasEntry()) {
|
// if (IObject->hasEntry()) {
|
||||||
_PTR(SObject) aMeshSObj = aStudy->FindObjectID(IObject->getEntry());
|
// _PTR(SObject) aMeshSObj = aStudy->FindObjectID(IObject->getEntry());
|
||||||
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh( aMeshSObj );
|
// GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh( aMeshSObj );
|
||||||
if ( aShapeObject->_is_nil() ) {
|
// if ( aShapeObject->_is_nil() ) {
|
||||||
// imported mesh
|
// // imported mesh
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
if ( aMeshSObj ) {
|
// if ( aMeshSObj ) {
|
||||||
aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>(aMeshSObj);
|
// aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>(aMeshSObj);
|
||||||
aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>(aMeshSObj);
|
// aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>(aMeshSObj);
|
||||||
if ( !aSubMesh->_is_nil() )
|
// if ( !aSubMesh->_is_nil() )
|
||||||
aMesh = aSubMesh->GetFather();
|
// aMesh = aSubMesh->GetFather();
|
||||||
|
|
||||||
if (!aMesh->_is_nil()) {
|
// if (!aMesh->_is_nil()) {
|
||||||
SMESH::algo_error_array_var errors = GetSMESHGen()->GetAlgoState(aMesh,aShapeObject);
|
// SMESH::algo_error_array_var errors = GetSMESHGen()->GetAlgoState(aMesh,aShapeObject);
|
||||||
if ( errors->length() > 0 ) {
|
// if ( errors->length() > 0 ) {
|
||||||
SUIT_MessageBox::warn1(desktop(),
|
// SUIT_MessageBox::warn1(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
// tr("SMESH_WRN_WARNING"),
|
||||||
SMESH::GetMessageOnAlgoStateErrors( errors.in() ),
|
// SMESH::GetMessageOnAlgoStateErrors( errors.in() ),
|
||||||
tr("SMESH_BUT_OK"));
|
// tr("SMESH_BUT_OK"));
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
if (GetSMESHGen()->Compute(aMesh, aShapeObject))
|
// if (GetSMESHGen()->Compute(aMesh, aShapeObject))
|
||||||
SMESH::ModifiedMesh(aMeshSObj, true);
|
// SMESH::ModifiedMesh(aMeshSObj, true);
|
||||||
else
|
// else
|
||||||
SUIT_MessageBox::warn1(desktop(),
|
// SUIT_MessageBox::warn1(desktop(),
|
||||||
tr("SMESH_WRN_WARNING"),
|
// tr("SMESH_WRN_WARNING"),
|
||||||
tr("SMESH_WRN_COMPUTE_FAILED"),
|
// tr("SMESH_WRN_COMPUTE_FAILED"),
|
||||||
tr("SMESH_BUT_OK"));
|
// tr("SMESH_BUT_OK"));
|
||||||
}
|
// }
|
||||||
catch(const SALOME::SALOME_Exception & S_ex){
|
// catch(const SALOME::SALOME_Exception & S_ex){
|
||||||
SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
// SalomeApp_Tools::QtCatchCorbaException(S_ex);
|
||||||
}
|
// }
|
||||||
|
|
||||||
updateObjBrowser();
|
// updateObjBrowser();
|
||||||
|
|
||||||
if (automaticUpdate()) {
|
// if (automaticUpdate()) {
|
||||||
SVTK_ViewWindow* aVTKView = SMESH::GetViewWindow(this, /*create*/true);
|
// SVTK_ViewWindow* aVTKView = SMESH::GetViewWindow(this, /*create*/true);
|
||||||
if (aVTKView) {
|
// if (aVTKView) {
|
||||||
CORBA::Long anId = aStudy->StudyId();
|
// CORBA::Long anId = aStudy->StudyId();
|
||||||
TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId, IObject->getEntry());
|
// TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId, IObject->getEntry());
|
||||||
if (aVisualObj) {
|
// if (aVisualObj) {
|
||||||
aVisualObj->Update();
|
// aVisualObj->Update();
|
||||||
SMESH_Actor* anActor = SMESH::FindActorByEntry(IObject->getEntry());
|
// SMESH_Actor* anActor = SMESH::FindActorByEntry(IObject->getEntry());
|
||||||
if (!anActor) {
|
// if (!anActor) {
|
||||||
anActor = SMESH::CreateActor(aStudy, IObject->getEntry());
|
// anActor = SMESH::CreateActor(aStudy, IObject->getEntry());
|
||||||
if (anActor) {
|
// if (anActor) {
|
||||||
SMESH::DisplayActor(aVTKView, anActor); //apo
|
// SMESH::DisplayActor(aVTKView, anActor); //apo
|
||||||
SMESH::FitAll();
|
// SMESH::FitAll();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
SMESH::RepaintCurrentView();
|
// SMESH::RepaintCurrentView();
|
||||||
Sel->setSelectedObjects( selected );
|
// Sel->setSelectedObjects( selected );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3355,6 +3357,9 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const
|
|||||||
// to do : create operation here
|
// to do : create operation here
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
|
case 701: // Compute mesh
|
||||||
|
op = new SMESHGUI_ComputeOp();
|
||||||
|
break;
|
||||||
case 702: // Create mesh
|
case 702: // Create mesh
|
||||||
op = new SMESHGUI_MeshOp( true, true );
|
op = new SMESHGUI_MeshOp( true, true );
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user