getObjects( anObjects );
eraseObjects( anObjects, false );
myObjects.clear();
+ // Erase all the intermittent segments who connect curves
+ // (cf displayPlot2dCurveList() and createSegment(() )
+ //
+ {
+ int nbSeg = myIntermittentSegmentList.size();
+ for (int iseg=0; iseg < nbSeg; iseg++)
+ {
+ QwtPlotCurve *segment = myIntermittentSegmentList[iseg];
+ segment->detach(); // erase in QwtPlot window
+ delete segment;
+ }
+ myIntermittentSegmentList.clear();
+ }
myPlot->replot();
if ( myPlot->zoomer() ) myPlot->zoomer()->setZoomBase();
}
* Draw connection segments (intermittent line) between all the curves of a component.
*/
void Plot2d_ViewFrame::displayPlot2dCurveList( QList< QList<Plot2d_Curve*> > sysCoCurveList,
- Plot2d_QwtPlotPicker* picker)
+ Plot2d_QwtPlotPicker* picker,
+ bool displayLegend)
{
//std::cout << "Plot2d_ViewFrame::displayPlot2dCurveList() 1" << std::endl;
// 2)- Display list curves by a component's curves group
// Draw connection segments (intermittent line) between the curves
- displayPlot2dCurveList( plot2dCurveCoSysList, nbSystem, picker);
+ displayPlot2dCurveList( plot2dCurveCoSysList, nbSystem, picker, displayLegend);
// 3)- Size of graduations labels and texts under X axis
*/
void Plot2d_ViewFrame::displayPlot2dCurveList( QList<Plot2d_Curve*> curveList,
int groupSize,
- Plot2d_QwtPlotPicker* picker)
+ Plot2d_QwtPlotPicker* picker,
+ bool displayLegend)
{
//std::cout << "Plot2d_ViewFrame::displayPlot2dCurveList() 2" << std::endl;
// Consider the new legend's entries
- // (we must remove and put the QwtLegend in the QwtPlot)
+ // (PB: to update the legend we must remove it and put a new QwtLegend in the QwtPlot)
myPlot->insertLegend( (QwtLegend*)NULL); // we remove here, we shall put at the end
double X[2];
icur1 = icur2 + 1;
}
- // Consider the new legend's entries
- showLegend( true, true);
+ if (displayLegend)
+ {
+ // Consider the new legend's entries
+ showLegend( true, true);
+ }
//std::cout << "Ok for Plot2d_ViewFrame::displayPlot2dCurveList() 2" << std::endl;
}
QColor & lineColor,
QwtSymbol::Style markerKind,
Plot2d_QwtPlotPicker* picker,
- bool toDraw)
+ bool toDraw,
+ bool displayLegend)
{
//std::cout << "Plot2d_ViewFrame::createPlot2dCurve()" << std::endl;
// Graphical curve (QwtPlotCurve) in the drawing zone (QwtPlot) myPlot
if (toDraw)
{
+ if (!displayLegend)
+ {
+ myPlot->insertLegend( (QwtLegend*)NULL);
+ }
displayCurve( plot2dCurve);
// plot points marker create associated tooltips
aPCurve->setItemAttribute( QwtPlotItem::Legend, false);
aPCurve->attach( myPlot);
+ // To deallocate in EraseAll()
+ myIntermittentSegmentList.append( aPCurve);
}
/*!
Plot2d_QwtPlotPicker *picker);
void displayPlot2dCurveList( QList< QList<Plot2d_Curve*> > sysCoCurveList,
- Plot2d_QwtPlotPicker* picker);
+ Plot2d_QwtPlotPicker* picker,
+ bool displayLegend);
void displayPlot2dCurveList( QList<Plot2d_Curve*> curveList,
int groupsize,
- Plot2d_QwtPlotPicker* picker);
+ Plot2d_QwtPlotPicker* picker,
+ bool displayLegend);
Plot2d_Curve* createPlot2dCurve( QString & title,
QString & unit,
QColor & lineColor,
QwtSymbol::Style markerKind,
Plot2d_QwtPlotPicker* picker,
- bool toDraw);
+ bool toDraw,
+ bool displayLegend=true);
QColor getPlot2dCurveColor( Plot2d_Curve* plot2dCurve);
Plot2d_NormalizeAlgorithm* myLNormAlgo;
Plot2d_NormalizeAlgorithm* myRNormAlgo;
bool myIsDefTitle;
+ private:
+ // List of intermittent segments to connect curves
+ // (cf displayPlot2dCurveList() and createSegment(() )
+ QList<QwtPlotCurve*> myIntermittentSegmentList;
};
class Plot2d_Plot2d : public QwtPlot