Salome HOME
0054474: TC9.2.0: SMESH: selection and context menu popup in the Object Browser is...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshInfo.cxx
index 57bd8236d37d1f2a449bc0c9f72c7396260067b7..9c1fb881066601f933ab195f183e260f0a9fb64e 100644 (file)
@@ -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
@@ -2083,7 +2083,9 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& 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 );
@@ -3247,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<SalomeApp_Study *>( app->activeStudy() );
-  if ( !appStudy ) return;
-  _PTR( Study ) aStudy = appStudy->studyDS();
-
   QStringList aFilters;
   aFilters.append( tr( "TEXT_FILES" ));
 
@@ -3488,9 +3484,9 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent )
  
   myMainLayout->setColumnStretch(  0,  0 );
   myMainLayout->setColumnStretch(  1,  5 );
-  myMainLayout->setRowStretch   ( 11,  5 );
-  myMainLayout->setRowStretch   ( 16,  5 );
-  myMainLayout->setRowStretch   ( 17,  1 );
+  myMainLayout->setRowStretch   ( 12,  5 );
+  myMainLayout->setRowStretch   ( 17,  5 );
+  myMainLayout->setRowStretch   ( 18,  1 );
 
   clearInternal();
 }
@@ -3580,17 +3576,17 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
 
   // nodes info
   const CORBA::Long nbNodes =   nbElemsByType[ SMESH::NODE ];
-  const CORBA::Long nbElems = ( nbElemsByType[ SMESH::EDGE ] +
-                                nbElemsByType[ SMESH::FACE ] +
-                                nbElemsByType[ SMESH::VOLUME ] );
-  if ( nbNodes + nbElems > 0 ) {
-    if ( Max( (int)nbNodes, (int)nbElems ) <= ctrlLimit ) {
+  // const CORBA::Long nbElems = ( nbElemsByType[ SMESH::EDGE ] +
+  //                               nbElemsByType[ SMESH::FACE ] +
+  //                               nbElemsByType[ SMESH::VOLUME ] );
+  if ( nbNodes > 0 ) {
+    if ( nbNodes <= ctrlLimit ) {
       // free nodes
       computeFreeNodesInfo();
+      // node connectivity number
       computeNodesNbConnInfo();
       // double nodes
-      if ( Max( (int)mesh->NbNodes(), (int)mesh->NbElements() ) <= ctrlLimit )
-        computeDoubleNodesInfo();
+      computeDoubleNodesInfo();
     }
     else {
       myButtons[0]->setEnabled( true );
@@ -3599,7 +3595,7 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
     }
   }
   else {
-    for( int i=2; i<=11; i++)
+    for( int i=2; i<=13; i++)
       myMainLayout->itemAt(i)->widget()->setVisible( false );
   }
 
@@ -3612,7 +3608,7 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
       myButtons[3]->setEnabled( true );
   }
   else {
-    for( int i=11; i<=14; i++)
+    for( int i=14; i<=17; i++)
       myMainLayout->itemAt(i)->widget()->setVisible( false );
   }
  
@@ -3632,13 +3628,11 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
       myButtons[6]->setEnabled( true );
     }
 #ifdef DISABLE_PLOT2DVIEWER
-    myMainLayout->setRowStretch(12,0);
     for( int i=25; i<=27; i++)
       myMainLayout->itemAt(i)->widget()->setVisible( false );
 #endif
   }
   else {
-    myMainLayout->setRowStretch(12,0);
     for( int i=18; i<=27; i++)
       myMainLayout->itemAt(i)->widget()->setVisible( false );
   }
@@ -3659,13 +3653,11 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
       myButtons[9]->setEnabled( true );
     }
 #ifdef DISABLE_PLOT2DVIEWER
-    myMainLayout->setRowStretch(17,0);
     for( int i=35; i<=37; i++)
       myMainLayout->itemAt(i)->widget()->setVisible( false );
 #endif
   }
   else {
-    myMainLayout->setRowStretch(17,0);
     for( int i=28; i<=37; i++)
       myMainLayout->itemAt(i)->widget()->setVisible( false );
   }
@@ -3803,7 +3795,7 @@ void SMESHGUI_CtrlInfo::computeAspectRatio3D()
 */
 void SMESHGUI_CtrlInfo::clearInternal()
 {
-  for( int i=0; i<=35; i++)
+  for( int i=0; i<=37; i++)
     myMainLayout->itemAt(i)->widget()->setVisible( true );
   for( int i=0; i<=9; i++)
     myButtons[i]->setEnabled( false );
@@ -3814,8 +3806,6 @@ void SMESHGUI_CtrlInfo::clearInternal()
   myWidgets[0]->setText( QString() );
   for ( int i = 1; i < myWidgets.count(); i++ )
     myWidgets[i]->setText( "" );
-  myMainLayout->setRowStretch(11,5);
-  myMainLayout->setRowStretch(16,5);
 }
 
 void SMESHGUI_CtrlInfo::setTolerance( double theTolerance )
@@ -4004,12 +3994,6 @@ void SMESHGUI_CtrlInfoDlg::deactivate()
  */
 void SMESHGUI_CtrlInfoDlg::dump()
 {
-  SUIT_Application* app = SUIT_Session::session()->activeApplication();
-  if ( !app ) return;
-  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study *>( app->activeStudy() );
-  if ( !appStudy ) return;
-  _PTR( Study ) aStudy = appStudy->studyDS();
-
   QStringList aFilters;
   aFilters.append( tr( "TEXT_FILES" ));