-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
#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>
+#include <GEOM_wrap.hxx>
// 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 <SVTK_Renderer.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
#include <QButtonGroup>
#include <QCloseEvent>
#include <QTimerEvent>
+#include <QProgressBar>
// VTK includes
#include <vtkProperty.h>
+#include <vtkRenderer.h>
// STL includes
#include <vector>
#include <set>
+#if !defined WIN32 && !defined __APPLE__
+#include <sys/sysinfo.h>
+#endif
+
#define SPACING 6
#define MARGIN 11
#define COLONIZE(str) (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" )
-
-/* OBSOLETE
-static void addSeparator( QWidget* parent )
-{
- QGridLayout* l = qobject_cast<QGridLayout*>( parent->layout() );
- int row = l->rowCount();
- int cols = l->columnCount();
- for ( int i = 0; i < cols; i++ ) {
- QFrame* hline = new QFrame( parent );
- hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
- l->addWidget( hline, row, i );
- }
-}
-*/
+#define __SHAPE_RGB__ 250, 0, 250
enum TCol {
COL_ALGO = 0, COL_SHAPE, COL_ERROR, COL_SHAPEID, COL_PUBLISHED, COL_BAD_MESH, NB_COLUMNS
{
myProperty = vtkProperty::New();
myProperty->SetRepresentationToWireframe();
- myProperty->SetColor( 250, 0, 250 );
- myProperty->SetAmbientColor( 250, 0, 250 );
- myProperty->SetDiffuseColor( 250, 0, 250 );
- //myProperty->SetSpecularColor( 250, 0, 250 );
+ myProperty->SetColor( __SHAPE_RGB__ );
+ myProperty->SetAmbientColor( __SHAPE_RGB__ );
+ myProperty->SetDiffuseColor( __SHAPE_RGB__ );
+ //myProperty->SetSpecularColor( __SHAPE_RGB__ );
myProperty->SetLineWidth( 5 );
}
// -----------------------------------------------------------------------
void Show( int subShapeID, GEOM::GEOM_Object_var aMainShape, bool only = false)
{
SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() );
+ SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
std::string mainEntry;
if ( !aMainShape->_is_nil() )
mainEntry = aMainShape->GetStudyEntry();
TopAbs_ShapeEnum type( aShape.ShapeType() >= TopAbs_WIRE ? TopAbs_EDGE : TopAbs_FACE );
for ( TopExp_Explorer exp( aShape, type ); exp.More(); exp.Next() ) {
//checkTriangulation( exp.Current() );
- if ( GEOM_Actor* anActor = getActor( exp.Current() ))
+ if ( GEOM_Actor* anActor = getActor( exp.Current() ) ) {
+ int UNbIsos = resMgr->integerValue( "Geometry", "iso_number_u", 1);
+ int VNbIsos = resMgr->integerValue( "Geometry", "iso_number_v", 1);
+ int aNbIsos[2] = { UNbIsos ? UNbIsos : 1, VNbIsos ? VNbIsos : 1 };
+ anActor->SetNbIsos( aNbIsos );
myShownActors.push_back( anActor );
+ }
}
if ( type == TopAbs_FACE ) {
for ( TopExp_Explorer exp( aShape, TopAbs_EDGE ); exp.More(); exp.Next() ) {
GEOM_Actor* getActor(const TopoDS_Shape& shape)
{
int index = myIndexToShape.FindIndex( shape ) - 1;
- if ( index < 0 || index >= myActors.size() )
+ if ( index < 0 || index >= (int) myActors.size() )
return 0;
GEOM_Actor* & actor = myActors[ index ];
if ( !actor ) {
actor = GEOM_Actor::New();
if ( actor ) {
actor->SetShape(shape,0,0);
- actor->SetProperty(myProperty);
- actor->SetShadingProperty(myProperty);
- actor->SetWireframeProperty(myProperty);
- actor->SetPreviewProperty(myProperty);
+ // actor->SetProperty(myProperty);
+ // actor->SetShadingProperty(myProperty);
+ // actor->SetWireframeProperty(myProperty);
+ // actor->SetPreviewProperty(myProperty);
actor->PickableOff();
- // if ( shape.ShapeType() == TopAbs_EDGE )
- // actor->SubShapeOn();
+ //
+ actor->SetWidth( myProperty->GetLineWidth() );
+ actor->SetIsosWidth( myProperty->GetLineWidth() );
+ actor->SetIsosColor( __SHAPE_RGB__ );
+ actor->SetColor( __SHAPE_RGB__ );
+ // if ( shape.ShapeType() == TopAbs_EDGE )
+ // actor->SubShapeOn();
myViewWindow->AddActor( actor );
}
}
CASE2TEXT( COMPERR_BAD_SHAPE );
CASE2TEXT( COMPERR_CANCELED );
CASE2TEXT( COMPERR_NO_MESH_ON_SHAPE );
+ CASE2TEXT( COMPERR_BAD_PARMETERS );
case SMESH::COMPERR_ALGO_FAILED:
if ( strlen(comment) == 0 )
text = QObject::tr("COMPERR_ALGO_FAILED");
break;
case SMESH::COMPERR_WARNING:
- return comment ? QString(comment) : QObject::tr("COMPERR_UNKNOWN");
+ text = QObject::tr( (comment && strlen(comment)) ? "COMPERR_WARNING" : "COMPERR_UNKNOWN");
+ break;
default:
text = QString("#%1").arg( -errCode );
}
_PTR(SObject) so = SMESH::FindSObject(aMainShape);
if ( subShapeID == 1 || !so )
return so;
- _PTR(ChildIterator) it;
- if (_PTR(Study) study = SMESH::GetActiveStudyDocument())
- it = study->NewChildIterator(so);
+ _PTR(ChildIterator) it = SMESH::getStudy()->NewChildIterator(so);
_PTR(SObject) subSO;
if ( it ) {
for ( it->InitEx(true); !subSO && it->More(); it->Next() ) {
if ( !geom->_is_nil() ) {
GEOM::ListOfLong_var list = geom->GetSubShapeIndices();
if ( list->length() == 1 && list[0] == subShapeID )
- subSO = it->Value();
+ {
+ GEOM::GEOM_Object_var mainGO = geom->GetMainShape();
+ if ( aMainShape->IsSame( mainGO ))
+ subSO = it->Value();
+ }
}
}
}
}
// -----------------------------------------------------------------------
/*!
- * \brief Return sub-shape by ID
+ * \brief Return sub-shape by ID. WARNING: UnRegister() must be called on a result
*/
GEOM::GEOM_Object_ptr getSubShape( int subShapeID, GEOM::GEOM_Object_var aMainShape)
{
GEOM::GEOM_Object_var aSubShape;
- if ( subShapeID == 1 )
+ if ( subShapeID == 1 ) {
aSubShape = aMainShape;
- else if ( _PTR(SObject) so = getSubShapeSO( subShapeID, aMainShape ))
+ aSubShape->Register();
+ }
+ else if ( _PTR(SObject) so = getSubShapeSO( subShapeID, aMainShape )) {
aSubShape = SMESH::SObjectToInterface<GEOM::GEOM_Object>( so );
- else
+ aSubShape->Register();
+ }
+ else {
aSubShape = SMESH::GetSubShape( aMainShape, subShapeID );
+ // future call of UnRegister() will delete a servant of this new object
+ }
return aSubShape._retn();
}
// -----------------------------------------------------------------------
QString shapeText(int subShapeID, GEOM::GEOM_Object_var aMainShape )
{
QString text;
- if ( _PTR(SObject) aSO = getSubShapeSO( subShapeID, aMainShape ))
- text = aSO->GetName().c_str();
+ if ( _PTR(SObject) aSO = getSubShapeSO( subShapeID, aMainShape )) {
+ text = aSO->GetName().c_str();
+ text += QString(" (%1)").arg( aSO->GetID().c_str() );
+ }
else {
text = QString("#%1").arg( subShapeID );
- QString typeName = shapeTypeName( getSubShape( subShapeID, aMainShape ));
+ GEOM::GEOM_Object_wrap shape = getSubShape( subShapeID, aMainShape );
+ QString typeName = shapeTypeName( shape );
if ( typeName.length() )
text += QString(" (%1)").arg(typeName);
}
foreach( range, selRanges )
{
for ( int row = range.topRow(); row <= range.bottomRow(); ++row )
- rows.append( row );
+ if ( !rows.count( row ))
+ rows.append( row );
}
if ( rows.isEmpty() && table->currentRow() > -1 )
- rows.append( table->currentRow() );
+ if ( !rows.count( table->currentRow() ))
+ rows.append( table->currentRow() );
return rows.count();
}
//=======================================================================
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 );
myShowBtn = new QPushButton(tr("SHOW_SHAPE"), myCompErrorGroup);
myPublishBtn = new QPushButton(tr("PUBLISH_SHAPE"), myCompErrorGroup);
myBadMeshBtn = new QPushButton(tr("SHOW_BAD_MESH"), myCompErrorGroup);
+ myBadMeshToGroupBtn = new QPushButton(tr("GROUP_OF_BAD_MESH"), myCompErrorGroup);
//myTable->setReadOnly( true ); // VSR: check
myTable->setEditTriggers( QAbstractItemView::NoEditTriggers );
myTable->hideColumn( COL_PUBLISHED );
myTable->hideColumn( COL_SHAPEID );
myTable->hideColumn( COL_BAD_MESH );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
myTable->horizontalHeader()->setResizeMode( COL_ERROR, QHeaderView::Interactive );
+#else
+ myTable->horizontalHeader()->setSectionResizeMode( COL_ERROR, QHeaderView::Interactive );
+#endif
myTable->setWordWrap( true );
myTable->horizontalHeader()->setStretchLastSection( true );
myTable->setMinimumWidth( 500 );
QGridLayout* grpLayout = new QGridLayout(myCompErrorGroup);
grpLayout->setSpacing(SPACING);
grpLayout->setMargin(MARGIN);
- grpLayout->addWidget( myWarningLabel, 0, 0, 1, 4 );
- grpLayout->addWidget( myTable, 1, 0, 1, 4 );
- grpLayout->addWidget( myShowBtn, 2, 0 );
- grpLayout->addWidget( myPublishBtn, 2, 1 );
- grpLayout->addWidget( myBadMeshBtn, 2, 2 );
+ grpLayout->addWidget( myWarningLabel, 0, 0, 1, 4 );
+ grpLayout->addWidget( myTable, 1, 0, 1, 4 );
+ grpLayout->addWidget( myShowBtn, 2, 0 );
+ grpLayout->addWidget( myPublishBtn, 2, 1 );
+ grpLayout->addWidget( myBadMeshBtn, 2, 2 );
+ grpLayout->addWidget( myBadMeshToGroupBtn, 2, 3 );
grpLayout->setColumnStretch( 3, 1 );
// Hypothesis definition errors
// add all widgets to aFrame
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
- aLay->setMargin( 0 );
- aLay->setSpacing( 0 );
+ aLay->setMargin( MARGIN );
+ aLay->setSpacing( SPACING );
aLay->addWidget( aPixGrp );
aLay->addWidget( nameBox );
aLay->addWidget( myBriefInfo );
myBadMeshDisplayer = 0;
//myHelpFileName = "/files/about_meshes.htm"; // V3
- myHelpFileName = "about_meshes_page.html"; // V4
+ myHelpFileName = "about_meshes.html"; // V4
}
SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh()
myMesh = SMESH::SMESH_Mesh::_nil();
myMainShape = GEOM::GEOM_Object::_nil();
+ myCurShape = GEOM::GEOM_Object::_nil();
// check selection
LightApp_SelectionMgr *Sel = selectionMgr();
}
myIObject = selected.First();
- myMesh = SMESH::GetMeshByIO(myIObject);
+ CORBA::Object_var anObj = SMESH::IObjectToObject( myIObject );
+
+ myMesh = SMESH::SMESH_Mesh::_narrow(anObj);
+ if ( myMesh->_is_nil() )
+ {
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
+ if ( !aSubMesh->_is_nil() )
+ {
+ myMesh = aSubMesh->GetFather();
+ myCurShape = aSubMesh->GetSubShape();
+ }
+ }
+ else
+ {
+ myCurShape = myMesh->GetShapeToMesh();
+ }
+
if (myMesh->_is_nil()) {
SUIT_MessageBox::warning(desktop(),
tr("SMESH_WRN_WARNING"),
onCancel();
return;
}
+
myMainShape = myMesh->GetShapeToMesh();
SMESHGUI_Operation::startOperation();
//================================================================================
//================================================================================
-SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget *parent,
- SMESH::SMESH_Gen_var gen,
- SMESH::SMESH_Mesh_var mesh,
- GEOM::GEOM_Object_var mainShape)
- : QDialog(parent),
+SMESHGUI_ComputeDlg_QThreadQDialog::
+SMESHGUI_ComputeDlg_QThreadQDialog(QWidget * parent,
+ SMESH::SMESH_Gen_var gen,
+ SMESH::SMESH_Mesh_var mesh,
+ GEOM::GEOM_Object_var mainShape)
+ : QDialog(parent,
+ Qt::WindowSystemMenuHint |
+ Qt::WindowCloseButtonHint |
+ Qt::Dialog |
+ Qt::WindowMaximizeButtonHint),
qthread(gen, mesh, mainShape)
{
// --
- setWindowTitle(tr("Compute"));
- cancelButton = new QPushButton(tr("Cancel"));
+ setWindowTitle(tr("TITLE"));
+ setMinimumWidth( 200 );
+
+ cancelButton = new QPushButton(tr("CANCEL"));
cancelButton->setDefault(true);
+ cancelButton->setCheckable(true);
+
+ QLabel * nbNodesName = new QLabel(tr("SMESH_MESHINFO_NODES"), this );
+ QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this );
+ nbNodesLabel = new QLabel("0", this );
+ nbElemsLabel = new QLabel("0", this );
+#if !defined WIN32 && !defined __APPLE__
+ QLabel * freeRAMName = new QLabel(tr("SMESH_FREERAM"), this );
+ freeRAMLabel = new QLabel("", this );
+#endif
+ progressBar = new QProgressBar(this);
+ progressBar->setMinimum( 0 );
+ progressBar->setMaximum( 1000 );
+
+ QGridLayout* layout = new QGridLayout(this);
+ layout->setMargin( MARGIN );
+ layout->setSpacing( SPACING );
+ int row = 0;
+ layout->addWidget(nbNodesName, row, 0);
+ layout->addWidget(nbNodesLabel, row++, 1);
+ layout->addWidget(nbElemsName, row, 0);
+ layout->addWidget(nbElemsLabel, row++, 1);
+#if !defined WIN32 && !defined __APPLE__
+ layout->addWidget(freeRAMName, row, 0);
+ layout->addWidget(freeRAMLabel, row++, 1);
+#endif
+ layout->addWidget(progressBar, row++, 0, 1, 2);
+ layout->addWidget(cancelButton, row++, 0, 1, 2);
+ adjustSize();
+ update();
+
connect(cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));
- QHBoxLayout *layout = new QHBoxLayout;
- layout->addWidget(cancelButton);
- setLayout(layout);
- resize(200, 50);
// --
- startTimer(30); // 30 millisecs
+ startTimer(300); // millisecs
qthread.start();
}
void SMESHGUI_ComputeDlg_QThreadQDialog::onCancel()
{
qthread.cancel();
-}
+ cancelButton->setText( tr("CANCELING"));
+ cancelButton->setEnabled(false);
+}
void SMESHGUI_ComputeDlg_QThreadQDialog::timerEvent(QTimerEvent *event)
{
+ if ( !cancelButton->isChecked() ) // not yet cancelled
+ progressBar->setValue( progressBar->maximum() * qthread.getMesh()->GetComputeProgress() );
+
if(qthread.isFinished())
- {
- close();
- }
+ {
+ close();
+ }
+ else
+ {
+ nbNodesLabel->setText( QString("%1").arg( qthread.getMesh()->NbNodes() ));
+ nbElemsLabel->setText( QString("%1").arg( qthread.getMesh()->NbElements() ));
+#if !defined WIN32 && !defined __APPLE__
+ struct sysinfo si;
+ const int err = sysinfo( &si );
+ if ( err )
+ freeRAMLabel->setText("");
+ else
+ freeRAMLabel->setText( tr("SMESH_GIGABYTE").arg
+ ( si.freeram * si.mem_unit /1024./1024./1024., 0, 'f', 2 ));
+#endif
+ }
event->accept();
}
void SMESHGUI_ComputeDlg_QThreadQDialog::closeEvent(QCloseEvent *event)
{
if(qthread.isRunning())
- {
+ {
event->ignore();
return;
}
myMesh->Clear();
SUIT_OverrideCursor aWaitCursor;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
- //SMESH::UpdateNulData(myIObject, true);
- bool res;
-#ifdef WITH_SMESH_CANCEL_COMPUTE
- SMESHGUI_ComputeDlg_QThreadQDialog qthreaddialog(desktop(), gen, myMesh, myMainShape);
+ SMESHGUI_ComputeDlg_QThreadQDialog qthreaddialog(desktop(), gen, myMesh, myCurShape);
qthreaddialog.exec();
- res = qthreaddialog.result();
-#else
- res = gen->Compute(myMesh, myMainShape);
-#endif
- if (res)
- computeFailed = false;
+ computeFailed = !qthreaddialog.result();
}
- catch(const SALOME::SALOME_Exception & S_ex){
+ catch(const SALOME::SALOME_Exception & S_ex) {
memoryLack = true;
}
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
// check if there are memory problems
- for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
+ for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
}
- catch(const SALOME::SALOME_Exception & S_ex){
+ catch(const SALOME::SALOME_Exception & S_ex) {
memoryLack = true;
}
// NPAL16631: if ( !memoryLack )
{
- SMESH::ModifiedMesh(aMeshSObj, !computeFailed, myMesh->NbNodes() == 0);
update( UF_ObjBrowser | UF_Model );
// SHOW MESH
// NPAL16631: if ( getSMESHGUI()->automaticUpdate() )
SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
- long newSize = myMesh->NbElements();
bool limitExceeded;
+ long limitSize = resMgr->integerValue( "SMESH", "update_limit", 500000 );
+ int entities = SMESH_Actor::eAllEntity;
+ int hidden = 0;
+ long nbElements = 0;
if ( !memoryLack )
{
- if ( getSMESHGUI()->automaticUpdate( newSize, &limitExceeded ) )
+ // List of objects that will be updated automatically
+ typedef QList< QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) > > TListOf_IDSrc_SObj;
+ TListOf_IDSrc_SObj aListToUpdate;
+ SMESH::SMESH_IDSource_var aMeshObj =
+ SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aMeshSObj );
+ // put Mesh into list
+ aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aMeshObj, aMeshSObj ));
+ SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes();
+ // put SubMeshes into list
+ for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ )
{
- try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- OCC_CATCH_SIGNALS;
-#endif
- SMESH::Update(myIObject, true);
- }
- catch (...) {
+ SMESH::SMESH_subMesh_var sm = aSubMeshes[i];
+ if ( CORBA::is_nil( sm ) ) continue;
+ _PTR(SObject) smSObj = SMESH::ObjectToSObject( sm );
+ if ( !smSObj ) continue;
+ SMESH::SMESH_IDSource_var aSubMeshObj =
+ SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( smSObj );
+ SMESH_Actor *anActor = SMESH::FindActorByObject( aSubMeshObj );
+ if ( anActor && anActor->GetVisibility() )
+ aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aSubMeshObj, smSObj ));
+ }
+ // put Groups into list
+ SMESH::ListOfGroups_var aGroups = myMesh->GetGroups();
+ for ( size_t i = 0; i < aGroups->length(); ++i )
+ {
+ SMESH::SMESH_GroupBase_var aGrp = aGroups[i];
+ if ( CORBA::is_nil( aGrp ) ) continue;
+ SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
+ if ( !aStdGroup->_is_nil() ) continue; // don't update standalone groups
+ _PTR(SObject) aGroupSO = SMESH::FindSObject( aGrp );
+ if ( !aGroupSO ) continue;
+ SMESH::SMESH_IDSource_var aGroupObj =
+ SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aGroupSO );
+ SMESH_Actor *anActor = SMESH::FindActorByObject( aGroupObj );
+ if ( anActor && anActor->GetVisibility() )
+ aListToUpdate.append( TListOf_IDSrc_SObj::value_type( aGroupObj, aGroupSO ));
+ }
+
+ // update mesh, sub-mesh and groups, if it's possible
+ TListOf_IDSrc_SObj::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 {
+ OCC_CATCH_SIGNALS;
+ bool toDisplay = false;
+ if ( !aMesh->_is_nil() ) // display only a mesh
+ {
+ toDisplay = true;
+ SMESH_Actor *anActor = SMESH::FindActorByObject( aMesh );
+ if ( !anActor ) anActor = SMESH::CreateActor( (*anIter).second->GetID().c_str(),
+ /*clearLog =*/ 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 ( SVTK_ViewWindow* vtkWnd = SMESH::GetVtkViewWindow(SMESH::GetActiveWindow() ))
+ if ( vtkWnd->getRenderer() )
+ vtkWnd->getRenderer()->ResetCameraClippingRange();
+
+ 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;
+ if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
+ SMESH::OnVisuException();
+ }
+ else {
+ memoryLack = true;
+ }
}
}
- }
- else if ( limitExceeded )
- {
- long limitSize = resMgr->integerValue( "SMESH", "update_limit", 500000 );
- SUIT_MessageBox::warning( desktop(),
- tr( "SMESH_WRN_WARNING" ),
- tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ).arg( newSize ).arg( limitSize ) );
+ 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();
- if ( Sel )
+ if ( LightApp_SelectionMgr *Sel = selectionMgr() )
{
SALOME_ListIO selected;
selected.Append( myIObject );
if ( memoryLack )
aMemoryReserve.release();
- myCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
+ myCompDlg->setWindowTitle
+ ( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" ));
// SHOW ERRORS
-
+
bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 );
bool noHypoError = ( aHypErrors.isEmpty() );
else
{
bool onlyWarnings = !theNoCompError; // == valid mesh computed but there are errors reported
- for ( int i = 0; i < theCompErrors->length() && onlyWarnings; ++i )
+ for ( CORBA::ULong i = 0; i < theCompErrors->length() && onlyWarnings; ++i )
onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING ||
theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE );
tbl->setColumnWidth( COL_ERROR, 200 );
bool hasBadMesh = false;
- for ( int row = 0; row < theCompErrors->length(); ++row )
+ for ( int row = 0; row < (int) theCompErrors->length(); ++row )
{
SMESH::ComputeError & err = theCompErrors[ row ];
tbl->resizeColumnToContents( COL_SHAPE );
tbl->setWordWrap( true );
- if ( hasBadMesh )
+ if ( hasBadMesh ) {
aCompDlg->myBadMeshBtn->show();
- else
+ aCompDlg->myBadMeshToGroupBtn->show();
+ }
+ else {
aCompDlg->myBadMeshBtn->hide();
-
+ aCompDlg->myBadMeshToGroupBtn->hide();
+ }
tbl->setCurrentCell(0,0);
currentCellChanged(); // to update buttons
}
}
- // show dialog and wait, becase Compute can be invoked from Preview operation
+ // show dialog and wait, because Compute can be invoked from Preview operation
//aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer
aCompDlg->show();
}
void SMESHGUI_BaseComputeOp::onPublishShape()
{
- GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
+ GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
+ GEOM::GEOM_Object_var meshShape = myMesh->GetShapeToMesh();
+ QStringList entryList;
QList<int> rows;
SMESH::getSelectedRows( table(), rows );
int row;
foreach ( row, rows )
{
int curSub = table()->item(row, COL_SHAPEID)->text().toInt();
- GEOM::GEOM_Object_var shape = SMESH::getSubShape( curSub, myMainShape );
+ GEOM::GEOM_Object_wrap shape = SMESH::getSubShape( curSub, myMainShape );
if ( !shape->_is_nil() && ! SMESH::getSubShapeSO( curSub, myMainShape ))
{
if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published
{
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
- SALOMEDS::SObject_var so =
- geomGen->AddInStudy( study, myMainShape, name.toLatin1().data(), GEOM::GEOM_Object::_nil());
+ SALOMEDS::SObject_wrap so = geomGen->AddInStudy( myMainShape,
+ name.toUtf8().data(),
+ GEOM::GEOM_Object::_nil());
// look for myMainShape in the table
for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) {
if ( table()->item( r, COL_SHAPEID )->text() == "1" ) {
if ( so->_is_nil() ) {
- table()->item( r, COL_SHAPE )->setText( so->GetName() );
- table()->item( r, COL_PUBLISHED )->setText( so->GetID() );
+ CORBA::String_var name = so->GetName();
+ CORBA::String_var entry = so->GetID();
+ QString shapeText = QString("%1 (%2)").arg( name.in() ).arg( entry.in() );
+ table()->item( r, COL_SHAPE )->setText( shapeText );
+ table()->item( r, COL_PUBLISHED )->setText( entry.in() );
}
break;
}
if ( curSub == 1 ) continue;
}
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
- SALOMEDS::SObject_var so = geomGen->AddInStudy( study, shape, name.toLatin1().data(), myMainShape);
+ SALOMEDS::SObject_wrap so = geomGen->AddInStudy( shape,
+ name.toUtf8().data(), myMainShape);
if ( !so->_is_nil() ) {
- table()->item( row, COL_SHAPE )->setText( so->GetName() );
- table()->item( row, COL_PUBLISHED )->setText( so->GetID() );
+ CORBA::String_var name = so->GetName();
+ CORBA::String_var entry = so->GetID();
+ 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
}
if ( myBadMeshDisplayer ) delete myBadMeshDisplayer;
myBadMeshDisplayer = new SMESHGUI_MeshEditPreview( view );
SMESH::MeshPreviewStruct_var aMeshData = gen->GetBadInputElements(myMesh,curSub);
- vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3);
- vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
+ double aPointSize = SMESH::GetFloat("SMESH:node_size",3);
+ double aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
vtkProperty* prop = vtkProperty::New();
prop->SetLineWidth( aLineWidth * 3 );
prop->SetPointSize( aPointSize * 3 );
prop->SetColor( 250, 0, 250 );
myBadMeshDisplayer->GetActor()->SetProperty( prop );
- myBadMeshDisplayer->SetData( aMeshData._retn() );
+ myBadMeshDisplayer->SetData( aMeshData.in() );
prop->Delete();
}
}
}
+//================================================================================
+/*!
+ * \brief create groups of bad mesh elements preventing computation of a submesh of current row
+ */
+//================================================================================
+
+void SMESHGUI_BaseComputeOp::onGroupOfBadMesh()
+{
+ QList<int> rows;
+ SMESH::getSelectedRows( table(), rows );
+ int row;
+ foreach ( row, rows )
+ {
+ bool hasBadMesh = ( !table()->item(row, COL_BAD_MESH)->text().isEmpty() );
+ if ( hasBadMesh ) {
+ int curSub = table()->item(rows.front(), COL_SHAPEID)->text().toInt();
+ QString grName = table()->item(rows.front(), COL_SHAPE)->text();
+ if ( grName.isEmpty() ) grName = "bad mesh";
+ else grName = "bad mesh of " + grName;
+ SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
+ SMESH::ListOfGroups_var groups
+ ( gen->MakeGroupsOfBadInputElements(myMesh,curSub,grName.toUtf8().data()) );
+ update( UF_ObjBrowser | UF_Model );
+ if( LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( application() ))
+ {
+ QStringList anEntryList;
+ for ( size_t i = 0; i < groups->length(); ++i )
+ if ( _PTR(SObject) so = SMESH::FindSObject( groups[i] ))
+ anEntryList.append( so->GetID().c_str() );
+
+ if ( !anEntryList.isEmpty())
+ anApp->browseObjects( anEntryList, true, false );
+ }
+ }
+ }
+}
+
//================================================================================
/*!
* \brief SLOT called when a selected cell in table() changed
myCompDlg->myPublishBtn->setEnabled( publishEnable );
myCompDlg->myShowBtn ->setEnabled( showEnable );
myCompDlg->myBadMeshBtn->setEnabled( hasBadMesh && ( nbSelected == 1 ));
+ myCompDlg->myBadMeshToGroupBtn->setEnabled( hasBadMesh && ( nbSelected == 1 ));
}
//================================================================================
SMESHGUI_BaseComputeOp* me = (SMESHGUI_BaseComputeOp*)this;
me->myCompDlg = new SMESHGUI_ComputeDlg( desktop(), false );
// connect signals and slots
- connect(myCompDlg->myShowBtn, SIGNAL (clicked()), SLOT(onPreviewShape()));
- connect(myCompDlg->myPublishBtn, SIGNAL (clicked()), SLOT(onPublishShape()));
- connect(myCompDlg->myBadMeshBtn, SIGNAL (clicked()), SLOT(onShowBadMesh()));
+ connect(myCompDlg->myShowBtn, SIGNAL (clicked()), SLOT(onPreviewShape()));
+ connect(myCompDlg->myPublishBtn, SIGNAL (clicked()), SLOT(onPublishShape()));
+ connect(myCompDlg->myBadMeshBtn, SIGNAL (clicked()), SLOT(onShowBadMesh()));
+ connect(myCompDlg->myBadMeshToGroupBtn, SIGNAL (clicked()), SLOT(onGroupOfBadMesh()));
QTableWidget* aTable = me->table();
connect(aTable, SIGNAL(itemSelectionChanged()), SLOT(currentCellChanged()));
SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
: SMESHGUI_BaseComputeOp()
{
+ myHelpFileName = "constructing_meshes.html#compute-anchor";
}
//================================================================================
/*!
- * \brief Desctructor
+ * \brief Destructor
*/
//================================================================================
//================================================================================
/*!
* \brief Constructor
-*/
+ */
//================================================================================
SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp()
- : SMESHGUI_BaseComputeOp(),
- myDlg( 0 ),
- myOrderMgr( 0 ),
- myActiveDlg( 0 ),
- myPreviewDisplayer( 0 )
+ : SMESHGUI_BaseComputeOp(),
+ myActiveDlg( 0 ),
+ myDlg( 0 ),
+ myPreviewDisplayer( 0 ),
+ myOrderMgr( 0 )
{
- myHelpFileName = "constructing_meshes_page.html#preview_mesh_anchor";
}
//================================================================================
void SMESHGUI_PrecomputeOp::startOperation()
{
+ myHelpFileName = "constructing_meshes.html#preview-anchor"; // other anchor onCompute()
+
if ( !myDlg )
{
myDlg = new SMESHGUI_PrecomputeDlg( desktop() );
QList<int> modes;
QMap<int, int> modeMap;
- _PTR(SObject) pMesh = studyDS()->FindObjectID( myIObject->getEntry() );
+ _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( myIObject->getEntry() );
getAssignedAlgos( pMesh, modeMap );
if ( modeMap.contains( SMESH::DIM_3D ) )
{
myOrderMgr = new SMESHGUI_MeshOrderMgr( myDlg->getMeshOrderBox() );
myOrderMgr->SetMesh( myMesh );
bool isOrder = myOrderMgr->GetMeshOrder(myPrevOrder);
- myDlg->getMeshOrderBox()->setShown(isOrder);
+ myDlg->getMeshOrderBox()->setVisible(isOrder);
if ( !isOrder ) {
delete myOrderMgr;
myOrderMgr = 0;
//================================================================================
/*!
- * \brief detect asigned mesh algorithms
+ * \brief detect assigned mesh algorithms
*/
//================================================================================
-void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
+void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
QMap<int,int>& 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 );
+ _PTR(ChildIterator) anIter = SMESH::getStudy()->NewChildIterator( aHypFolder );
for ( ; anIter->More(); anIter->Next() )
{
_PTR(SObject) anObj = anIter->Value();
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::getStudy()->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;
default: break;
}
if ( !algo->_is_nil() )
+ {
theModeMap[ dim ] = 0;
+ if ( theModeMap.size() == 3 )
+ return;
+ break;
+ }
}
}
}
myOrderMgr->SetMeshOrder();
myMapShapeId.clear();
myActiveDlg = computeDlg();
+ myHelpFileName = "constructing_meshes.html#compute-anchor";
computeMesh();
}
// remove all submeshes for collected shapes
QMap<int,int>::const_iterator it = myMapShapeId.constBegin();
for ( ; it != myMapShapeId.constEnd(); ++it )
- myMesh->ClearSubMesh( *it );
+ myMesh->ClearSubMesh( it.key() );
isRestoreOrder = true;
}
}
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();
SMESH::long_array_var aShapesId = new SMESH::long_array();
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
SMESH::MeshPreviewStruct_var previewData =
gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId);
- SMESH::MeshPreviewStruct* previewRes = previewData._retn();
- if ( previewRes && previewRes->nodesXYZ.length() > 0 )
+ if ( & previewData.in() && previewData->nodesXYZ.length() > 0 )
{
computeFailed = false;
- myPreviewDisplayer->SetData( previewRes );
- // append shape indeces with computed mesh entities
+ myPreviewDisplayer->SetData( previewData );
+ // append shape indices with computed mesh entities
for ( int i = 0, n = aShapesId->length(); i < n; i++ )
myMapShapeId[ aShapesId[ i ] ] = 0;
}
}
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
// check if there are memory problems
- for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
+ for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
}
catch(const SALOME::SALOME_Exception & S_ex){
if ( isShowError )
{
myDlg->hide();
- aCompDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
+ aCompDlg->setWindowTitle
+ ( tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED" ));
showComputeResult( memoryLack, noCompError, aCompErrors, noHypoError, aHypErrors );
}
}
setButtonText( OK, tr( "COMPUTE" ) );
QFrame* main = mainFrame();
+ main->setMinimumWidth( 300 );
QVBoxLayout* layout = new QVBoxLayout( main );
int SMESHGUI_PrecomputeDlg::getPreviewMode() const
{
- return myPreviewMode->currentId();
+ return myPreviewMode->currentId().toInt();
}
//================================================================================
SMESHGUI_EvaluateOp::SMESHGUI_EvaluateOp()
: SMESHGUI_BaseComputeOp()
{
+ myHelpFileName = "constructing_meshes.html#evaluate-anchor";
}
//================================================================================
/*!
- * \brief Desctructor
+ * \brief Destructor
*/
//================================================================================
}
SUIT_OverrideCursor aWaitCursor;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
aRes = gen->Evaluate(myMesh, myMainShape);
}
catch(const SALOME::SALOME_Exception & S_ex){
}
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
}
catch(const SALOME::SALOME_Exception & S_ex){
aMemoryReserve.release();
evaluateFailed = ( aCompErrors->length() > 0 );
- myCompDlg->setWindowTitle(tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED"));
+ myCompDlg->setWindowTitle
+ ( tr( evaluateFailed ? "SMESH_WRN_EVALUATE_FAILED" : "SMESH_EVALUATE_SUCCEED" ));
// SHOW ERRORS
-
+
bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 );
bool noHypoError = ( aHypErrors.isEmpty() );
tbl->setColumnWidth( COL_ERROR, 200 );
bool hasBadMesh = false;
- for ( int row = 0; row < theCompErrors->length(); ++row )
+ for ( int row = 0; row < (int) theCompErrors->length(); ++row )
{
SMESH::ComputeError & err = theCompErrors[ row ];
tbl->setWordWrap( true );
if ( hasBadMesh )
+ {
aCompDlg->myBadMeshBtn->show();
+ aCompDlg->myBadMeshToGroupBtn->show();
+ }
else
+ {
aCompDlg->myBadMeshBtn->hide();
-
+ aCompDlg->myBadMeshToGroupBtn->hide();
+ }
tbl->setCurrentCell(0,0);
currentCellChanged(); // to update buttons
}
}
- // show dialog and wait, becase Compute can be invoked from Preview operation
+ // show dialog and wait, because Compute can be invoked from Preview operation
//aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer
aCompDlg->show();
}