-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "SUIT_ViewManager.h"
#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
#include <QApplication>
#include <QToolBar>
#include <qwt_plot_curve.h>
#include <stdlib.h>
-//ASL: Temporary commented in order to avoir dependency on SALOMEDS
-
-//#include "SALOMEDSClient.hxx"
-//#include "SALOMEDS_StudyManager.hxx"
-
-// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
-// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
-// SALOMEDS::StudyManager - no linkage with SalomeApp.
-
-/*static _PTR(Study) getStudyDS()
-{
- SALOMEDSClient_Study* aStudy = NULL;
- _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
-
- // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
- // id of its underlying SALOMEDS::Study
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return _PTR(Study)(aStudy);
- SUIT_Study* stud = app->activeStudy();
- if ( !stud ) return _PTR(Study)(aStudy);
- const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
- // get SALOMEDS_Study with this id from StudyMgr
- return aMgr->GetStudyByID( id );
-} */
-
/*!
Constructor
*/
}
if( aCurve && aCurve->hasTableIO() && aCurve->getTableIO()->isSame( IObject ) )
- aCurve->getTableIO()->setName( newName.toLatin1() );
+ aCurve->getTableIO()->setName( newName.toUtf8() );
}
aViewFrame->updateTitles();
}
/*!
Removes all curves from the view
*/
-void SPlot2d_Viewer::EraseAll(const bool /*forced*/)
+void SPlot2d_Viewer::EraseAll(SALOME_Displayer* d, const bool forced)
{
Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
if(aViewFrame) aViewFrame->EraseAll();
+ SALOME_View::EraseAll(d, forced);
}
/*!
SALOME_Prs* SPlot2d_Viewer::CreatePrs( const char* entry )
{
Plot2d_ViewFrame* aViewFrame = getActiveViewFrame();
- SPlot2d_Prs *prs = new SPlot2d_Prs();
+ SPlot2d_Prs *prs = new SPlot2d_Prs( entry );
if(aViewFrame)
{
CurveDict aCurves = aViewFrame->getCurves();
QwtPlotItem* plotItem = aViewFrame->getPlot()->infoToItem( itemInfo );
- bool isAnalytical = false;
+ bool isCurveSelected = false;
+ CurveDict aCurves = aViewFrame->getCurves();
+ for( CurveDict::Iterator it = aCurves.begin(); it != aCurves.end(); ++it )
+ {
+ if(plotItem == it.key()) {
+ isCurveSelected = true;
+ it.value()->setSelected(true);
+ } else {
+ it.value()->setSelected(false);
+ }
+ }
+
AnalyticalCurveList curves = aViewFrame->getAnalyticalCurves();
foreach ( Plot2d_AnalyticalCurve* curve, curves ) {
if(plotItem == curve->plotItem()) {
- isAnalytical = true;
+ isCurveSelected = true;
curve->setSelected(true);
} else {
curve->setSelected(false);
}
}
- if(isAnalytical) {
+ if(isCurveSelected) {
+ for( CurveDict::Iterator it = aCurves.begin(); it != aCurves.end(); ++it )
+ aViewFrame->updateCurve( it.value() );
+
myDeselectAnalytical = false;
emit clearSelected();
aViewFrame->updateAnalyticalCurves();
}
Plot2d_Object* anObject = aViewFrame->getPlotObject(plotItem);
-
if(anObject) {
// Highlight object in Object Browser