1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SMESHGUI_ComputeDlg.cxx
21 // Author : Edward AGAPOV, Open CASCADE S.A.S.
25 #include "SMESHGUI_ComputeDlg.h"
28 #include "SMESHGUI_GEOMGenUtils.h"
29 #include "SMESHGUI_MeshUtils.h"
30 #include "SMESHGUI_VTKUtils.h"
31 #include "SMESHGUI_HypothesesUtils.h"
32 #include "SMESHGUI_MeshEditPreview.h"
33 #include "SMESH_ActorUtils.h"
35 #include <SMDS_SetIterator.hxx>
36 #include <SMDS_Mesh.hxx>
38 // SALOME GEOM includes
40 #include <GEOM_Actor.h>
42 // SALOME GUI includes
43 #include <LightApp_SelectionMgr.h>
44 #include <LightApp_UpdateFlags.h>
45 #include <SALOME_ListIO.hxx>
46 #include <SVTK_ViewWindow.h>
47 #include <SVTK_ViewModel.h>
48 #include <SalomeApp_Application.h>
49 #include <SUIT_ResourceMgr.h>
50 #include <SUIT_OverrideCursor.h>
51 #include <SUIT_MessageBox.h>
52 #include <SUIT_Desktop.h>
54 // SALOME KERNEL includes
55 #include <SALOMEDSClient_SObject.hxx>
58 #include <BRep_Tool.hxx>
60 #include <TopExp_Explorer.hxx>
61 #include <TopTools_IndexedMapOfShape.hxx>
64 #include <TopLoc_Location.hxx>
65 #include <Poly_Triangulation.hxx>
66 #include <Bnd_Box.hxx>
67 #include <BRepBndLib.hxx>
68 #include <BRepMesh_IncrementalMesh.hxx>
70 #include <Standard_ErrorHandler.hxx>
74 #include <QPushButton>
76 #include <QRadioButton>
77 #include <QTableWidget>
78 #include <QHeaderView>
79 #include <QGridLayout>
80 #include <QHBoxLayout>
81 #include <QVBoxLayout>
82 #include <QButtonGroup>
85 #include <vtkProperty.h>
88 #include <SALOMEconfig.h>
89 #include CORBA_SERVER_HEADER(SMESH_Gen)
98 #define COLONIZE(str) (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" )
100 static void addSeparator( QWidget* parent )
102 QGridLayout* l = qobject_cast<QGridLayout*>( parent->layout() );
103 int row = l->rowCount();
104 int cols = l->columnCount();
105 for ( int i = 0; i < cols; i++ ) {
106 QFrame* hline = new QFrame( parent );
107 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
108 l->addWidget( hline, row, i );
113 COL_ALGO = 0, COL_SHAPE, COL_ERROR, COL_SHAPEID, COL_PUBLISHED, COL_BAD_MESH, NB_COLUMNS
116 //using namespace SMESH;
120 //=============================================================================
122 * \brief Allocate some memory at construction and release it at destruction.
123 * Is used to be able to continue working after mesh generation or visualization
124 * break due to lack of memory
126 //=============================================================================
131 MemoryReserve(): myBuf( new char[1024*1024*1] ){} // 1M
132 void release() { delete [] myBuf; myBuf = 0; }
133 ~MemoryReserve() { release(); }
136 // =========================================================================================
138 * \brief Class showing shapes without publishing
140 // =========================================================================================
142 class TShapeDisplayer
145 // -----------------------------------------------------------------------
146 TShapeDisplayer(): myViewWindow(0)
148 myProperty = vtkProperty::New();
149 myProperty->SetRepresentationToWireframe();
150 myProperty->SetColor( 250, 0, 250 );
151 myProperty->SetAmbientColor( 250, 0, 250 );
152 myProperty->SetDiffuseColor( 250, 0, 250 );
153 //myProperty->SetSpecularColor( 250, 0, 250 );
154 myProperty->SetLineWidth( 5 );
156 // -----------------------------------------------------------------------
160 myProperty->Delete();
162 // -----------------------------------------------------------------------
165 if ( hasViewWindow() ) {
166 TActorIterator actorIt = actorIterator();
167 while ( actorIt.more() )
168 if (VTKViewer_Actor* anActor = actorIt.next()) {
169 myViewWindow->RemoveActor( anActor );
173 myIndexToShape.Clear();
175 myShownActors.clear();
178 // -----------------------------------------------------------------------
179 void SetVisibility (bool theVisibility)
181 TActorIterator actorIt = shownIterator();
182 while ( actorIt.more() )
183 if (VTKViewer_Actor* anActor = actorIt.next())
184 anActor->SetVisibility(theVisibility);
185 SMESH::RepaintCurrentView();
187 // -----------------------------------------------------------------------
188 bool HasReadyActorsFor (int subShapeID, GEOM::GEOM_Object_var aMainShape )
190 std::string mainEntry;
191 if ( !aMainShape->_is_nil() )
192 mainEntry = aMainShape->GetStudyEntry();
193 return ( myMainEntry == mainEntry &&
194 myBuiltSubs.find( subShapeID ) != myBuiltSubs.end() );
196 // -----------------------------------------------------------------------
197 void Show( int subShapeID, GEOM::GEOM_Object_var aMainShape, bool only = false)
199 SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() );
200 std::string mainEntry;
201 if ( !aMainShape->_is_nil() )
202 mainEntry = aMainShape->GetStudyEntry();
203 if ( myMainEntry != mainEntry || aViewWindow != myViewWindow ) { // remove actors
206 if ( !aMainShape->_is_nil() && GEOMBase::GetShape(aMainShape, aShape)) {
207 checkTriangulation( aShape );
208 TopExp::MapShapes(aShape, myIndexToShape);
209 myActors.resize( myIndexToShape.Extent(), 0 );
210 myShownActors.reserve( myIndexToShape.Extent() );
212 myMainEntry = mainEntry;
213 myViewWindow = aViewWindow;
215 if ( only ) { // hide shown actors
216 TActorIterator actorIt = shownIterator();
217 while ( actorIt.more() )
218 if (VTKViewer_Actor* anActor = actorIt.next())
219 anActor->SetVisibility(false);
220 myShownActors.clear();
222 // find actors to show
223 TopoDS_Shape aShape = myIndexToShape( subShapeID );
224 if ( !aShape.IsNull() ) {
225 TopAbs_ShapeEnum type( aShape.ShapeType() >= TopAbs_WIRE ? TopAbs_EDGE : TopAbs_FACE );
226 for ( TopExp_Explorer exp( aShape, type ); exp.More(); exp.Next() ) {
227 //checkTriangulation( exp.Current() );
228 if ( GEOM_Actor* anActor = getActor( exp.Current() ))
229 myShownActors.push_back( anActor );
231 if ( type == TopAbs_FACE ) {
232 for ( TopExp_Explorer exp( aShape, TopAbs_EDGE ); exp.More(); exp.Next() ) {
233 const TopoDS_Edge & edge = TopoDS::Edge( exp.Current() );
234 if ( !BRep_Tool::Degenerated( edge ))
235 if ( GEOM_Actor* anActor = getActor( exp.Current() ))
236 myShownActors.push_back( anActor );
240 myBuiltSubs.insert( subShapeID );
243 // -----------------------------------------------------------------------
247 typedef std::vector<GEOM_Actor*> TActorVec;
249 TActorVec myShownActors;
250 TopTools_IndexedMapOfShape myIndexToShape;
251 std::string myMainEntry;
252 SVTK_ViewWindow* myViewWindow;
253 vtkProperty* myProperty;
254 std::set<int> myBuiltSubs;
256 // -----------------------------------------------------------------------
257 typedef SMDS_SetIterator< GEOM_Actor*, TActorVec::const_iterator> TActorIterator;
258 TActorIterator actorIterator() {
259 return TActorIterator( myActors.begin(), myActors.end() );
261 TActorIterator shownIterator() {
262 return TActorIterator( myShownActors.begin(), myShownActors.end() );
264 // -----------------------------------------------------------------------
265 GEOM_Actor* getActor(const TopoDS_Shape& shape)
267 int index = myIndexToShape.FindIndex( shape ) - 1;
268 if ( index < 0 || index >= myActors.size() )
270 GEOM_Actor* & actor = myActors[ index ];
272 actor = GEOM_Actor::New();
274 actor->SetShape(shape,0,0);
275 actor->SetProperty(myProperty);
276 actor->SetShadingProperty(myProperty);
277 actor->SetWireframeProperty(myProperty);
278 actor->SetPreviewProperty(myProperty);
279 actor->PickableOff();
280 // if ( shape.ShapeType() == TopAbs_EDGE )
281 // actor->SubShapeOn();
282 myViewWindow->AddActor( actor );
287 // -----------------------------------------------------------------------
288 void checkTriangulation(const TopoDS_Shape& shape)
290 TopLoc_Location aLoc;
291 Standard_Boolean alreadymesh = Standard_True;
292 TopExp_Explorer ex(shape, TopAbs_FACE);
294 for ( ; ex.More(); ex.Next()) {
295 const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
296 Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
297 if(aPoly.IsNull()) { alreadymesh = Standard_False; break; }
300 for (ex.Init(shape, TopAbs_EDGE); ex.More(); ex.Next()) {
301 const TopoDS_Edge& edge = TopoDS::Edge(ex.Current());
302 Handle(Poly_Polygon3D) aPoly = BRep_Tool::Polygon3D(edge, aLoc);
303 if(aPoly.IsNull()) { alreadymesh = Standard_False; break; }
305 if (alreadymesh) return;
306 // Compute default deflection
308 BRepBndLib::Add(shape, B);
309 Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
310 B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
311 double deflection = Max( aXmax-aXmin, Max ( aYmax-aYmin, aZmax-aZmin)) * 0.01 *4;
312 BRepMesh_IncrementalMesh MESH(shape,deflection);
314 // -----------------------------------------------------------------------
315 bool hasViewWindow() const
317 if ( !myViewWindow ) return false;
319 if ( SalomeApp_Application* anApp = SMESHGUI::GetSMESHGUI()->getApp() )
320 return FindVtkViewWindow( anApp->getViewManager(SVTK_Viewer::Type(), false ),
326 // =========================================================================================
328 * \brief Return text describing an error
330 #define CASE2TEXT(enum) case SMESH::enum: text = QObject::tr( #enum ); break;
331 QString errorText(int errCode, const char* comment)
335 CASE2TEXT( COMPERR_OK );
336 CASE2TEXT( COMPERR_BAD_INPUT_MESH);
337 CASE2TEXT( COMPERR_STD_EXCEPTION );
338 CASE2TEXT( COMPERR_OCC_EXCEPTION );
339 case SMESH::COMPERR_SLM_EXCEPTION: break; // avoid double "Salome exception"
340 CASE2TEXT( COMPERR_EXCEPTION );
341 CASE2TEXT( COMPERR_MEMORY_PB );
342 CASE2TEXT( COMPERR_BAD_SHAPE );
343 case SMESH::COMPERR_ALGO_FAILED:
344 if ( strlen(comment) == 0 )
345 text = QObject::tr("COMPERR_ALGO_FAILED");
348 text = QString("#%1").arg( -errCode );
350 if ( text.length() > 0 ) text += ". ";
351 return text + comment;
353 // -----------------------------------------------------------------------
355 * \brief Return SO of a subshape
357 _PTR(SObject) getSubShapeSO( int subShapeID, GEOM::GEOM_Object_var aMainShape)
359 _PTR(SObject) so = SMESH::FindSObject(aMainShape);
360 if ( subShapeID == 1 || !so )
362 _PTR(ChildIterator) it;
363 if (_PTR(Study) study = SMESH::GetActiveStudyDocument())
364 it = study->NewChildIterator(so);
367 for ( it->InitEx(true); !subSO && it->More(); it->Next() ) {
368 GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( it->Value() );
369 if ( !geom->_is_nil() ) {
370 GEOM::ListOfLong_var list = geom->GetSubShapeIndices();
371 if ( list->length() == 1 && list[0] == subShapeID )
378 // -----------------------------------------------------------------------
380 * \brief Return subshape by ID
382 GEOM::GEOM_Object_ptr getSubShape( int subShapeID, GEOM::GEOM_Object_var aMainShape)
384 GEOM::GEOM_Object_var aSubShape;
385 if ( subShapeID == 1 )
386 aSubShape = aMainShape;
387 else if ( _PTR(SObject) so = getSubShapeSO( subShapeID, aMainShape ))
388 aSubShape = SMESH::SObjectToInterface<GEOM::GEOM_Object>( so );
390 aSubShape = SMESH::GetSubShape( aMainShape, subShapeID );
391 return aSubShape._retn();
393 // -----------------------------------------------------------------------
395 * \brief Return shape type name
397 #define CASE2NAME(enum) case GEOM::enum: name = QObject::tr( "GEOM_" #enum ); break;
398 QString shapeTypeName(GEOM::GEOM_Object_var aShape, const char* dflt = "" )
401 if ( !aShape->_is_nil() ) {
402 switch ( aShape->GetShapeType() ) {
409 CASE2NAME( COMPSOLID );
410 CASE2NAME( COMPOUND );
416 // -----------------------------------------------------------------------
418 * \brief Return text describing a subshape
420 QString shapeText(int subShapeID, GEOM::GEOM_Object_var aMainShape )
423 if ( _PTR(SObject) aSO = getSubShapeSO( subShapeID, aMainShape ))
424 text = aSO->GetName().c_str();
426 text = QString("#%1").arg( subShapeID );
427 QString typeName = shapeTypeName( getSubShape( subShapeID, aMainShape ));
428 if ( typeName.length() )
429 text += QString(" (%1)").arg(typeName);
433 // -----------------------------------------------------------------------
435 * \brief Return a list of selected rows
437 int getSelectedRows(QTableWidget* table, QList<int>& rows)
440 QList<QTableWidgetSelectionRange> selRanges = table->selectedRanges();
441 QTableWidgetSelectionRange range;
442 foreach( range, selRanges )
444 for ( int row = range.topRow(); row <= range.bottomRow(); ++row )
447 if ( rows.isEmpty() && table->currentRow() > -1 )
448 rows.append( table->currentRow() );
456 // =========================================================================================
458 * \brief Box showing mesh info
460 // =========================================================================================
462 SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent)
463 : QGroupBox( tr("SMESH_MESHINFO_TITLE"), theParent ), myFull( full )
465 QGridLayout* l = new QGridLayout(this);
466 l->setMargin( MARGIN );
467 l->setSpacing( SPACING );
469 QFont italic = font(); italic.setItalic(true);
470 QFont bold = font(); bold.setBold(true);
476 lab = new QLabel( this );
477 lab->setMinimumWidth(100); lab->setFont( italic );
478 l->addWidget( lab, row, 0 );
480 lab = new QLabel(tr("SMESH_MESHINFO_ORDER0"), this );
481 lab->setMinimumWidth(100); lab->setFont( italic );
482 l->addWidget( lab, row, 1 );
484 lab = new QLabel(tr("SMESH_MESHINFO_ORDER1"), this );
485 lab->setMinimumWidth(100); lab->setFont( italic );
486 l->addWidget( lab, row, 2 );
488 lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), this );
489 lab->setMinimumWidth(100); lab->setFont( italic );
490 l->addWidget( lab, row, 3 );
495 row = l->rowCount(); // retrieve current row count
497 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), this );
498 lab->setFont( bold );
499 l->addWidget( lab, row, 0 );
501 myNbNode = new QLabel( this );
502 l->addWidget( myNbNode, row, 1 );
504 addSeparator(this); // add separator
507 row = l->rowCount(); // retrieve current row count
509 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), this );
510 lab->setFont( bold );
511 l->addWidget( lab, row, 0 );
513 myNbEdge = new QLabel( this );
514 l->addWidget( myNbEdge, row, 1 );
516 myNbLinEdge = new QLabel( this );
517 l->addWidget( myNbLinEdge, row, 2 );
519 myNbQuadEdge = new QLabel( this );
520 l->addWidget( myNbQuadEdge, row, 3 );
522 addSeparator(this); // add separator
525 row = l->rowCount(); // retrieve current row count
527 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this);
528 lab->setFont( bold );
529 l->addWidget( lab, row, 0 );
531 myNbFace = new QLabel( this );
532 l->addWidget( myNbFace, row, 1 );
534 myNbLinFace = new QLabel( this );
535 l->addWidget( myNbLinFace, row, 2 );
537 myNbQuadFace = new QLabel( this );
538 l->addWidget( myNbQuadFace, row, 3 );
540 row++; // increment row count
542 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), this );
543 l->addWidget( lab, row, 0 );
545 myNbTrai = new QLabel( this );
546 l->addWidget( myNbTrai, row, 1 );
548 myNbLinTrai = new QLabel( this );
549 l->addWidget( myNbLinTrai, row, 2 );
551 myNbQuadTrai = new QLabel( this );
552 l->addWidget( myNbQuadTrai, row, 3 );
554 row++; // increment row count
556 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), this );
557 l->addWidget( lab, row, 0 );
559 myNbQuad = new QLabel( this );
560 l->addWidget( myNbQuad, row, 1 );
562 myNbLinQuad = new QLabel( this );
563 l->addWidget( myNbLinQuad, row, 2 );
565 myNbQuadQuad = new QLabel( this );
566 l->addWidget( myNbQuadQuad, row, 3 );
568 row++; // increment row count
570 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_POLYGONES")), this );
571 l->addWidget( lab, row, 0 );
572 myNbPolyg = new QLabel( this );
573 l->addWidget( myNbPolyg, row, 1 );
575 addSeparator(this); // add separator
578 row = l->rowCount(); // retrieve current row count
580 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this);
581 lab->setFont( bold );
582 l->addWidget( lab, row, 0 );
584 myNbVolum = new QLabel( this );
585 l->addWidget( myNbVolum, row, 1 );
587 myNbLinVolum = new QLabel( this );
588 l->addWidget( myNbLinVolum, row, 2 );
590 myNbQuadVolum = new QLabel( this );
591 l->addWidget( myNbQuadVolum, row, 3 );
593 row++; // increment row count
595 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), this );
596 l->addWidget( lab, row, 0 );
598 myNbTetra = new QLabel( this );
599 l->addWidget( myNbTetra, row, 1 );
601 myNbLinTetra = new QLabel( this );
602 l->addWidget( myNbLinTetra, row, 2 );
604 myNbQuadTetra = new QLabel( this );
605 l->addWidget( myNbQuadTetra, row, 3 );
607 row++; // increment row count
609 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), this );
610 l->addWidget( lab, row, 0 );
612 myNbHexa = new QLabel( this );
613 l->addWidget( myNbHexa, row, 1 );
615 myNbLinHexa = new QLabel( this );
616 l->addWidget( myNbLinHexa, row, 2 );
618 myNbQuadHexa = new QLabel( this );
619 l->addWidget( myNbQuadHexa, row, 3 );
621 row++; // increment row count
623 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), this );
624 l->addWidget( lab, row, 0 );
626 myNbPyra = new QLabel( this );
627 l->addWidget( myNbPyra, row, 1 );
629 myNbLinPyra = new QLabel( this );
630 l->addWidget( myNbLinPyra, row, 2 );
632 myNbQuadPyra = new QLabel( this );
633 l->addWidget( myNbQuadPyra, row, 3 );
635 row++; // increment row count
637 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), this );
638 l->addWidget( lab, row, 0 );
640 myNbPrism = new QLabel( this );
641 l->addWidget( myNbPrism, row, 1 );
643 myNbLinPrism = new QLabel( this );
644 l->addWidget( myNbLinPrism, row, 2 );
646 myNbQuadPrism = new QLabel( this );
647 l->addWidget( myNbQuadPrism, row, 3 );
649 row++; // increment row count
651 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_POLYEDRES")), this );
652 l->addWidget( lab, row, 0 );
654 myNbPolyh = new QLabel( this );
655 l->addWidget( myNbPolyh, row, 1 );
660 row = l->rowCount(); // retrieve current row count
662 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), this );
663 l->addWidget( lab, row, 0 );
665 myNbNode = new QLabel( this );
666 l->addWidget( myNbNode, row, 1 );
669 row = l->rowCount(); // retrieve current row count
671 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), this );
672 l->addWidget( lab, row, 0 );
674 myNbEdge = new QLabel( this );
675 l->addWidget( myNbEdge, row, 1 );
677 myNbLinEdge = new QLabel( this );
678 l->addWidget( myNbLinEdge, row, 2 );
680 myNbQuadEdge = new QLabel( this );
681 l->addWidget( myNbQuadEdge, row, 3 );
684 row = l->rowCount(); // retrieve current row count
686 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this);
687 l->addWidget( lab, row, 0 );
689 myNbFace = new QLabel( this );
690 l->addWidget( myNbFace, row, 1 );
692 myNbLinFace = new QLabel( this );
693 l->addWidget( myNbLinFace, row, 2 );
695 myNbQuadFace = new QLabel( this );
696 l->addWidget( myNbQuadFace, row, 3 );
699 row = l->rowCount(); // retrieve current row count
701 lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this);
702 l->addWidget( lab, row, 0 );
704 myNbVolum = new QLabel( this );
705 l->addWidget( myNbVolum, row, 1 );
707 myNbLinVolum = new QLabel( this );
708 l->addWidget( myNbLinVolum, row, 2 );
710 myNbQuadVolum = new QLabel( this );
711 l->addWidget( myNbQuadVolum, row, 3 );
715 // =========================================================================================
717 * \brief Set mesh info
719 // =========================================================================================
721 void SMESHGUI_MeshInfosBox::SetInfoByMesh(SMESH::SMESH_Mesh_var mesh)
723 const SMESH::ElementOrder lin = SMESH::ORDER_LINEAR;
727 myNbNode ->setText( QString("%1").arg( mesh->NbNodes() ));
730 nbTot = mesh->NbEdges(), nbLin = mesh->NbEdgesOfOrder(lin);
731 myNbEdge ->setText( QString("%1").arg( nbTot ));
732 myNbLinEdge ->setText( QString("%1").arg( nbLin ));
733 myNbQuadEdge ->setText( QString("%1").arg( nbTot - nbLin ));
736 nbTot = mesh->NbFaces(), nbLin = mesh->NbFacesOfOrder(lin);
737 myNbFace ->setText( QString("%1").arg( nbTot ));
738 myNbLinFace ->setText( QString("%1").arg( nbLin ));
739 myNbQuadFace ->setText( QString("%1").arg( nbTot - nbLin ));
742 nbTot = mesh->NbVolumes(), nbLin = mesh->NbVolumesOfOrder(lin);
743 myNbVolum ->setText( QString("%1").arg( nbTot ));
744 myNbLinVolum ->setText( QString("%1").arg( nbLin ));
745 myNbQuadVolum->setText( QString("%1").arg( nbTot - nbLin ));
750 nbTot = mesh->NbTriangles(), nbLin = mesh->NbTrianglesOfOrder(lin);
751 myNbTrai ->setText( QString("%1").arg( nbTot ));
752 myNbLinTrai ->setText( QString("%1").arg( nbLin ));
753 myNbQuadTrai ->setText( QString("%1").arg( nbTot - nbLin ));
755 nbTot = mesh->NbQuadrangles(), nbLin = mesh->NbQuadranglesOfOrder(lin);
756 myNbQuad ->setText( QString("%1").arg( nbTot ));
757 myNbLinQuad ->setText( QString("%1").arg( nbLin ));
758 myNbQuadQuad ->setText( QString("%1").arg( nbTot - nbLin ));
760 myNbPolyg ->setText( QString("%1").arg( mesh->NbPolygons() ));
763 nbTot = mesh->NbTetras(), nbLin = mesh->NbTetrasOfOrder(lin);
764 myNbTetra ->setText( QString("%1").arg( nbTot ));
765 myNbLinTetra ->setText( QString("%1").arg( nbLin ));
766 myNbQuadTetra->setText( QString("%1").arg( nbTot - nbLin ));
768 nbTot = mesh->NbHexas(), nbLin = mesh->NbHexasOfOrder(lin);
769 myNbHexa ->setText( QString("%1").arg( nbTot ));
770 myNbLinHexa ->setText( QString("%1").arg( nbLin ));
771 myNbQuadHexa ->setText( QString("%1").arg( nbTot - nbLin ));
773 nbTot = mesh->NbPyramids(), nbLin = mesh->NbPyramidsOfOrder(lin);
774 myNbPyra ->setText( QString("%1").arg( nbTot ));
775 myNbLinPyra ->setText( QString("%1").arg( nbLin ));
776 myNbQuadPyra ->setText( QString("%1").arg( nbTot - nbLin ));
778 nbTot = mesh->NbPrisms(), nbLin = mesh->NbPrismsOfOrder(lin);
779 myNbPrism ->setText( QString("%1").arg( nbTot ));
780 myNbLinPrism ->setText( QString("%1").arg( nbLin ));
781 myNbQuadPrism->setText( QString("%1").arg( nbTot - nbLin ));
783 myNbPolyh ->setText( QString("%1").arg( mesh->NbPolyhedrons() ));
787 // =========================================================================================
789 * \brief Dialog to compute a mesh and show computation errors
791 //=======================================================================
793 SMESHGUI_ComputeDlg::SMESHGUI_ComputeDlg(): SMESHGUI_Dialog( 0, false, true, Close/* | Help*/ )
795 QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
796 aDlgLay->setMargin( 0 );
797 aDlgLay->setSpacing( SPACING );
799 QFrame* aMainFrame = createMainFrame (mainFrame());
801 aDlgLay->addWidget(aMainFrame);
803 aDlgLay->setStretchFactor(aMainFrame, 1);
806 //=======================================================================
807 // function : createMainFrame()
808 // purpose : Create frame containing dialog's fields
809 //=======================================================================
811 QFrame* SMESHGUI_ComputeDlg::createMainFrame (QWidget* theParent)
813 QFrame* aFrame = new QFrame(theParent);
815 SUIT_ResourceMgr* rm = resourceMgr();
816 QPixmap iconCompute (rm->loadPixmap("SMESH", tr("ICON_COMPUTE")));
820 QGroupBox* aPixGrp = new QGroupBox(tr("CONSTRUCTOR"), aFrame);
821 QButtonGroup* aBtnGrp = new QButtonGroup(this);
822 QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
823 aPixGrpLayout->setMargin(MARGIN); aPixGrpLayout->setSpacing(SPACING);
825 QRadioButton* aRBut = new QRadioButton(aPixGrp);
826 aRBut->setIcon(iconCompute);
827 aRBut->setChecked(true);
828 aPixGrpLayout->addWidget(aRBut);
829 aBtnGrp->addButton(aRBut, 0);
833 QGroupBox* nameBox = new QGroupBox(tr("SMESH_MESHINFO_NAME"), aFrame );
834 QHBoxLayout* nameBoxLayout = new QHBoxLayout(nameBox);
835 nameBoxLayout->setMargin(MARGIN); nameBoxLayout->setSpacing(SPACING);
836 myMeshName = new QLabel(nameBox);
837 nameBoxLayout->addWidget(myMeshName);
841 myBriefInfo = new SMESHGUI_MeshInfosBox(false, aFrame);
842 myFullInfo = new SMESHGUI_MeshInfosBox(true, aFrame);
844 // Computation errors
846 myCompErrorGroup = new QGroupBox(tr("ERRORS"), aFrame);
847 myTable = new QTableWidget( 1, NB_COLUMNS, myCompErrorGroup);
848 myShowBtn = new QPushButton(tr("SHOW_SHAPE"), myCompErrorGroup);
849 myPublishBtn = new QPushButton(tr("PUBLISH_SHAPE"), myCompErrorGroup);
850 myBadMeshBtn = new QPushButton(tr("SHOW_BAD_MESH"), myCompErrorGroup);
852 //myTable->setReadOnly( true ); // VSR: check
853 myTable->setEditTriggers( QAbstractItemView::NoEditTriggers );
854 myTable->hideColumn( COL_PUBLISHED );
855 myTable->hideColumn( COL_SHAPEID );
856 myTable->hideColumn( COL_BAD_MESH );
857 myTable->horizontalHeader()->setResizeMode( COL_ERROR, QHeaderView::Interactive );
860 headers << tr( "COL_ALGO_HEADER" );
861 headers << tr( "COL_SHAPE_HEADER" );
862 headers << tr( "COL_ERROR_HEADER" );
863 headers << tr( "COL_SHAPEID_HEADER" );
864 headers << tr( "COL_PUBLISHED_HEADER" );
866 myTable->setHorizontalHeaderLabels( headers );
869 QGridLayout* grpLayout = new QGridLayout(myCompErrorGroup);
870 grpLayout->setSpacing(SPACING);
871 grpLayout->setMargin(MARGIN);
872 grpLayout->addWidget( myTable, 0, 0, 4, 1 );
873 grpLayout->addWidget( myShowBtn, 0, 1 );
874 grpLayout->addWidget( myPublishBtn, 1, 1 );
875 grpLayout->addWidget( myBadMeshBtn, 2, 1 );
876 grpLayout->setRowStretch( 3, 1 );
878 // Hypothesis definition errors
880 myHypErrorGroup = new QGroupBox(tr("SMESH_WRN_MISSING_PARAMETERS"), aFrame);
881 QHBoxLayout* myHypErrorGroupLayout = new QHBoxLayout(myHypErrorGroup);
882 myHypErrorGroupLayout->setMargin(MARGIN);
883 myHypErrorGroupLayout->setSpacing(SPACING);
884 myHypErrorLabel = new QLabel(myHypErrorGroup);
885 myHypErrorGroupLayout->addWidget(myHypErrorLabel);
889 myMemoryLackGroup = new QGroupBox(tr("ERRORS"), aFrame);
890 QVBoxLayout* myMemoryLackGroupLayout = new QVBoxLayout(myMemoryLackGroup);
891 myMemoryLackGroupLayout->setMargin(MARGIN);
892 myMemoryLackGroupLayout->setSpacing(SPACING);
893 QLabel* memLackLabel = new QLabel(tr("MEMORY_LACK"), myMemoryLackGroup);
894 QFont bold = memLackLabel->font(); bold.setBold(true);
895 memLackLabel->setFont( bold );
896 memLackLabel->setMinimumWidth(300);
897 myMemoryLackGroupLayout->addWidget(memLackLabel);
899 // add all widgets to aFrame
900 QVBoxLayout* aLay = new QVBoxLayout(aFrame);
901 aLay->setMargin( 0 );
902 aLay->setSpacing( 0 );
903 aLay->addWidget( aPixGrp );
904 aLay->addWidget( nameBox );
905 aLay->addWidget( myBriefInfo );
906 aLay->addWidget( myFullInfo );
907 aLay->addWidget( myHypErrorGroup );
908 aLay->addWidget( myCompErrorGroup );
909 aLay->addWidget( myMemoryLackGroup );
910 aLay->setStretchFactor( myCompErrorGroup, 1 );
912 ((QPushButton*) button( OK ))->setDefault( true );
917 //================================================================================
921 //================================================================================
923 SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
925 myDlg = new SMESHGUI_ComputeDlg;
926 myTShapeDisplayer = new SMESH::TShapeDisplayer();
927 myBadMeshDisplayer = 0;
929 //myHelpFileName = "/files/about_meshes.htm"; // V3
930 myHelpFileName = "about_meshes_page.html"; // V4
932 // connect signals and slots
933 connect(myDlg->myShowBtn, SIGNAL (clicked()), SLOT(onPreviewShape()));
934 connect(myDlg->myPublishBtn, SIGNAL (clicked()), SLOT(onPublishShape()));
935 connect(myDlg->myBadMeshBtn, SIGNAL (clicked()), SLOT(onShowBadMesh()));
936 connect(table(), SIGNAL(itemSelectionChanged()), SLOT(currentCellChanged()));
937 connect(table(), SIGNAL(currentCellChanged(int,int,int,int)), SLOT(currentCellChanged()));
940 //=======================================================================
941 // function : startOperation()
942 // purpose : Init dialog fields, connect signals and slots, show dialog
943 //=======================================================================
945 void SMESHGUI_ComputeOp::startOperation()
947 SMESHGUI_Operation::startOperation();
951 myMesh = SMESH::SMESH_Mesh::_nil();
952 myMainShape = GEOM::GEOM_Object::_nil();
954 LightApp_SelectionMgr *Sel = selectionMgr();
955 SALOME_ListIO selected; Sel->selectedObjects( selected );
957 int nbSel = selected.Extent();
959 SUIT_MessageBox::warning(desktop(),
960 tr("SMESH_WRN_WARNING"),
961 tr("SMESH_WRN_NO_AVAILABLE_DATA"));
966 Handle(SALOME_InteractiveObject) IObject = selected.First();
967 myMesh = SMESH::GetMeshByIO(IObject);
968 if (myMesh->_is_nil()) {
969 SUIT_MessageBox::warning(desktop(),
970 tr("SMESH_WRN_WARNING"),
971 tr("SMESH_WRN_NO_AVAILABLE_DATA"));
978 SMESH::MemoryReserve aMemoryReserve;
980 SMESH::compute_error_array_var aCompErrors;
983 bool computeFailed = true, memoryLack = false;
985 _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
986 myMainShape = myMesh->GetShapeToMesh();
987 bool hasShape = myMesh->HasShapeToMesh();
988 bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
989 if ( shapeOK && aMeshSObj )
991 myDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
992 SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
993 SMESH::algo_error_array_var errors = gen->GetAlgoState(myMesh,myMainShape);
994 if ( errors->length() > 0 ) {
995 aHypErrors = SMESH::GetMessageOnAlgoStateErrors( errors.in() );
997 SUIT_OverrideCursor aWaitCursor;
999 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
1002 if (gen->Compute(myMesh, myMainShape))
1003 computeFailed = false;
1005 catch(const SALOME::SALOME_Exception & S_ex){
1009 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
1012 aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
1013 // check if there are memory problems
1014 for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
1015 memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB );
1017 catch(const SALOME::SALOME_Exception & S_ex){
1021 // NPAL16631: if ( !memoryLack )
1023 SMESH::ModifiedMesh(aMeshSObj, !computeFailed, myMesh->NbNodes() == 0);
1024 update( UF_ObjBrowser | UF_Model );
1027 // NPAL16631: if ( getSMESHGUI()->automaticUpdate() )
1028 if ( !memoryLack && getSMESHGUI()->automaticUpdate() )
1031 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
1034 SMESH::Update(IObject, true);
1038 MESSAGE ( "Exception thrown during mesh visualization" );
1040 if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
1041 SMESH::OnVisuException();
1048 Sel->setSelectedObjects( selected );
1053 aMemoryReserve.release();
1055 myDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
1056 myDlg->myMemoryLackGroup->hide();
1060 bool noCompError = ( !aCompErrors.operator->() || aCompErrors->length() == 0 );
1061 bool noHypoError = ( aHypErrors.isEmpty() );
1065 myDlg->myMemoryLackGroup->show();
1066 myDlg->myFullInfo->hide();
1067 myDlg->myBriefInfo->hide();
1068 myDlg->myHypErrorGroup->hide();
1069 myDlg->myCompErrorGroup->hide();
1071 else if ( noCompError && noHypoError )
1073 myDlg->myFullInfo->SetInfoByMesh( myMesh );
1074 myDlg->myFullInfo->show();
1075 myDlg->myBriefInfo->hide();
1076 myDlg->myHypErrorGroup->hide();
1077 myDlg->myCompErrorGroup->hide();
1081 QTableWidget* tbl = myDlg->myTable;
1082 myDlg->myBriefInfo->SetInfoByMesh( myMesh );
1083 myDlg->myBriefInfo->show();
1084 myDlg->myFullInfo->hide();
1086 if ( noHypoError ) {
1087 myDlg->myHypErrorGroup->hide();
1090 myDlg->myHypErrorGroup->show();
1091 myDlg->myHypErrorLabel->setText( aHypErrors );
1094 if ( noCompError ) {
1095 myDlg->myCompErrorGroup->hide();
1098 myDlg->myCompErrorGroup->show();
1101 myDlg->myPublishBtn->hide();
1102 myDlg->myShowBtn->hide();
1105 myDlg->myPublishBtn->show();
1106 myDlg->myShowBtn->show();
1109 // fill table of errors
1110 tbl->setRowCount( aCompErrors->length() );
1111 if ( !hasShape ) tbl->hideColumn( COL_SHAPE );
1112 else tbl->showColumn( COL_SHAPE );
1113 tbl->setColumnWidth( COL_ERROR, 200 );
1115 bool hasBadMesh = false;
1116 for ( int row = 0; row < aCompErrors->length(); ++row )
1118 SMESH::ComputeError & err = aCompErrors[ row ];
1120 QString text = err.algoName.in();
1121 if ( !tbl->item( row, COL_ALGO ) ) tbl->setItem( row, COL_ALGO, new QTableWidgetItem( text ) );
1122 else tbl->item( row, COL_ALGO )->setText( text );
1124 text = SMESH::errorText( err.code, err.comment.in() );
1125 if ( !tbl->item( row, COL_ERROR ) ) tbl->setItem( row, COL_ERROR, new QTableWidgetItem( text ) );
1126 else tbl->item( row, COL_ERROR )->setText( text );
1128 text = QString("%1").arg( err.subShapeID );
1129 if ( !tbl->item( row, COL_SHAPEID ) ) tbl->setItem( row, COL_SHAPEID, new QTableWidgetItem( text ) );
1130 else tbl->item( row, COL_SHAPEID )->setText( text );
1132 text = hasShape ? SMESH::shapeText( err.subShapeID, myMainShape ) : QString("");
1133 if ( !tbl->item( row, COL_SHAPE ) ) tbl->setItem( row, COL_SHAPE, new QTableWidgetItem( text ) );
1134 else tbl->item( row, COL_SHAPE )->setText( text );
1136 text = ( !hasShape || SMESH::getSubShapeSO( err.subShapeID, myMainShape )) ? "PUBLISHED" : "";
1137 if ( !tbl->item( row, COL_PUBLISHED ) ) tbl->setItem( row, COL_PUBLISHED, new QTableWidgetItem( text ) );
1138 else tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
1140 text = err.hasBadMesh ? "hasBadMesh" : "";
1141 if ( !tbl->item( row, COL_BAD_MESH ) ) tbl->setItem( row, COL_BAD_MESH, new QTableWidgetItem( text ) );
1142 else tbl->item( row, COL_BAD_MESH )->setText( text );
1143 if ( err.hasBadMesh ) hasBadMesh = true;
1145 //tbl->item( row, COL_ERROR )->setWordWrap( true ); // VSR: TODO ???
1146 tbl->resizeRowToContents( row );
1148 tbl->resizeColumnToContents( COL_ALGO );
1149 tbl->resizeColumnToContents( COL_SHAPE );
1152 myDlg->myBadMeshBtn->show();
1154 myDlg->myBadMeshBtn->hide();
1156 tbl->setCurrentCell(0,0);
1157 currentCellChanged(); // to update buttons
1163 //================================================================================
1165 * \brief Stops operation
1167 //================================================================================
1169 void SMESHGUI_ComputeOp::stopOperation()
1171 SMESHGUI_Operation::stopOperation();
1172 myTShapeDisplayer->SetVisibility( false );
1173 if ( myBadMeshDisplayer ) {
1174 myBadMeshDisplayer->SetVisibility( false );
1175 // delete it in order not to have problems at its destruction when the viewer
1176 // where it worked is dead due to e.g. study closing
1177 delete myBadMeshDisplayer;
1178 myBadMeshDisplayer = 0;
1182 //================================================================================
1184 * \brief publish selected subshape
1186 //================================================================================
1188 void SMESHGUI_ComputeOp::onPublishShape()
1190 GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
1191 SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
1194 SMESH::getSelectedRows( table(), rows );
1196 foreach ( row, rows )
1198 int curSub = table()->item(row, COL_SHAPEID)->text().toInt();
1199 GEOM::GEOM_Object_var shape = SMESH::getSubShape( curSub, myMainShape );
1200 if ( !shape->_is_nil() && ! SMESH::getSubShapeSO( curSub, myMainShape ))
1202 if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published
1204 QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
1205 SALOMEDS::SObject_var so =
1206 geomGen->AddInStudy( study, myMainShape, name.toLatin1().data(), GEOM::GEOM_Object::_nil());
1207 // look for myMainShape in the table
1208 for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) {
1209 if ( table()->item( r, COL_SHAPEID )->text() == "1" ) {
1210 if ( so->_is_nil() ) {
1211 table()->item( r, COL_SHAPE )->setText( so->GetName() );
1212 table()->item( r, COL_PUBLISHED )->setText( so->GetID() );
1217 if ( curSub == 1 ) continue;
1219 QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
1220 SALOMEDS::SObject_var so = geomGen->AddInStudy( study, shape, name.toLatin1().data(), myMainShape);
1221 if ( !so->_is_nil() ) {
1222 table()->item( row, COL_SHAPE )->setText( so->GetName() );
1223 table()->item( row, COL_PUBLISHED )->setText( so->GetID() );
1227 getSMESHGUI()->getApp()->updateObjectBrowser();
1228 currentCellChanged(); // to update buttons
1231 //================================================================================
1233 * \brief show mesh elements preventing computation of a submesh of current row
1235 //================================================================================
1237 void SMESHGUI_ComputeOp::onShowBadMesh()
1239 myTShapeDisplayer->SetVisibility( false );
1241 if ( SMESH::getSelectedRows( table(), rows ) == 1 ) {
1242 bool hasBadMesh = ( !table()->item(rows.front(), COL_BAD_MESH)->text().isEmpty() );
1244 int curSub = table()->item(rows.front(), COL_SHAPEID)->text().toInt();
1245 SMESHGUI* gui = getSMESHGUI();
1246 SMESH::SMESH_Gen_var gen = gui->GetSMESHGen();
1247 SVTK_ViewWindow* view = SMESH::GetViewWindow( gui );
1248 if ( myBadMeshDisplayer ) delete myBadMeshDisplayer;
1249 myBadMeshDisplayer = new SMESHGUI_MeshEditPreview( view );
1250 SMESH::MeshPreviewStruct_var aMeshData = gen->GetBadInputElements(myMesh,curSub);
1251 vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3);
1252 vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
1253 // delete property !!!!!!!!!!
1254 vtkProperty* prop = vtkProperty::New();
1255 prop->SetLineWidth( aLineWidth * 3 );
1256 prop->SetPointSize( aPointSize * 3 );
1257 prop->SetColor( 250, 0, 250 );
1258 myBadMeshDisplayer->GetActor()->SetProperty( prop );
1259 myBadMeshDisplayer->SetData( aMeshData._retn() );
1264 //================================================================================
1266 * \brief SLOT called when a selected cell in table() changed
1268 //================================================================================
1270 void SMESHGUI_ComputeOp::currentCellChanged()
1272 myTShapeDisplayer->SetVisibility( false );
1273 if ( myBadMeshDisplayer )
1274 myBadMeshDisplayer->SetVisibility( false );
1276 bool publishEnable = 0, showEnable = 0, showOnly = 1, hasBadMesh = 0;
1278 int nbSelected = SMESH::getSelectedRows( table(), rows );
1280 foreach ( row, rows )
1282 bool hasData = ( !table()->item( row, COL_SHAPE )->text().isEmpty() );
1283 bool isPublished = ( !table()->item( row, COL_PUBLISHED )->text().isEmpty() );
1284 if ( hasData && !isPublished )
1285 publishEnable = true;
1287 int curSub = table()->item( row, COL_SHAPEID )->text().toInt();
1288 bool prsReady = myTShapeDisplayer->HasReadyActorsFor( curSub, myMainShape );
1290 myTShapeDisplayer->Show( curSub, myMainShape, showOnly );
1297 if ( !table()->item(row, COL_BAD_MESH)->text().isEmpty() )
1300 myDlg->myPublishBtn->setEnabled( publishEnable );
1301 myDlg->myShowBtn ->setEnabled( showEnable );
1302 myDlg->myBadMeshBtn->setEnabled( hasBadMesh && ( nbSelected == 1 ));
1305 //================================================================================
1307 * \brief update preview
1309 //================================================================================
1311 void SMESHGUI_ComputeOp::onPreviewShape()
1313 if ( myTShapeDisplayer )
1315 SUIT_OverrideCursor aWaitCursor;
1317 SMESH::getSelectedRows( table(), rows );
1319 bool showOnly = true;
1321 foreach ( row, rows )
1323 int curSub = table()->item( row, COL_SHAPEID )->text().toInt();
1325 myTShapeDisplayer->Show( curSub, myMainShape, showOnly );
1329 currentCellChanged(); // to update buttons
1333 //================================================================================
1337 //================================================================================
1339 SMESHGUI_ComputeOp::~SMESHGUI_ComputeOp()
1341 delete myTShapeDisplayer;
1342 if ( myBadMeshDisplayer )
1343 delete myBadMeshDisplayer;
1346 //================================================================================
1348 * \brief Gets dialog of this operation
1349 * \retval LightApp_Dialog* - pointer to dialog of this operation
1351 //================================================================================
1353 LightApp_Dialog* SMESHGUI_ComputeOp::dlg() const
1358 //================================================================================
1360 * \brief perform it's intention action: compute mesh
1362 //================================================================================
1364 bool SMESHGUI_ComputeOp::onApply()
1369 //================================================================================
1371 * \brief Return a table
1373 //================================================================================
1375 QTableWidget* SMESHGUI_ComputeOp::table()
1377 return myDlg->myTable;