From 2387f9ae5d973ace5f7c7d3644a0b4da60680771 Mon Sep 17 00:00:00 2001 From: msv Date: Tue, 4 Apr 2006 12:53:54 +0000 Subject: [PATCH] Improvement IPAL12061: add mesh information about quadratic elements --- idl/SMESH_Mesh.idl | 36 ++++++++ src/SMESH/SMESH_Mesh.cxx | 117 +++++++++++++++++-------- src/SMESH/SMESH_Mesh.hxx | 27 ++++-- src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx | 100 +++++++++++++++++++-- src/SMESHGUI/SMESHGUI_MeshInfosDlg.h | 18 ++++ src/SMESHGUI/SMESH_msg_en.po | 12 ++- src/SMESH_I/SMESH_Mesh_i.cxx | 63 +++++++++++++ src/SMESH_I/SMESH_Mesh_i.hxx | 27 ++++++ 8 files changed, 348 insertions(+), 52 deletions(-) diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 4b7b54707..5ebb9115c 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -111,6 +111,15 @@ module SMESH FACE, VOLUME }; + + /*! + * ElementOrder points out entities of what order are requested + */ + enum ElementOrder { + ORDER_ANY, /*! entities of any order */ + ORDER_LINEAR, /*! entities of 1st order */ + ORDER_SQUARE /*! entities of 2nd order */ + }; /*! * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods) @@ -395,33 +404,60 @@ module SMESH long NbEdges() raises (SALOME::SALOME_Exception); + long NbEdgesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbFaces() raises (SALOME::SALOME_Exception); + long NbFacesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbTriangles() raises (SALOME::SALOME_Exception); + long NbTrianglesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbQuadrangles() raises (SALOME::SALOME_Exception); + long NbQuadranglesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPolygons() raises (SALOME::SALOME_Exception); long NbVolumes() raises (SALOME::SALOME_Exception); + long NbVolumesOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbTetras() raises (SALOME::SALOME_Exception); + long NbTetrasOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbHexas() raises (SALOME::SALOME_Exception); + long NbHexasOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPyramids() raises (SALOME::SALOME_Exception); + long NbPyramidsOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPrisms() raises (SALOME::SALOME_Exception); + long NbPrismsOfOrder(in ElementOrder order) + raises (SALOME::SALOME_Exception); + long NbPolyhedrons() raises (SALOME::SALOME_Exception); diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 634cf721c..543decd5d 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -979,10 +979,21 @@ int SMESH_Mesh::NbNodes() throw(SALOME_Exception) * */ //============================================================================= -int SMESH_Mesh::NbEdges() throw(SALOME_Exception) +int SMESH_Mesh::NbEdges(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - return _myMeshDS->NbEdges(); + if (order == ORDER_ANY) + return _myMeshDS->NbEdges(); + + int Nb = 0; + SMDS_EdgeIteratorPtr it = _myMeshDS->edgesIterator(); + while (it->more()) { + const SMDS_MeshEdge* cur = it->next(); + if ( order == ORDER_LINEAR && !cur->IsQuadratic() || + order == ORDER_SQUARE && cur->IsQuadratic() ) + Nb++; + } + return Nb; } //============================================================================= @@ -990,27 +1001,40 @@ int SMESH_Mesh::NbEdges() throw(SALOME_Exception) * */ //============================================================================= -int SMESH_Mesh::NbFaces() throw(SALOME_Exception) +int SMESH_Mesh::NbFaces(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - return _myMeshDS->NbFaces(); + if (order == ORDER_ANY) + return _myMeshDS->NbFaces(); + + int Nb = 0; + SMDS_FaceIteratorPtr it = _myMeshDS->facesIterator(); + while (it->more()) { + const SMDS_MeshFace* cur = it->next(); + if ( order == ORDER_LINEAR && !cur->IsQuadratic() || + order == ORDER_SQUARE && cur->IsQuadratic() ) + Nb++; + } + return Nb; } /////////////////////////////////////////////////////////////////////////////// /// Return the number of 3 nodes faces in the mesh. This method run in O(n) /////////////////////////////////////////////////////////////////////////////// -int SMESH_Mesh::NbTriangles() throw(SALOME_Exception) +int SMESH_Mesh::NbTriangles(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator(); - //while(itFaces->more()) if(itFaces->next()->NbNodes()==3) Nb++; - const SMDS_MeshFace * curFace; while (itFaces->more()) { - curFace = itFaces->next(); + const SMDS_MeshFace* curFace = itFaces->next(); + int nbnod = curFace->NbNodes(); if ( !curFace->IsPoly() && - ( curFace->NbNodes()==3 || curFace->NbNodes()==6 ) ) Nb++; + ( order == ORDER_ANY && (nbnod==3 || nbnod==6) || + order == ORDER_LINEAR && nbnod==3 || + order == ORDER_SQUARE && nbnod==6 ) ) + Nb++; } return Nb; } @@ -1018,18 +1042,20 @@ int SMESH_Mesh::NbTriangles() throw(SALOME_Exception) /////////////////////////////////////////////////////////////////////////////// /// Return the number of 4 nodes faces in the mesh. This method run in O(n) /////////////////////////////////////////////////////////////////////////////// -int SMESH_Mesh::NbQuadrangles() throw(SALOME_Exception) +int SMESH_Mesh::NbQuadrangles(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator(); - //while(itFaces->more()) if(itFaces->next()->NbNodes()==4) Nb++; - const SMDS_MeshFace * curFace; while (itFaces->more()) { - curFace = itFaces->next(); + const SMDS_MeshFace* curFace = itFaces->next(); + int nbnod = curFace->NbNodes(); if ( !curFace->IsPoly() && - ( curFace->NbNodes() == 4 || curFace->NbNodes()==8 ) ) Nb++; + ( order == ORDER_ANY && (nbnod==4 || nbnod==8) || + order == ORDER_LINEAR && nbnod==4 || + order == ORDER_SQUARE && nbnod==8 ) ) + Nb++; } return Nb; } @@ -1052,68 +1078,87 @@ int SMESH_Mesh::NbPolygons() throw(SALOME_Exception) * */ //============================================================================= -int SMESH_Mesh::NbVolumes() throw(SALOME_Exception) +int SMESH_Mesh::NbVolumes(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - return _myMeshDS->NbVolumes(); + if (order == ORDER_ANY) + return _myMeshDS->NbVolumes(); + + int Nb = 0; + SMDS_VolumeIteratorPtr it = _myMeshDS->volumesIterator(); + while (it->more()) { + const SMDS_MeshVolume* cur = it->next(); + if ( order == ORDER_LINEAR && !cur->IsQuadratic() || + order == ORDER_SQUARE && cur->IsQuadratic() ) + Nb++; + } + return Nb; } -int SMESH_Mesh::NbTetras() throw(SALOME_Exception) +int SMESH_Mesh::NbTetras(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==4) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); if ( !curVolume->IsPoly() && - ( curVolume->NbNodes() == 4 || curVolume->NbNodes()==10 ) ) Nb++; + ( order == ORDER_ANY && (nbnod==4 || nbnod==10) || + order == ORDER_LINEAR && nbnod==4 || + order == ORDER_SQUARE && nbnod==10 ) ) + Nb++; } return Nb; } -int SMESH_Mesh::NbHexas() throw(SALOME_Exception) +int SMESH_Mesh::NbHexas(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==8) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); if ( !curVolume->IsPoly() && - ( curVolume->NbNodes() == 8 || curVolume->NbNodes()==20 ) ) Nb++; + ( order == ORDER_ANY && (nbnod==8 || nbnod==20) || + order == ORDER_LINEAR && nbnod==8 || + order == ORDER_SQUARE && nbnod==20 ) ) + Nb++; } return Nb; } -int SMESH_Mesh::NbPyramids() throw(SALOME_Exception) +int SMESH_Mesh::NbPyramids(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==5) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); if ( !curVolume->IsPoly() && - ( curVolume->NbNodes() == 5 || curVolume->NbNodes()==13 ) ) Nb++; + ( order == ORDER_ANY && (nbnod==5 || nbnod==13) || + order == ORDER_LINEAR && nbnod==5 || + order == ORDER_SQUARE && nbnod==13 ) ) + Nb++; } return Nb; } -int SMESH_Mesh::NbPrisms() throw(SALOME_Exception) +int SMESH_Mesh::NbPrisms(ElementOrder order) throw(SALOME_Exception) { Unexpect aCatch(SalomeException); int Nb = 0; SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator(); - //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==6) Nb++; - const SMDS_MeshVolume * curVolume; while (itVolumes->more()) { - curVolume = itVolumes->next(); + const SMDS_MeshVolume* curVolume = itVolumes->next(); + int nbnod = curVolume->NbNodes(); if ( !curVolume->IsPoly() && - ( curVolume->NbNodes() == 6 || curVolume->NbNodes()==15 ) ) Nb++; + ( order == ORDER_ANY && (nbnod==6 || nbnod==15) || + order == ORDER_LINEAR && nbnod==6 || + order == ORDER_SQUARE && nbnod==15 ) ) + Nb++; } return Nb; } diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 93802346d..a9d570adc 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -174,25 +174,34 @@ public: int NbNodes() throw(SALOME_Exception); - int NbEdges() throw(SALOME_Exception); + /*! + * ElementOrder points out entities of what order are requested + */ + enum ElementOrder { + ORDER_ANY, /*! entities of any order */ + ORDER_LINEAR, /*! entities of 1st order */ + ORDER_SQUARE /*! entities of 2nd order */ + }; + + int NbEdges(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbFaces() throw(SALOME_Exception); + int NbFaces(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbTriangles() throw(SALOME_Exception); + int NbTriangles(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbQuadrangles() throw(SALOME_Exception); + int NbQuadrangles(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); int NbPolygons() throw(SALOME_Exception); - int NbVolumes() throw(SALOME_Exception); + int NbVolumes(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbTetras() throw(SALOME_Exception); + int NbTetras(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbHexas() throw(SALOME_Exception); + int NbHexas(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbPyramids() throw(SALOME_Exception); + int NbPyramids(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); - int NbPrisms() throw(SALOME_Exception); + int NbPrisms(ElementOrder order = ORDER_ANY) throw(SALOME_Exception); int NbPolyhedrons() throw(SALOME_Exception); diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx index b5a079a95..cc9d572ad 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx @@ -134,10 +134,23 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshNbNodes = new QLabel(myMeshWidget, "myMeshNbNodes"); myMeshNbNodes->setMinimumWidth(100); + // --> header with orders + QLabel* myMeshOrder0Lab = new QLabel(tr("SMESH_MESHINFO_ORDER0"), myMeshWidget, "myMeshOrder0Lab"); + QLabel* myMeshOrder1Lab = new QLabel(tr("SMESH_MESHINFO_ORDER1"), myMeshWidget, "myMeshOrder1Lab"); + QLabel* myMeshOrder2Lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), myMeshWidget, "myMeshOrder2Lab"); + QFont fnti = myMeshOrder0Lab->font(); fnti.setItalic(true); + myMeshOrder0Lab->setFont(fnti); + myMeshOrder1Lab->setFont(fnti); + myMeshOrder2Lab->setFont(fnti); + // --> edges QLabel* myMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), myMeshWidget, "myMeshNbEdgesLab"); myMeshNbEdges = new QLabel(myMeshWidget, "myMeshNbEdges"); myMeshNbEdges->setMinimumWidth(100); + myMeshNbEdges1 = new QLabel(myMeshWidget, "myMeshNbEdges1"); + myMeshNbEdges1->setMinimumWidth(100); + myMeshNbEdges2 = new QLabel(myMeshWidget, "myMeshNbEdges2"); + myMeshNbEdges2->setMinimumWidth(100); // --> faces myMeshFacesGroup = new QGroupBox(tr("SMESH_MESHINFO_FACES"), myMeshWidget, "myMeshFacesGroup"); @@ -153,16 +166,30 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshNbFaces = new QLabel(myMeshFacesGroup, "myMeshNbFaces"); myMeshNbFaces->setMinimumWidth(100); myMeshNbFaces->setFont(fnt); + myMeshNbFaces1 = new QLabel(myMeshFacesGroup, "myMeshNbFaces1"); + myMeshNbFaces1->setMinimumWidth(100); + myMeshNbFaces1->setFont(fnt); + myMeshNbFaces2 = new QLabel(myMeshFacesGroup, "myMeshNbFaces2"); + myMeshNbFaces2->setMinimumWidth(100); + myMeshNbFaces2->setFont(fnt); // --> faces --> triangles QLabel* myMeshNbTrianglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), myMeshFacesGroup, "myMeshNbTrianglesLab"); myMeshNbTriangles = new QLabel(myMeshFacesGroup, "myMeshNbTriangles"); myMeshNbTriangles->setMinimumWidth(100); + myMeshNbTriangles1 = new QLabel(myMeshFacesGroup, "myMeshNbTriangles1"); + myMeshNbTriangles1->setMinimumWidth(100); + myMeshNbTriangles2 = new QLabel(myMeshFacesGroup, "myMeshNbTriangles2"); + myMeshNbTriangles2->setMinimumWidth(100); // --> faces --> quadrangles QLabel* myMeshNbQuadranglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), myMeshFacesGroup, "myMeshNbQuadranglesLab"); myMeshNbQuadrangles = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles"); myMeshNbQuadrangles->setMinimumWidth(100); + myMeshNbQuadrangles1 = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles1"); + myMeshNbQuadrangles1->setMinimumWidth(100); + myMeshNbQuadrangles2 = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles2"); + myMeshNbQuadrangles2->setMinimumWidth(100); // --> faces --> polygons QLabel* myMeshNbPolygonesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYGONES" ) ), myMeshFacesGroup, "myMeshNbPolygonesLab" ); @@ -171,10 +198,16 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshFacesGroupLayout->addWidget(myMeshNbFacesLab, 0, 0); myMeshFacesGroupLayout->addWidget(myMeshNbFaces, 0, 1); + myMeshFacesGroupLayout->addWidget(myMeshNbFaces1, 0, 2); + myMeshFacesGroupLayout->addWidget(myMeshNbFaces2, 0, 3); myMeshFacesGroupLayout->addWidget(myMeshNbTrianglesLab, 1, 0); myMeshFacesGroupLayout->addWidget(myMeshNbTriangles, 1, 1); + myMeshFacesGroupLayout->addWidget(myMeshNbTriangles1, 1, 2); + myMeshFacesGroupLayout->addWidget(myMeshNbTriangles2, 1, 3); myMeshFacesGroupLayout->addWidget(myMeshNbQuadranglesLab, 2, 0); myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles, 2, 1); + myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles1, 2, 2); + myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles2, 2, 3); myMeshFacesGroupLayout->addWidget( myMeshNbPolygonesLab, 3, 0 ); myMeshFacesGroupLayout->addWidget( myMeshNbPolygones, 3, 1 ); @@ -192,26 +225,48 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, myMeshNbVolumes = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes"); myMeshNbVolumes->setMinimumWidth(100); myMeshNbVolumes->setFont(fnt); + myMeshNbVolumes1 = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes1"); + myMeshNbVolumes1->setMinimumWidth(100); + myMeshNbVolumes1->setFont(fnt); + myMeshNbVolumes2 = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes2"); + myMeshNbVolumes2->setMinimumWidth(100); + myMeshNbVolumes2->setFont(fnt); // --> volumes --> tetrahedrons QLabel* myMeshNbTetraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), myMeshVolumesGroup, "myMeshNbTetraLab"); myMeshNbTetra = new QLabel(myMeshVolumesGroup, "myMeshNbTetra"); myMeshNbTetra->setMinimumWidth(100); + myMeshNbTetra1 = new QLabel(myMeshVolumesGroup, "myMeshNbTetra1"); + myMeshNbTetra1->setMinimumWidth(100); + myMeshNbTetra2 = new QLabel(myMeshVolumesGroup, "myMeshNbTetra2"); + myMeshNbTetra2->setMinimumWidth(100); // --> volumes --> hexahedrons QLabel* myMeshNbHexaLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), myMeshVolumesGroup, "myMeshNbHexaLab"); myMeshNbHexa = new QLabel(myMeshVolumesGroup, "myMeshNbHexa"); - myMeshNbHexaLab->setMinimumWidth(100); + myMeshNbHexa->setMinimumWidth(100); + myMeshNbHexa1 = new QLabel(myMeshVolumesGroup, "myMeshNbHexa1"); + myMeshNbHexa1->setMinimumWidth(100); + myMeshNbHexa2 = new QLabel(myMeshVolumesGroup, "myMeshNbHexa2"); + myMeshNbHexa2->setMinimumWidth(100); // --> volumes --> prisms QLabel* myMeshNbPrismLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), myMeshVolumesGroup, "myMeshNbPrismLab"); myMeshNbPrism = new QLabel(myMeshVolumesGroup, "myMeshNbPrism"); myMeshNbPrism->setMinimumWidth(100); + myMeshNbPrism1 = new QLabel(myMeshVolumesGroup, "myMeshNbPrism1"); + myMeshNbPrism1->setMinimumWidth(100); + myMeshNbPrism2 = new QLabel(myMeshVolumesGroup, "myMeshNbPrism2"); + myMeshNbPrism2->setMinimumWidth(100); // --> volumes --> pyramids QLabel* myMeshNbPyraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), myMeshVolumesGroup, "myMeshNbPyraLab"); myMeshNbPyra = new QLabel(myMeshVolumesGroup, "myMeshNbPyra"); myMeshNbPyra->setMinimumWidth(100); + myMeshNbPyra1 = new QLabel(myMeshVolumesGroup, "myMeshNbPyra1"); + myMeshNbPyra1->setMinimumWidth(100); + myMeshNbPyra2 = new QLabel(myMeshVolumesGroup, "myMeshNbPyra2"); + myMeshNbPyra2->setMinimumWidth(100); // --> volumes --> polyherones QLabel* myMeshNbPolyhedronesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYEDRES" ) ), myMeshVolumesGroup, "myMeshNbPolyhedronLab" ); @@ -220,14 +275,24 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, 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 ); @@ -236,11 +301,16 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule, aMeshLayout->addMultiCellWidget(line1, 1, 1, 0, 1); aMeshLayout->addWidget(myMeshNbNodesLab, 2, 0); aMeshLayout->addWidget(myMeshNbNodes, 2, 1); - aMeshLayout->addWidget(myMeshNbEdgesLab, 3, 0); - aMeshLayout->addWidget(myMeshNbEdges, 3, 1); - aMeshLayout->addMultiCellWidget(myMeshFacesGroup, 4, 4, 0, 1); - aMeshLayout->addMultiCellWidget(myMeshVolumesGroup, 5, 5, 0, 1); - aMeshLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding), 6, 0); + 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->addMultiCellWidget(myMeshFacesGroup, 5, 5, 0, 3); + aMeshLayout->addMultiCellWidget(myMeshVolumesGroup, 6, 6, 0, 3); + aMeshLayout->addItem(new QSpacerItem(6, 6, QSizePolicy::Minimum, QSizePolicy::Expanding), 7, 0); // submesh mySubMeshWidget = new QWidget(myWGStack); @@ -415,15 +485,33 @@ void SMESHGUI_MeshInfosDlg::DumpMeshInfos() myMeshName->setText(aSO->GetName().c_str()); myMeshNbNodes->setNum((int)aMesh->NbNodes()); myMeshNbEdges->setNum((int)aMesh->NbEdges()); + myMeshNbEdges1->setNum((int)aMesh->NbEdgesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbEdges2->setNum((int)aMesh->NbEdgesOfOrder(SMESH::ORDER_SQUARE)); myMeshNbFaces->setNum((int)aMesh->NbFaces()); + myMeshNbFaces1->setNum((int)aMesh->NbFacesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbFaces2->setNum((int)aMesh->NbFacesOfOrder(SMESH::ORDER_SQUARE)); myMeshNbTriangles->setNum((int)aMesh->NbTriangles()); + myMeshNbTriangles1->setNum((int)aMesh->NbTrianglesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbTriangles2->setNum((int)aMesh->NbTrianglesOfOrder(SMESH::ORDER_SQUARE)); myMeshNbQuadrangles->setNum((int)aMesh->NbQuadrangles()); + myMeshNbQuadrangles1->setNum((int)aMesh->NbQuadranglesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbQuadrangles2->setNum((int)aMesh->NbQuadranglesOfOrder(SMESH::ORDER_SQUARE)); myMeshNbPolygones->setNum( (int)aMesh->NbPolygons() ); myMeshNbVolumes->setNum((int)aMesh->NbVolumes()); + myMeshNbVolumes1->setNum((int)aMesh->NbVolumesOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbVolumes2->setNum((int)aMesh->NbVolumesOfOrder(SMESH::ORDER_SQUARE)); myMeshNbTetra->setNum((int)aMesh->NbTetras()); + myMeshNbTetra1->setNum((int)aMesh->NbTetrasOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbTetra2->setNum((int)aMesh->NbTetrasOfOrder(SMESH::ORDER_SQUARE)); myMeshNbHexa->setNum((int)aMesh->NbHexas()); + myMeshNbHexa1->setNum((int)aMesh->NbHexasOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbHexa2->setNum((int)aMesh->NbHexasOfOrder(SMESH::ORDER_SQUARE)); myMeshNbPrism->setNum((int)aMesh->NbPrisms()); + myMeshNbPrism1->setNum((int)aMesh->NbPrismsOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbPrism2->setNum((int)aMesh->NbPrismsOfOrder(SMESH::ORDER_SQUARE)); myMeshNbPyra->setNum((int)aMesh->NbPyramids()); + myMeshNbPyra1->setNum((int)aMesh->NbPyramidsOfOrder(SMESH::ORDER_LINEAR)); + myMeshNbPyra2->setNum((int)aMesh->NbPyramidsOfOrder(SMESH::ORDER_SQUARE)); myMeshNbPolyhedrones->setNum( (int)aMesh->NbPolyhedrons() ); return; } diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h index 9907bec33..d06d39033 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h @@ -78,17 +78,35 @@ private: QLabel* myMeshName; QLabel* myMeshNbNodes; QLabel* myMeshNbEdges; + QLabel* myMeshNbEdges1; + QLabel* myMeshNbEdges2; QGroupBox* myMeshFacesGroup; QLabel* myMeshNbFaces; + QLabel* myMeshNbFaces1; + QLabel* myMeshNbFaces2; QLabel* myMeshNbTriangles; + QLabel* myMeshNbTriangles1; + QLabel* myMeshNbTriangles2; QLabel* myMeshNbQuadrangles; + QLabel* myMeshNbQuadrangles1; + QLabel* myMeshNbQuadrangles2; QLabel* myMeshNbPolygones; QGroupBox* myMeshVolumesGroup; QLabel* myMeshNbVolumes; + QLabel* myMeshNbVolumes1; + QLabel* myMeshNbVolumes2; QLabel* myMeshNbTetra; + QLabel* myMeshNbTetra1; + QLabel* myMeshNbTetra2; QLabel* myMeshNbHexa; + QLabel* myMeshNbHexa1; + QLabel* myMeshNbHexa2; QLabel* myMeshNbPyra; + QLabel* myMeshNbPyra1; + QLabel* myMeshNbPyra2; QLabel* myMeshNbPrism; + QLabel* myMeshNbPrism1; + QLabel* myMeshNbPrism2; QLabel* myMeshNbPolyhedrones; QWidget* mySubMeshWidget; diff --git a/src/SMESHGUI/SMESH_msg_en.po b/src/SMESHGUI/SMESH_msg_en.po index 59d3404db..7e038d20d 100644 --- a/src/SMESHGUI/SMESH_msg_en.po +++ b/src/SMESHGUI/SMESH_msg_en.po @@ -764,7 +764,17 @@ msgstr "Standard Mesh Infos" msgid "SMESH_MESHINFO_NAME" msgstr "Name" -#Faces : +#Order : +msgid "SMESH_MESHINFO_ORDER0" +msgstr "Total" + +msgid "SMESH_MESHINFO_ORDER1" +msgstr "Linear" + +msgid "SMESH_MESHINFO_ORDER2" +msgstr "Square" + +#Elements : msgid "SMESH_MESHINFO_ELEMENTS" msgstr "Elements" diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 86277a0e0..16ee57c78 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -1349,6 +1349,13 @@ CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception) return _impl->NbEdges(); } +CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbEdges( (::SMESH_Mesh::ElementOrder) order); +} + //============================================================================= /*! * @@ -1378,6 +1385,27 @@ CORBA::Long SMESH_Mesh_i::NbPolygons()throw(SALOME::SALOME_Exception) return _impl->NbPolygons(); } +CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbFaces( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbTriangles( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbQuadrangles( (::SMESH_Mesh::ElementOrder) order); +} + //============================================================================= /*! * @@ -1419,6 +1447,41 @@ CORBA::Long SMESH_Mesh_i::NbPolyhedrons()throw(SALOME::SALOME_Exception) return _impl->NbPolyhedrons(); } +CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbVolumes( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbTetras( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbHexas( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbPyramids( (::SMESH_Mesh::ElementOrder) order); +} + +CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) + throw(SALOME::SALOME_Exception) +{ + Unexpect aCatch(SALOME_SalomeException); + return _impl->NbPrisms( (::SMESH_Mesh::ElementOrder) order); +} + //============================================================================= /*! * diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index dcfa1a33d..4b468974e 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -178,33 +178,60 @@ public: CORBA::Long NbEdges() throw (SALOME::SALOME_Exception); + CORBA::Long NbEdgesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbFaces() throw (SALOME::SALOME_Exception); + CORBA::Long NbFacesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbTriangles() throw (SALOME::SALOME_Exception); + CORBA::Long NbTrianglesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbQuadrangles() throw (SALOME::SALOME_Exception); + CORBA::Long NbQuadranglesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPolygons() throw (SALOME::SALOME_Exception); CORBA::Long NbVolumes() throw (SALOME::SALOME_Exception); + CORBA::Long NbVolumesOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbTetras() throw (SALOME::SALOME_Exception); + CORBA::Long NbTetrasOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbHexas() throw (SALOME::SALOME_Exception); + CORBA::Long NbHexasOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPyramids() throw (SALOME::SALOME_Exception); + CORBA::Long NbPyramidsOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPrisms() throw (SALOME::SALOME_Exception); + CORBA::Long NbPrismsOfOrder(SMESH::ElementOrder order) + throw (SALOME::SALOME_Exception); + CORBA::Long NbPolyhedrons() throw (SALOME::SALOME_Exception); -- 2.39.2