X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MeshInfo.cxx;h=07066bf4605481b7d3e27ef45505cbf34a15b1f6;hp=03e542d6ab6e08daa665651fcde58f9dd6b43efe;hb=24412178e1a7c741a73d5b23822c43e08c353b97;hpb=88141f757b048eaa5aae0be49faaf274448bbcaf diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 03e542d6a..07066bf46 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -610,11 +610,11 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj ) myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] )); myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] )); long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DTotal + nb3DTotal; - long nbElemLinerial = info[SMDSEntity_Edge] + nb2DLinear + nb3DLinear; + long nbElemLinearial = info[SMDSEntity_Edge] + nb2DLinear + nb3DLinear; long nbElemQuadratic = info[SMDSEntity_Quad_Edge] + nb2DQuadratic + nb3DQuadratic; long nbElemBiQuadratic = nb2DBiQuadratic + nb3DBiQuadratic; myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( nbElemTotal )); - myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinerial )); + myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinearial )); myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( nbElemQuadratic )); myWidgets[iNb][iBiQuadratic]->setProperty( "text", QString::number( nbElemBiQuadratic )); // before full loading from study file, type of elements in a sub-mesh can't be defined @@ -1121,7 +1121,7 @@ SMESHGUI_ElemInfo::XYZ SMESHGUI_ElemInfo::gravityCenter( const SMDS_MeshElement* */ SMESHGUI_ElemInfo::XYZ SMESHGUI_ElemInfo::normal( const SMDS_MeshElement* element ) { - gp_XYZ n = SMESH::getNormale( dynamic_cast( element )); + gp_XYZ n = SMESH::getNormale( SMDS_Mesh::DownCast( element )); return XYZ(n.X(), n.Y(), n.Z()); } @@ -1397,7 +1397,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList& ids ) if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Ball ) { myInfo->append( QString( "%1? %2" ).arg( SMESHGUI_ElemInfo::tr( "QUADRATIC" )).arg( e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" )) ); } - if ( const SMDS_BallElement* ball = dynamic_cast( e )) { + if ( const SMDS_BallElement* ball = SMDS_Mesh::DownCast( e )) { // Ball diameter myInfo->append( QString( "%1: %2" ).arg( SMESHGUI_ElemInfo::tr( "BALL_DIAMETER" )).arg( ball->GetDiameter() )); } @@ -1915,7 +1915,7 @@ void SMESHGUI_TreeElemInfo::information( const QList& ids ) case SMDSEntity_Polyhedra: case SMDSEntity_Quad_Polyhedra: gtype = SMESHGUI_ElemInfo::tr( "POLYHEDRON" ); break; - default: + default: break; } if ( !gtype.isEmpty() ) { @@ -1930,7 +1930,7 @@ void SMESHGUI_TreeElemInfo::information( const QList& ids ) quadItem->setText( 0, SMESHGUI_ElemInfo::tr( "QUADRATIC" )); quadItem->setText( 1, e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" )); } - if ( const SMDS_BallElement* ball = dynamic_cast( e )) { + if ( const SMDS_BallElement* ball = SMDS_Mesh::DownCast< SMDS_BallElement >( e )) { // ball diameter QTreeWidgetItem* diamItem = createItem( elemItem, Bold ); diamItem->setText( 0, SMESHGUI_ElemInfo::tr( "BALL_DIAMETER" )); @@ -1949,12 +1949,14 @@ void SMESHGUI_TreeElemInfo::information( const QList& ids ) } } else { - const SMDS_VtkVolume* aVtkVolume = dynamic_cast(e); - SMDS_ElemIteratorPtr nodeIt = aVtkVolume->uniqueNodesIterator(); + SMDS_NodeIteratorPtr nodeIt = e->nodeIterator(); + std::set< const SMDS_MeshNode* > addedNodes; QList uniqueNodes; - while ( nodeIt->more() ) - uniqueNodes.append( nodeIt->next() ); - + while ( nodeIt->more() ) { + const SMDS_MeshNode* node = nodeIt->next(); + if ( addedNodes.insert( node ).second ) + uniqueNodes.append( nodeIt->next() ); + } SMDS_VolumeTool vtool( e ); const int nbFaces = vtool.NbFaces(); for( int face_id = 0; face_id < nbFaces; face_id++ ) { @@ -1963,10 +1965,10 @@ void SMESHGUI_TreeElemInfo::information( const QList& ids ) faceItem->setExpanded( true ); const SMDS_MeshNode** aNodeIds = vtool.GetFaceNodes( face_id ); - const int nbNodes = vtool.NbFaceNodes( face_id ); + const int nbNodes = vtool.NbFaceNodes ( face_id ); for( int node_id = 0; node_id < nbNodes; node_id++ ) { const SMDS_MeshNode* node = aNodeIds[node_id]; - nodeInfo( node, uniqueNodes.indexOf(node) + 1, aVtkVolume->NbUniqueNodes(), faceItem ); + nodeInfo( node, uniqueNodes.indexOf(node) + 1, uniqueNodes.size(), faceItem ); } } } @@ -2081,7 +2083,9 @@ void SMESHGUI_TreeElemInfo::information( const QList& ids ) afunctor->SetMesh( actor()->GetObject()->GetMesh() ); QTreeWidgetItem* minEdgeItem = createItem( cntrItem, Bold ); minEdgeItem->setText( 0, tr( "MIN_ELEM_EDGE" )); - minEdgeItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) ); + SMESH::Controls::TSequenceOfXYZ points; + afunctor->GetPoints( e, points ); // "non-standard" way, to make it work for all elem types + minEdgeItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( points )) ); // gravity center XYZ gc = gravityCenter( e ); @@ -3245,12 +3249,6 @@ void SMESHGUI_MeshInfoDlg::showItemInfo( const QString& theStr ) void SMESHGUI_MeshInfoDlg::dump() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !appStudy ) return; - _PTR( Study ) aStudy = appStudy->studyDS(); - QStringList aFilters; aFilters.append( tr( "TEXT_FILES" )); @@ -4002,12 +4000,6 @@ void SMESHGUI_CtrlInfoDlg::deactivate() */ void SMESHGUI_CtrlInfoDlg::dump() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !appStudy ) return; - _PTR( Study ) aStudy = appStudy->studyDS(); - QStringList aFilters; aFilters.append( tr( "TEXT_FILES" ));