- void PlotDistribution() {
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- if( !app )
- return;
-
- LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
- SALOME_ListIO selected;
- if ( aSel )
- aSel->selectedObjects( selected );
-
- if ( selected.Extent() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = selected.First();
- if ( anIO->hasEntry() ) {
- //Find Actor by entry before getting Plot2d viewer,
- //because after call getViewManager( Plot2d_Viewer::Type(), true ) active window is Plot2d Viewer
- SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() );
-
- SUIT_ViewManager* aViewManager = app->getViewManager( Plot2d_Viewer::Type(), true ); // create if necessary
-
- if( !aViewManager )
- return;
-
- SPlot2d_Viewer* aView = dynamic_cast<SPlot2d_Viewer*>(aViewManager->getViewModel());
- if ( !aView )
- return;
-
- Plot2d_ViewFrame* aPlot = aView->getActiveViewFrame();
- if ( !aPlot )
- return;
-
- if ( anActor && anActor->GetControlMode() != SMESH_Actor::eNone ) {
- SPlot2d_Histogram* aHistogram = anActor->UpdatePlot2Histogram();
- QString functorName = functorToString( anActor->GetFunctor());
- QString aHistogramName("%1 : %2");
- aHistogramName = aHistogramName.arg(anIO->getName()).arg(functorName);
- aHistogram->setName(aHistogramName);
- aHistogram->setHorTitle(functorName);
- aHistogram->setVerTitle(QObject::tr("DISTRIBUTION_NB_ENT"));
- aPlot->displayObject(aHistogram, true);
- }
- }
- }
- }
+ void PlotDistribution()
+ {
+ SalomeApp_Application* app =
+ dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if( !app )
+ return;
+
+ LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
+ SALOME_ListIO selected;
+ if ( aSel )
+ aSel->selectedObjects( selected );
+
+ if ( selected.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) anIO = selected.First();
+ if ( anIO->hasEntry() ) {
+ //Find Actor by entry before getting Plot2d viewer,
+ //because after call getViewManager( Plot2d_Viewer::Type(), true ) active window is Plot2d Viewer
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() );
+
+ SUIT_ViewManager* aViewManager =
+ app->getViewManager( Plot2d_Viewer::Type(), true ); // create if necessary
+ if( !aViewManager )
+ return;
+
+ SPlot2d_Viewer* aView = dynamic_cast<SPlot2d_Viewer*>(aViewManager->getViewModel());
+ if ( !aView )
+ return;
+
+ Plot2d_ViewFrame* aPlot = aView->getActiveViewFrame();
+ if ( !aPlot )
+ return;
+
+ if ( anActor && anActor->GetControlMode() != SMESH_Actor::eNone )
+ {
+ SPlot2d_Histogram* aHistogram = anActor->UpdatePlot2Histogram();
+ QString functorName = functorToString( anActor->GetFunctor());
+ QString aHistogramName("%1 : %2");
+ aHistogramName = aHistogramName.arg(anIO->getName()).arg(functorName);
+ aHistogram->setName(aHistogramName);
+ aHistogram->setHorTitle(functorName);
+ aHistogram->setVerTitle(QObject::tr("DISTRIBUTION_NB_ENT"));
+ aPlot->displayObject(aHistogram, true);
+ }
+ }
+ }
+ }