2009-02-17 10:27:49 +05:00
|
|
|
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
2005-06-07 19:22:20 +06:00
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH SMESHGUI : GUI for SMESH component
|
|
|
|
// File : SMESHGUI_MeshInfosDlg.cxx
|
|
|
|
// Author : Nicolas BARBEROU
|
|
|
|
// SMESH includes
|
2003-07-10 19:18:22 +06:00
|
|
|
//
|
2005-06-07 19:22:20 +06:00
|
|
|
#include "SMESHGUI_MeshInfosDlg.h"
|
|
|
|
|
|
|
|
#include "SMESHGUI.h"
|
|
|
|
#include "SMESHGUI_Utils.h"
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SALOME GUI includes
|
|
|
|
#include <SUIT_Desktop.h>
|
|
|
|
#include <SUIT_ResourceMgr.h>
|
|
|
|
#include <SUIT_OverrideCursor.h>
|
|
|
|
#include <SUIT_Session.h>
|
|
|
|
#include <SUIT_MessageBox.h>
|
|
|
|
|
|
|
|
#include <LightApp_SelectionMgr.h>
|
|
|
|
#include <LightApp_Application.h>
|
|
|
|
#include <SALOME_ListIO.hxx>
|
|
|
|
|
|
|
|
// SALOME KERNEL includes
|
|
|
|
#include <SALOMEDSClient_Study.hxx>
|
|
|
|
|
|
|
|
// Qt includes
|
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QStackedWidget>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
|
|
|
// IDL includes
|
|
|
|
#include <SALOMEconfig.h>
|
2004-12-01 15:48:31 +05:00
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Mesh)
|
|
|
|
#include CORBA_SERVER_HEADER(SMESH_Group)
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
#define COLONIZE(str) (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" )
|
2009-02-17 10:27:49 +05:00
|
|
|
#define SPACING 6
|
|
|
|
#define MARGIN 11
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : SMESHGUI_MeshInfosDlg()
|
|
|
|
// purpose : Constructor
|
2003-05-19 20:07:00 +06:00
|
|
|
//=================================================================================
|
2009-02-17 10:27:49 +05:00
|
|
|
SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg(SMESHGUI* theModule):
|
|
|
|
QDialog(SMESH::GetDesktop(theModule)),
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
|
|
|
|
mySMESHGUI(theModule)
|
2004-06-18 14:34:31 +06:00
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
setModal( false );
|
|
|
|
setAttribute( Qt::WA_DeleteOnClose, true );
|
|
|
|
setWindowTitle(tr("SMESH_MESHINFO_TITLE"));
|
|
|
|
setSizeGripEnabled(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
myStartSelection = true;
|
|
|
|
myIsActiveWindow = true;
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
QVBoxLayout* aTopLayout = new QVBoxLayout(this);
|
2009-02-17 10:27:49 +05:00
|
|
|
aTopLayout->setSpacing(SPACING); aTopLayout->setMargin(MARGIN);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// select button & label
|
2005-06-08 16:45:19 +06:00
|
|
|
QPixmap image0(SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH",tr("ICON_SELECT")));
|
2009-02-17 10:27:49 +05:00
|
|
|
mySelectBtn = new QPushButton(this);
|
|
|
|
mySelectBtn->setIcon(image0);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectBtn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
mySelectLab = new QLabel(this);
|
|
|
|
mySelectLab->setAlignment(Qt::AlignCenter);
|
2005-06-07 19:22:20 +06:00
|
|
|
QFont fnt = mySelectLab->font(); fnt.setBold(true);
|
|
|
|
mySelectLab->setFont(fnt);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
QHBoxLayout* aSelectLayout = new QHBoxLayout;
|
|
|
|
aSelectLayout->setMargin(0); aSelectLayout->setSpacing(0);
|
|
|
|
aSelectLayout->addWidget(mySelectBtn);
|
|
|
|
aSelectLayout->addWidget(mySelectLab);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// top widget stack
|
2009-02-17 10:27:49 +05:00
|
|
|
myWGStack = new QStackedWidget(this);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// no valid selection
|
2005-06-07 19:22:20 +06:00
|
|
|
QWidget* myBadWidget = new QWidget(myWGStack);
|
|
|
|
QVBoxLayout* aBadLayout = new QVBoxLayout(myBadWidget);
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myBadLab = new QLabel(tr("SMESH_BAD_SELECTION"), myBadWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
myBadLab->setAlignment(Qt::AlignCenter);
|
|
|
|
myBadLab->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
|
|
|
aBadLayout->addWidget(myBadLab);
|
2009-02-17 10:27:49 +05:00
|
|
|
myWGStack->addWidget(myBadWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// mesh
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshWidget = new QWidget(myWGStack);
|
|
|
|
QGridLayout* aMeshLayout = new QGridLayout(myMeshWidget);
|
2009-02-17 10:27:49 +05:00
|
|
|
aMeshLayout->setSpacing(SPACING); aMeshLayout->setMargin(0);
|
2005-06-07 19:22:20 +06:00
|
|
|
myWGStack->addWidget(myMeshWidget);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> name
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), myMeshWidget);
|
|
|
|
myMeshName = new QLabel(myMeshWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshName->setMinimumWidth(100);
|
|
|
|
QFrame* line1 = new QFrame(myMeshWidget);
|
|
|
|
line1->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> nodes
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbNodesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), myMeshWidget);
|
|
|
|
myMeshNbNodes = new QLabel(myMeshWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbNodes->setMinimumWidth(100);
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
// --> header with orders
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshOrder0Lab = new QLabel(tr("SMESH_MESHINFO_ORDER0"), myMeshWidget);
|
|
|
|
QLabel* myMeshOrder1Lab = new QLabel(tr("SMESH_MESHINFO_ORDER1"), myMeshWidget);
|
|
|
|
QLabel* myMeshOrder2Lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), myMeshWidget);
|
2006-05-06 14:51:48 +06:00
|
|
|
QFont fnti = myMeshOrder0Lab->font(); fnti.setItalic(true);
|
|
|
|
myMeshOrder0Lab->setFont(fnti);
|
|
|
|
myMeshOrder1Lab->setFont(fnti);
|
|
|
|
myMeshOrder2Lab->setFont(fnti);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> edges
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), myMeshWidget);
|
|
|
|
myMeshNbEdges = new QLabel(myMeshWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbEdges->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbEdges1 = new QLabel(myMeshWidget);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbEdges1->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbEdges2 = new QLabel(myMeshWidget);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbEdges2->setMinimumWidth(100);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> faces
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshFacesGroup = new QGroupBox(tr("SMESH_MESHINFO_FACES"), myMeshWidget);
|
|
|
|
QGridLayout* myMeshFacesGroupLayout = new QGridLayout(myMeshFacesGroup);
|
|
|
|
myMeshFacesGroupLayout->setSpacing(SPACING); myMeshFacesGroupLayout->setMargin(MARGIN);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// --> faces --> total
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbFacesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), myMeshFacesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbFacesLab->setFont(fnt);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbFaces = new QLabel(myMeshFacesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbFaces->setMinimumWidth(100);
|
|
|
|
myMeshNbFaces->setFont(fnt);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbFaces1 = new QLabel(myMeshFacesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbFaces1->setMinimumWidth(100);
|
|
|
|
myMeshNbFaces1->setFont(fnt);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbFaces2 = new QLabel(myMeshFacesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbFaces2->setMinimumWidth(100);
|
|
|
|
myMeshNbFaces2->setFont(fnt);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> faces --> triangles
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbTrianglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), myMeshFacesGroup);
|
|
|
|
myMeshNbTriangles = new QLabel(myMeshFacesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbTriangles->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbTriangles1 = new QLabel(myMeshFacesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbTriangles1->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbTriangles2 = new QLabel(myMeshFacesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbTriangles2->setMinimumWidth(100);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> faces --> quadrangles
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbQuadranglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), myMeshFacesGroup);
|
|
|
|
myMeshNbQuadrangles = new QLabel(myMeshFacesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbQuadrangles->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbQuadrangles1 = new QLabel(myMeshFacesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbQuadrangles1->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbQuadrangles2 = new QLabel(myMeshFacesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbQuadrangles2->setMinimumWidth(100);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
// --> faces --> polygons
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbPolygonesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYGONES" ) ), myMeshFacesGroup );
|
|
|
|
myMeshNbPolygones = new QLabel( myMeshFacesGroup );
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPolygones->setMinimumWidth( 100 );
|
|
|
|
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbFacesLab, 0, 0);
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbFaces, 0, 1);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbFaces1, 0, 2);
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbFaces2, 0, 3);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbTrianglesLab, 1, 0);
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbTriangles, 1, 1);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbTriangles1, 1, 2);
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbTriangles2, 1, 3);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbQuadranglesLab, 2, 0);
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles, 2, 1);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles1, 2, 2);
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles2, 2, 3);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbPolygonesLab, 3, 0);
|
|
|
|
myMeshFacesGroupLayout->addWidget(myMeshNbPolygones, 3, 1);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// --> volumes
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshVolumesGroup = new QGroupBox(tr("SMESH_MESHINFO_VOLUMES"), myMeshWidget);
|
|
|
|
QGridLayout* myMeshVolumesGroupLayout = new QGridLayout(myMeshVolumesGroup);
|
|
|
|
myMeshVolumesGroupLayout->setSpacing(SPACING); myMeshVolumesGroupLayout->setMargin(MARGIN);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> volumes --> total
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbVolumesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), myMeshVolumesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbVolumesLab->setFont(fnt);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbVolumes = new QLabel(myMeshVolumesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbVolumes->setMinimumWidth(100);
|
|
|
|
myMeshNbVolumes->setFont(fnt);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbVolumes1 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbVolumes1->setMinimumWidth(100);
|
|
|
|
myMeshNbVolumes1->setFont(fnt);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbVolumes2 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbVolumes2->setMinimumWidth(100);
|
|
|
|
myMeshNbVolumes2->setFont(fnt);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> volumes --> tetrahedrons
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbTetraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), myMeshVolumesGroup);
|
|
|
|
myMeshNbTetra = new QLabel(myMeshVolumesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbTetra->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbTetra1 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbTetra1->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbTetra2 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbTetra2->setMinimumWidth(100);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> volumes --> hexahedrons
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbHexaLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), myMeshVolumesGroup);
|
|
|
|
myMeshNbHexa = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbHexa->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbHexa1 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbHexa1->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbHexa2 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbHexa2->setMinimumWidth(100);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> volumes --> prisms
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbPrismLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), myMeshVolumesGroup);
|
|
|
|
myMeshNbPrism = new QLabel(myMeshVolumesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPrism->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbPrism1 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbPrism1->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbPrism2 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbPrism2->setMinimumWidth(100);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> volumes --> pyramids
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbPyraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), myMeshVolumesGroup);
|
|
|
|
myMeshNbPyra = new QLabel(myMeshVolumesGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPyra->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbPyra1 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbPyra1->setMinimumWidth(100);
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshNbPyra2 = new QLabel(myMeshVolumesGroup);
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbPyra2->setMinimumWidth(100);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
|
|
|
// --> volumes --> polyherones
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myMeshNbPolyhedronesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYEDRES" ) ), myMeshVolumesGroup );
|
|
|
|
myMeshNbPolyhedrones = new QLabel( myMeshVolumesGroup );
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPolyhedrones->setMinimumWidth( 100 );
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbVolumesLab, 0, 0);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes, 0, 1);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes1, 0, 2);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes2, 0, 3);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbTetraLab, 1, 0);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbTetra, 1, 1);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbTetra1, 1, 2);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbTetra2, 1, 3);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbHexaLab, 2, 0);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbHexa, 2, 1);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbHexa1, 2, 2);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbHexa2, 2, 3);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPrismLab, 3, 0);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPrism, 3, 1);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPrism1, 3, 2);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPrism2, 3, 3);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPyraLab, 4, 0);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPyra, 4, 1);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPyra1, 4, 2);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPyra2, 4, 3);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPolyhedronesLab, 5, 0);
|
|
|
|
myMeshVolumesGroupLayout->addWidget(myMeshNbPolyhedrones, 5, 1);
|
|
|
|
|
|
|
|
aMeshLayout->addWidget(myMeshNameLab, 0, 0);
|
|
|
|
aMeshLayout->addWidget(myMeshName, 0, 1);
|
|
|
|
aMeshLayout->addWidget(line1, 1, 0, 1, 2);
|
|
|
|
aMeshLayout->addWidget(myMeshNbNodesLab, 2, 0);
|
|
|
|
aMeshLayout->addWidget(myMeshNbNodes, 2, 1);
|
|
|
|
aMeshLayout->addWidget(myMeshOrder0Lab, 3, 1);
|
|
|
|
aMeshLayout->addWidget(myMeshOrder1Lab, 3, 2);
|
|
|
|
aMeshLayout->addWidget(myMeshOrder2Lab, 3, 3);
|
|
|
|
aMeshLayout->addWidget(myMeshNbEdgesLab, 4, 0);
|
|
|
|
aMeshLayout->addWidget(myMeshNbEdges, 4, 1);
|
|
|
|
aMeshLayout->addWidget(myMeshNbEdges1, 4, 2);
|
|
|
|
aMeshLayout->addWidget(myMeshNbEdges2, 4, 3);
|
|
|
|
aMeshLayout->addWidget(myMeshFacesGroup, 5, 0, 1, 4);
|
|
|
|
aMeshLayout->addWidget(myMeshVolumesGroup, 6, 0, 1, 4);
|
|
|
|
aMeshLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 7, 0);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// submesh
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshWidget = new QWidget(myWGStack);
|
|
|
|
QGridLayout* aSubMeshLayout = new QGridLayout(mySubMeshWidget);
|
2009-02-17 10:27:49 +05:00
|
|
|
aSubMeshLayout->setSpacing(SPACING); aSubMeshLayout->setMargin(0);
|
2005-06-07 19:22:20 +06:00
|
|
|
myWGStack->addWidget(mySubMeshWidget);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> name
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* mySubMeshNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), mySubMeshWidget);
|
|
|
|
mySubMeshName = new QLabel(mySubMeshWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshName->setMinimumWidth(100);
|
|
|
|
QFrame* line2 = new QFrame(mySubMeshWidget);
|
|
|
|
line2->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> nodes
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* mySubMeshNbNodesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), mySubMeshWidget);
|
|
|
|
mySubMeshNbNodes = new QLabel(mySubMeshWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshNbNodes->setMinimumWidth(100);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> elements
|
2009-02-17 10:27:49 +05:00
|
|
|
mySubMeshElementsGroup = new QGroupBox(tr("SMESH_MESHINFO_ELEMENTS"), mySubMeshWidget);
|
|
|
|
QGridLayout* mySubMeshElementsGroupLayout = new QGridLayout(mySubMeshElementsGroup);
|
|
|
|
mySubMeshElementsGroupLayout->setSpacing(SPACING); mySubMeshElementsGroupLayout->setMargin(MARGIN);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// --> elements --> total
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* mySubMeshNbElementsLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), mySubMeshElementsGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshNbElementsLab->setFont(fnt);
|
2009-02-17 10:27:49 +05:00
|
|
|
mySubMeshNbElements = new QLabel(mySubMeshElementsGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshNbElements->setMinimumWidth(100);
|
|
|
|
mySubMeshNbElements->setFont(fnt);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> elements --> edges
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* mySubMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), mySubMeshElementsGroup);
|
|
|
|
mySubMeshNbEdges = new QLabel(mySubMeshElementsGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshNbEdges->setMinimumWidth(100);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> elements --> faces
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* mySubMeshNbFacesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), mySubMeshElementsGroup);
|
|
|
|
mySubMeshNbFaces = new QLabel(mySubMeshElementsGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshNbFaces->setMinimumWidth(100);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> elements --> volumes
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* mySubMeshNbVolumesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), mySubMeshElementsGroup);
|
|
|
|
mySubMeshNbVolumes = new QLabel(mySubMeshElementsGroup);
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshNbVolumes->setMinimumWidth(100);
|
|
|
|
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbElementsLab, 0, 0);
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbElements, 0, 1);
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbEdgesLab, 1, 0);
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbEdges, 1, 1);
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbFacesLab, 2, 0);
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbFaces, 2, 1);
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbVolumesLab, 3, 0);
|
|
|
|
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbVolumes, 3, 1);
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
aSubMeshLayout->addWidget(mySubMeshNameLab, 0, 0);
|
|
|
|
aSubMeshLayout->addWidget(mySubMeshName, 0, 1);
|
|
|
|
aSubMeshLayout->addWidget(line2, 1, 0, 1, 2);
|
|
|
|
aSubMeshLayout->addWidget(mySubMeshNbNodesLab, 2, 0);
|
|
|
|
aSubMeshLayout->addWidget(mySubMeshNbNodes, 2, 1);
|
|
|
|
aSubMeshLayout->addWidget(mySubMeshElementsGroup, 3, 0, 1, 2);
|
|
|
|
aSubMeshLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 4, 0);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// group
|
2005-06-07 19:22:20 +06:00
|
|
|
myGroupWidget = new QWidget(myWGStack);
|
|
|
|
QGridLayout* myGroupWidgetLayout = new QGridLayout(myGroupWidget);
|
2009-02-17 10:27:49 +05:00
|
|
|
myGroupWidgetLayout->setSpacing(SPACING); myGroupWidgetLayout->setMargin(0);
|
2005-06-07 19:22:20 +06:00
|
|
|
myWGStack->addWidget(myGroupWidget);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> name
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myGroupNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), myGroupWidget);
|
|
|
|
myGroupName = new QLabel(myGroupWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
myGroupName->setMinimumWidth(100);
|
|
|
|
QFrame* line3 = new QFrame(myGroupWidget);
|
|
|
|
line3->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
// --> type
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myGroupTypeLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TYPE")), myGroupWidget);
|
|
|
|
myGroupType = new QLabel(myGroupWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
myGroupType->setMinimumWidth(100);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// --> number of entities
|
2009-02-17 10:27:49 +05:00
|
|
|
QLabel* myGroupNbLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_ENTITIES")), myGroupWidget);
|
|
|
|
myGroupNb = new QLabel(myGroupWidget);
|
2005-06-07 19:22:20 +06:00
|
|
|
myGroupNb->setMinimumWidth(100);
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
myGroupWidgetLayout->addWidget(myGroupNameLab, 0, 0);
|
|
|
|
myGroupWidgetLayout->addWidget(myGroupName, 0, 1);
|
|
|
|
myGroupWidgetLayout->addWidget(line3, 1, 0, 1, 2);
|
|
|
|
myGroupWidgetLayout->addWidget(myGroupTypeLab, 2, 0);
|
|
|
|
myGroupWidgetLayout->addWidget(myGroupType, 2, 1);
|
|
|
|
myGroupWidgetLayout->addWidget(myGroupNbLab, 3, 0);
|
|
|
|
myGroupWidgetLayout->addWidget(myGroupNb, 3, 1);
|
|
|
|
myGroupWidgetLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 4, 0);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// buttons
|
2009-02-17 10:27:49 +05:00
|
|
|
myButtonsGroup = new QGroupBox(this);
|
|
|
|
QHBoxLayout* myButtonsGroupLayout = new QHBoxLayout(myButtonsGroup);
|
|
|
|
myButtonsGroupLayout->setSpacing(SPACING); myButtonsGroupLayout->setMargin(MARGIN);
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
// buttons --> OK and Help buttons
|
2009-02-17 10:27:49 +05:00
|
|
|
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup);
|
|
|
|
myOkBtn->setAutoDefault(true); myOkBtn->setDefault(true);
|
|
|
|
myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup);
|
|
|
|
myHelpBtn->setAutoDefault(true);
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
myButtonsGroupLayout->addWidget(myOkBtn);
|
2009-02-17 10:27:49 +05:00
|
|
|
myButtonsGroupLayout->addSpacing(10);
|
2004-06-18 14:34:31 +06:00
|
|
|
myButtonsGroupLayout->addStretch();
|
2006-05-06 14:51:48 +06:00
|
|
|
myButtonsGroupLayout->addWidget(myHelpBtn);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
aTopLayout->addLayout(aSelectLayout);
|
|
|
|
aTopLayout->addWidget(myWGStack);
|
|
|
|
aTopLayout->addWidget(myButtonsGroup);
|
|
|
|
|
|
|
|
mySMESHGUI->SetActiveDialogBox(this);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// connect signals
|
2005-06-07 19:22:20 +06:00
|
|
|
connect(myOkBtn, SIGNAL(clicked()), this, SLOT(close()));
|
2006-05-06 14:51:48 +06:00
|
|
|
connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
|
2005-06-07 19:22:20 +06:00
|
|
|
connect(mySelectBtn, SIGNAL(clicked()), this, SLOT(onStartSelection()));
|
|
|
|
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
|
|
|
|
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
|
|
|
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// init dialog with current selection
|
|
|
|
onSelectionChanged();
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
myHelpFileName = "mesh_infos_page.html#advanced_mesh_infos_anchor";
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : ~SMESHGUI_MeshInfosDlg()
|
|
|
|
// purpose : Destructor
|
2003-05-19 20:07:00 +06:00
|
|
|
//=================================================================================
|
2004-06-18 14:34:31 +06:00
|
|
|
SMESHGUI_MeshInfosDlg::~SMESHGUI_MeshInfosDlg()
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2005-06-07 19:22:20 +06:00
|
|
|
// function : DumpMeshInfos()
|
|
|
|
// purpose :
|
2003-05-19 20:07:00 +06:00
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_MeshInfosDlg::DumpMeshInfos()
|
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
SUIT_OverrideCursor wc;
|
|
|
|
|
|
|
|
SALOME_ListIO aList;
|
|
|
|
mySelectionMgr->selectedObjects(aList);
|
|
|
|
|
|
|
|
int nbSel = aList.Extent();
|
|
|
|
if (nbSel == 1) {
|
2004-06-18 14:34:31 +06:00
|
|
|
myStartSelection = false;
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectLab->setText("");
|
|
|
|
Handle(SALOME_InteractiveObject) IObject = aList.First();
|
|
|
|
_PTR(SObject) aSO = SMESH::GetActiveStudyDocument()->FindObjectID(IObject->getEntry());
|
|
|
|
if (aSO) {
|
|
|
|
//CORBA::Object_var anObject = aSO->GetObject();
|
|
|
|
CORBA::Object_var anObject = SMESH::SObjectToObject(aSO);
|
|
|
|
if (!CORBA::is_nil(anObject)) {
|
|
|
|
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObject);
|
|
|
|
if (!aMesh->_is_nil()) {
|
2009-02-17 10:27:49 +05:00
|
|
|
myWGStack->setCurrentWidget(myMeshWidget);
|
|
|
|
setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshName->setText(aSO->GetName().c_str());
|
|
|
|
myMeshNbNodes->setNum((int)aMesh->NbNodes());
|
|
|
|
myMeshNbEdges->setNum((int)aMesh->NbEdges());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbEdges1->setNum((int)aMesh->NbEdgesOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbEdges2->setNum((int)aMesh->NbEdgesOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbFaces->setNum((int)aMesh->NbFaces());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbFaces1->setNum((int)aMesh->NbFacesOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbFaces2->setNum((int)aMesh->NbFacesOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbTriangles->setNum((int)aMesh->NbTriangles());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbTriangles1->setNum((int)aMesh->NbTrianglesOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbTriangles2->setNum((int)aMesh->NbTrianglesOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbQuadrangles->setNum((int)aMesh->NbQuadrangles());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbQuadrangles1->setNum((int)aMesh->NbQuadranglesOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbQuadrangles2->setNum((int)aMesh->NbQuadranglesOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPolygones->setNum( (int)aMesh->NbPolygons() );
|
|
|
|
myMeshNbVolumes->setNum((int)aMesh->NbVolumes());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbVolumes1->setNum((int)aMesh->NbVolumesOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbVolumes2->setNum((int)aMesh->NbVolumesOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbTetra->setNum((int)aMesh->NbTetras());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbTetra1->setNum((int)aMesh->NbTetrasOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbTetra2->setNum((int)aMesh->NbTetrasOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbHexa->setNum((int)aMesh->NbHexas());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbHexa1->setNum((int)aMesh->NbHexasOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbHexa2->setNum((int)aMesh->NbHexasOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPrism->setNum((int)aMesh->NbPrisms());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbPrism1->setNum((int)aMesh->NbPrismsOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbPrism2->setNum((int)aMesh->NbPrismsOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPyra->setNum((int)aMesh->NbPyramids());
|
2006-05-06 14:51:48 +06:00
|
|
|
myMeshNbPyra1->setNum((int)aMesh->NbPyramidsOfOrder(SMESH::ORDER_LINEAR));
|
|
|
|
myMeshNbPyra2->setNum((int)aMesh->NbPyramidsOfOrder(SMESH::ORDER_QUADRATIC));
|
2005-06-07 19:22:20 +06:00
|
|
|
myMeshNbPolyhedrones->setNum( (int)aMesh->NbPolyhedrons() );
|
2004-06-18 14:34:31 +06:00
|
|
|
return;
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObject);
|
|
|
|
if (!aSubMesh->_is_nil()) {
|
2009-02-17 10:27:49 +05:00
|
|
|
myWGStack->setCurrentWidget(mySubMeshWidget);
|
|
|
|
setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_SUBMESH") + "]");
|
2005-06-07 19:22:20 +06:00
|
|
|
mySubMeshName->setText(aSO->GetName().c_str());
|
|
|
|
mySubMeshNbNodes->setNum((int)aSubMesh->GetNumberOfNodes(true));
|
|
|
|
mySubMeshNbElements->setNum((int)aSubMesh->GetNumberOfElements());
|
|
|
|
mySubMeshNbEdges->setNum((int)(aSubMesh->GetElementsByType(SMESH::EDGE)->length()));
|
|
|
|
mySubMeshNbFaces->setNum((int)(aSubMesh->GetElementsByType(SMESH::FACE)->length()));
|
|
|
|
mySubMeshNbVolumes->setNum((int)(aSubMesh->GetElementsByType(SMESH::VOLUME)->length()));
|
2004-06-18 14:34:31 +06:00
|
|
|
return;
|
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
|
|
|
|
if (!aGroup->_is_nil()) {
|
2009-02-17 10:27:49 +05:00
|
|
|
myWGStack->setCurrentWidget(myGroupWidget);
|
|
|
|
setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_GROUP") + "]");
|
2005-06-07 19:22:20 +06:00
|
|
|
myGroupName->setText(aSO->GetName().c_str());
|
2004-06-18 14:34:31 +06:00
|
|
|
int aType = aGroup->GetType();
|
|
|
|
QString strType;
|
2005-06-07 19:22:20 +06:00
|
|
|
switch (aType) {
|
2004-06-18 14:34:31 +06:00
|
|
|
case SMESH::NODE:
|
|
|
|
strType = "SMESH_MESHINFO_NODES"; break;
|
|
|
|
case SMESH::EDGE:
|
|
|
|
strType = "SMESH_MESHINFO_EDGES"; break;
|
|
|
|
case SMESH::FACE:
|
|
|
|
strType = "SMESH_MESHINFO_FACES"; break;
|
|
|
|
case SMESH::VOLUME:
|
|
|
|
strType = "SMESH_MESHINFO_VOLUMES"; break;
|
|
|
|
default:
|
|
|
|
strType = "SMESH_MESHINFO_ALL_TYPES"; break;
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
myGroupType->setText(tr(strType.toLatin1().data()));
|
2005-06-07 19:22:20 +06:00
|
|
|
myGroupNb->setNum((int)aGroup->Size());
|
2004-06-18 14:34:31 +06:00
|
|
|
return;
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
}
|
2009-02-17 10:27:49 +05:00
|
|
|
myWGStack->setCurrentIndex(0);
|
|
|
|
setWindowTitle(tr("SMESH_MESHINFO_TITLE"));
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : SelectionIntoArgument()
|
|
|
|
// purpose : Called when selection has changed
|
|
|
|
//=================================================================================
|
2004-06-18 14:34:31 +06:00
|
|
|
void SMESHGUI_MeshInfosDlg::onSelectionChanged()
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
if (myStartSelection)
|
2004-06-18 14:34:31 +06:00
|
|
|
DumpMeshInfos();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : closeEvent()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2009-02-17 10:27:49 +05:00
|
|
|
void SMESHGUI_MeshInfosDlg::closeEvent(QCloseEvent* e)
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
mySMESHGUI->ResetState();
|
|
|
|
QDialog::closeEvent(e);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
2004-06-18 14:34:31 +06:00
|
|
|
// function : windowActivationChange()
|
|
|
|
// purpose : called when window is activated/deactivated
|
2003-05-19 20:07:00 +06:00
|
|
|
//=================================================================================
|
2009-02-17 10:27:49 +05:00
|
|
|
void SMESHGUI_MeshInfosDlg::windowActivationChange(bool oldActive)
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
QDialog::windowActivationChange(oldActive);
|
|
|
|
if (isActiveWindow() && myIsActiveWindow != isActiveWindow())
|
|
|
|
ActivateThisDialog();
|
2004-06-18 14:34:31 +06:00
|
|
|
myIsActiveWindow = isActiveWindow();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : DeactivateActiveDialog()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_MeshInfosDlg::DeactivateActiveDialog()
|
|
|
|
{
|
2005-06-07 19:22:20 +06:00
|
|
|
disconnect(mySelectionMgr, 0, this, 0);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : ActivateThisDialog()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_MeshInfosDlg::ActivateThisDialog()
|
|
|
|
{
|
|
|
|
/* Emit a signal to deactivate any active dialog */
|
2005-06-07 19:22:20 +06:00
|
|
|
mySMESHGUI->EmitSignalDeactivateDialog();
|
|
|
|
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
//=================================================================================
|
|
|
|
// function : onStartSelection()
|
|
|
|
// purpose : starts selection
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_MeshInfosDlg::onStartSelection()
|
|
|
|
{
|
|
|
|
myStartSelection = true;
|
|
|
|
onSelectionChanged();
|
|
|
|
myStartSelection = true;
|
2005-06-07 19:22:20 +06:00
|
|
|
mySelectLab->setText(tr("INF_SELECT_OBJECT"));
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
2006-05-06 14:51:48 +06:00
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : onHelp()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_MeshInfosDlg::onHelp()
|
|
|
|
{
|
|
|
|
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
|
|
|
|
if (app)
|
|
|
|
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
|
|
|
|
else {
|
2009-02-17 10:27:49 +05:00
|
|
|
QString platform;
|
2008-03-07 12:47:05 +05:00
|
|
|
#ifdef WIN32
|
2009-02-17 10:27:49 +05:00
|
|
|
platform = "winapplication";
|
2008-03-07 12:47:05 +05:00
|
|
|
#else
|
2009-02-17 10:27:49 +05:00
|
|
|
platform = "application";
|
2008-03-07 12:47:05 +05:00
|
|
|
#endif
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
|
|
|
|
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
|
|
|
|
arg(app->resourceMgr()->stringValue("ExternalBrowser",
|
|
|
|
platform)).
|
|
|
|
arg(myHelpFileName));
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
|
|
|
}
|
2008-03-07 12:47:05 +05:00
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : keyPressEvent()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void SMESHGUI_MeshInfosDlg::keyPressEvent( QKeyEvent* e )
|
|
|
|
{
|
|
|
|
QDialog::keyPressEvent( e );
|
|
|
|
if ( e->isAccepted() )
|
|
|
|
return;
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
if ( e->key() == Qt::Key_F1 ) {
|
|
|
|
e->accept();
|
|
|
|
onHelp();
|
|
|
|
}
|
2008-03-07 12:47:05 +05:00
|
|
|
}
|