X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_VTKUtils.cxx;h=184eb903cb05f34e53a23b96a6d746761d2155fb;hb=18e0bef9d9707917ea1b354d83830c9e2bedf1a3;hp=450aca68d574750dd2338a4f3ecfee207965a26b;hpb=daa2cf53970e196bfe3c82cfde426f1ccc43e630;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 450aca68d..184eb903c 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -30,6 +30,7 @@ #include "SMESHGUI.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_Filter.h" +#include "SMESH_ControlsDef.hxx" #include #include @@ -56,6 +57,12 @@ #include #include +#ifndef DISABLE_PLOT2DVIEWER +#include +#include +#include +#endif + // SALOME KERNEL includes #include @@ -652,6 +659,9 @@ namespace SMESH VISUAL_OBJ_CONT.erase(aKey); } } +#ifndef DISABLE_PLOT2DVIEWER + ProcessIn2DViewers(theActor,RemoveFrom2dViewer); +#endif theActor->Delete(); vtkWnd->Repaint(); } @@ -1303,4 +1313,44 @@ namespace SMESH DistanceToPosition( theBounds, theNormal, theDist, theOrigin ); return true; } + +#ifndef DISABLE_PLOT2DVIEWER + //======================================================================= + /** + Get histogram from the input actor + Repaint/Remove the histogram in/from each opened Plot2D Viewer + */ + //======================================================================= + void ProcessIn2DViewers( SMESH_Actor *theActor, Viewer2dActionType aType ) { + SalomeApp_Application* anApp = dynamic_cast(SUIT_Session::session()->activeApplication()); + + if(!anApp || !theActor) + return; + + SPlot2d_Histogram* aHistogram = 0; + if(theActor->GetPlot2Histogram()) + aHistogram = theActor->UpdatePlot2Histogram(); + else + return; + + ViewManagerList aViewManagerList; + anApp->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList); + + aType = aHistogram->getPointList().empty() ? RemoveFrom2dViewer : aType; + + SUIT_ViewManager* aViewManager; + foreach( aViewManager, aViewManagerList ) { + if (Plot2d_ViewManager* aManager = dynamic_cast(aViewManager)) { + if (SPlot2d_Viewer* aViewer = dynamic_cast(aManager->getViewModel())) { + if (Plot2d_ViewFrame* aViewFrame = aViewer->getActiveViewFrame()) { + if(aType == UpdateIn2dViewer ) + aViewFrame->displayObject(aHistogram, true); + else if (aType == RemoveFrom2dViewer) + aViewFrame->eraseObject(aHistogram, true); + } + } + } + } + } +#endif //DISABLE_PLOT2DVIEWER } // end of namespace SMESH