_PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
SalomeApp_Study* salome_study = GetAppStudy( theModule );
- for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() )
+ for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
salome_study->deleteReferencesTo( aChildIter->Value() );
+ _PTR(SObject) aSO = aChildIter->Value();
+ if(aSO){
+ if (getValue(aSO, "myComment") == QString("CURVE")) {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(aServant.in());
+ if(pCrv){
+ PlotRemoveCurve(theModule,pCrv);
+ }
+ }
+ }
+ }
+
+ }
aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
#include "SPlot2d_ViewModel.h"
#include "Plot2d_ViewFrame.h"
+#include "Plot2d_ViewManager.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
aPlot->Repaint();
}
+ void
+ PlotRemoveCurve(const SalomeApp_Module* theModule,
+ VISU::Curve_i* pCrv)
+ {
+ QString anEntry = pCrv->GetEntry();
+ ViewManagerList pvm_list;
+ theModule->getApp()->viewManagers( SPlot2d_Viewer::Type(), pvm_list );
+ for( SUIT_ViewManager* mgr = pvm_list.first(); mgr; mgr = pvm_list.next() ){
+ Plot2d_ViewManager* pvm = dynamic_cast<Plot2d_ViewManager*>( mgr );
+ if( pvm ){
+ SPlot2d_Viewer* aSPlot2d = dynamic_cast<SPlot2d_Viewer*>( pvm->getViewModel() );
+ if( aSPlot2d ){
+ Plot2d_ViewFrame* aPlot = aSPlot2d->getActiveViewFrame();
+ if(aPlot){
+ QList<Plot2d_Curve> clist;
+ aPlot->getCurves( clist );
+ SPlot2d_Curve* plotCurve = 0;
+ SPlot2d_Curve* tmpCurve;
+ for (int i = 0; i < clist.count(); i++) {
+ tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+ if (tmpCurve &&
+ tmpCurve->hasIO() &&
+ (tmpCurve->getIO()->getEntry() == anEntry))
+ aPlot->eraseCurve(clist.at(i));
+ }
+ }
+ }
+ }
+ }
+ }
+
void
PlotContainer(const SalomeApp_Module* theModule,
VISU::Container_i* container,
void PlotCurve( const SalomeApp_Module* theModule,
VISU::Curve_i* curve,
int theDisplaying );
+ void PlotRemoveCurve(const SalomeApp_Module* theModule,
+ VISU::Curve_i* curve);
void PlotContainer( const SalomeApp_Module* theModule,
VISU::Container_i* container,
int theDisplaying );