case Plot2d_AnalyticalCurve::ActRemoveFromView:
item->hide();
item->detach();
- myAnalyticalCurves.removeAll(c);
- delete c;
break;
}
void Plot2d_ViewFrame::updateAnalyticalCurves()
{
AnalyticalCurveList::iterator it = myAnalyticalCurves.begin();
+ AnalyticalCurveList toDelete;
for( ; it != myAnalyticalCurves.end(); it++) {
- updateAnalyticalCurve(*it);
+ Plot2d_AnalyticalCurve* c = (*it);
+ updateAnalyticalCurve(c);
+ if(c && c->getAction() == Plot2d_AnalyticalCurve::ActRemoveFromView)
+ toDelete.push_back(c);
+ }
+ it = toDelete.begin();
+ for( ; it != toDelete.end(); it++) {
+ Plot2d_AnalyticalCurve* c = (*it);
+ myAnalyticalCurves.removeAll(c);
+ delete c;
+ c = NULL;
}
myPlot->replot();
}
*/
AnalyticalCurveList Plot2d_ViewFrame::getAnalyticalCurves() const
{
- return myAnalyticalCurves;
+ return myAnalyticalCurves ;
}
/*!