-// 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
//
#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 <SMDS_SetIterator.hxx>
-#include <SMDS_Mesh.hxx>
-
// SALOME GEOM includes
#include <GEOMBase.h>
#include <GEOM_Actor.h>
// SALOME GUI includes
#include <LightApp_SelectionMgr.h>
#include <LightApp_UpdateFlags.h>
+#include <QtxComboBox.h>
#include <SALOME_ListIO.hxx>
-#include <SVTK_ViewWindow.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
#include <SalomeApp_Application.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_OverrideCursor.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_Desktop.h>
-#include <QtxComboBox.h>
// SALOME KERNEL includes
#include <SALOMEDS_SObject.hxx>
#include <SALOMEDSClient_SObject.hxx>
#include <SALOMEDS_wrap.hxx>
+#include "utilities.h"
#include CORBA_SERVER_HEADER(SMESH_Group)
// OCCT includes
+#include <BRepBndLib.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
#include <BRep_Tool.hxx>
+#include <Bnd_Box.hxx>
+#include <Poly_Triangulation.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopLoc_Location.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS.hxx>
-#include <TopLoc_Location.hxx>
-#include <Poly_Triangulation.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <BRepMesh_IncrementalMesh.hxx>
-
#include <Standard_ErrorHandler.hxx>
// Qt includes
//=======================================================================
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 );
long nbElements = 0;
if ( !memoryLack )
{
- // List of objects that will be updated automatically
+ // List of objects that will be updated automatically
QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > aListToUpdate;
SMESH::SMESH_IDSource_var aMeshObj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aMeshSObj );
// put Mesh into list
// update mesh, sub-mesh and groups, if it's possible
QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > >::iterator anIter;
for( anIter = aListToUpdate.begin(); anIter != aListToUpdate.end(); anIter++ ) {
- SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second ));
- if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded, &hidden, &nbElements ) )
- {
- try {
+ SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( (*anIter).second ));
+ if ( getSMESHGUI()->automaticUpdate( (*anIter).first, &entities, &limitExceeded, &hidden, &nbElements ) )
+ {
+ try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- OCC_CATCH_SIGNALS;
+ OCC_CATCH_SIGNALS;
#endif
- bool toDisplay = false;
-
- if ( !aMesh->_is_nil() ) { // display a mesh only
- toDisplay = true;
- SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
- if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(), (*anIter).second->GetID().c_str(), true );
- if ( anActor ) // actor is not created for an empty mesh
- {
- anActor->SetEntityMode( entities );
- SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor );
- }
- }
- Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
- ( (*anIter).second->GetID().c_str(), "SMESH", (*anIter).second->GetName().c_str() );
- SMESH::Update(anIO, toDisplay);
-
- if ( limitExceeded && !aMesh->_is_nil() )
- {
- QStringList hiddenMsg;
- if ( hidden & SMESH_Actor::e0DElements ) hiddenMsg << tr( "SMESH_ELEMS0D" );
- if ( hidden & SMESH_Actor::eEdges ) hiddenMsg << tr( "SMESH_EDGES" );
- if ( hidden & SMESH_Actor::eFaces ) hiddenMsg << tr( "SMESH_FACES" );
- if ( hidden & SMESH_Actor::eVolumes ) hiddenMsg << tr( "SMESH_VOLUMES" );
- if ( hidden & SMESH_Actor::eBallElem ) hiddenMsg << tr( "SMESH_BALLS" );
- SUIT_MessageBox::warning( desktop(),
- tr( "SMESH_WRN_WARNING" ),
- tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ).arg( hiddenMsg.join(", ") ) );
- }
- }
- catch (...) {
+ bool toDisplay = false;
+
+ if ( !aMesh->_is_nil() ) { // display a mesh only
+ toDisplay = true;
+ SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
+ if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetStudy(), (*anIter).second->GetID().c_str(), true );
+ if ( anActor ) // actor is not created for an empty mesh
+ {
+ anActor->SetEntityMode( entities );
+ SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor );
+ }
+ }
+ Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
+ ( (*anIter).second->GetID().c_str(), "SMESH", (*anIter).second->GetName().c_str() );
+ SMESH::Update(anIO, toDisplay);
+
+ if ( limitExceeded && !aMesh->_is_nil() )
+ {
+ QStringList hiddenMsg;
+ if ( hidden & SMESH_Actor::e0DElements ) hiddenMsg << tr( "SMESH_ELEMS0D" );
+ if ( hidden & SMESH_Actor::eEdges ) hiddenMsg << tr( "SMESH_EDGES" );
+ if ( hidden & SMESH_Actor::eFaces ) hiddenMsg << tr( "SMESH_FACES" );
+ if ( hidden & SMESH_Actor::eVolumes ) hiddenMsg << tr( "SMESH_VOLUMES" );
+ if ( hidden & SMESH_Actor::eBallElem ) hiddenMsg << tr( "SMESH_BALLS" );
+ SUIT_MessageBox::warning( desktop(),
+ tr( "SMESH_WRN_WARNING" ),
+ tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ).arg( hiddenMsg.join(", ") ) );
+ }
+ }
+ catch (...) {
#ifdef _DEBUG_
- MESSAGE ( "Exception thrown during mesh visualization" );
+ MESSAGE ( "Exception thrown during mesh visualization" );
#endif
- if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
- SMESH::OnVisuException();
- }
- else {
- memoryLack = true;
- }
- }
- }
- else if ( limitExceeded && !aMesh->_is_nil() )
- {
- SUIT_MessageBox::warning( desktop(),
- tr( "SMESH_WRN_WARNING" ),
- tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ) );
- }
+ if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
+ SMESH::OnVisuException();
+ }
+ else {
+ memoryLack = true;
+ }
+ }
+ }
+ else if ( limitExceeded && !aMesh->_is_nil() )
+ {
+ SUIT_MessageBox::warning( desktop(),
+ tr( "SMESH_WRN_WARNING" ),
+ tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( nbElements ).arg( limitSize ) );
+ }
}
}
LightApp_SelectionMgr *Sel = selectionMgr();
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
+ QStringList entryList;
QList<int> rows;
SMESH::getSelectedRows( table(), rows );
int row;
QString shapeText = QString("%1 (%2)").arg( name.in() ).arg( entry.in() );
table()->item( row, COL_SHAPE )->setText( shapeText );
table()->item( row, COL_PUBLISHED )->setText( entry.in() );
+ entryList.push_back( entry.in() );
}
}
}
getSMESHGUI()->getApp()->updateObjectBrowser();
+ getSMESHGUI()->getApp()->browseObjects( entryList, /*isApplyAndClose=*/true );
+
currentCellChanged(); // to update buttons
}
SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
: SMESHGUI_BaseComputeOp()
{
+ myHelpFileName = "constructing_meshes_page.html#compute_anchor";
}
myActiveDlg( 0 ),
myPreviewDisplayer( 0 )
{
- myHelpFileName = "constructing_meshes_page.html#preview_mesh_anchor";
}
//================================================================================
void SMESHGUI_PrecomputeOp::startOperation()
{
+ myHelpFileName = "constructing_meshes_page.html#preview_anchor"; // other anchor onCompute()
+
if ( !myDlg )
{
myDlg = new SMESHGUI_PrecomputeDlg( desktop() );
myOrderMgr->SetMeshOrder();
myMapShapeId.clear();
myActiveDlg = computeDlg();
+ myHelpFileName = "constructing_meshes_page.html#compute_anchor";
computeMesh();
}
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();
SMESHGUI_EvaluateOp::SMESHGUI_EvaluateOp()
: SMESHGUI_BaseComputeOp()
{
+ myHelpFileName = "constructing_meshes_page.html#evaluate_anchor";
}