-/*!
- Insert one point for curve on some position.
-*/
-void Plot2d_Curve::insertPoint(int thePos, double theX, double theY, const QString& txt)
-{
- Plot2d_Point aPoint;
- aPoint.x = theX;
- aPoint.y = theY;
- aPoint.text = txt;
-
- pointList::iterator aIt;
- int aCurrent = 0;
- for(aIt = myPoints.begin(); aIt != myPoints.end(); ++aIt) {
- if (thePos == aCurrent) {
- myPoints.insert(aIt, aPoint);
- return;
+ Plot2d_Object::updatePlotItem( theItem );
+
+ Qt::PenStyle ps = Plot2d::plot2qwtLine( getLine() );
+ QwtSymbol::Style ms = Plot2d::plot2qwtMarker( getMarker() );
+
+ QColor aColor = isSelected() ? Plot2d_Object::selectionColor() : getColor();
+ int lineW = getLineWidth();
+ if ( isSelected() ) lineW += (lineW == 0 ? 3 : 2);
+
+ int markerS = isSelected() ? getMarkerSize() + 2 : getMarkerSize();
+
+ aCurve->setSelected(isSelected());
+
+ aCurve->setPen( QPen(aColor , lineW, ps ) );
+ aCurve->setSymbol( new QwtSymbol( ms, QBrush( aColor ),
+ QPen( aColor ),
+ QSize( markerS , markerS ) ) );
+
+ aCurve->setLegendPen(QPen(getColor(), getLineWidth(), ps ));
+ aCurve->setLegendSymbol( new QwtSymbol( ms, QBrush( getColor() ),
+ QPen( getColor() ),
+ QSize( getMarkerSize() , getMarkerSize() )));
+
+ double *x, *y, *min, *max;
+ long nb = getData( &x, &y );
+ if(nb > 0 && x && y) {
+ aCurve->setSamples( x, y, nb );
+ delete [] x;
+ delete [] y;
+ QList<int> idx;
+ getDeviationData(min, max, idx);
+ if(idx.size() > 0 && min && max) {
+ aCurve->setDeviationData(min,max,idx);
+ delete min;
+ delete max;
+ } else {
+ aCurve->clearDeviationData();