Plot2d_Curve::Plot2d_Curve()
: myHorTitle( "" ), myVerTitle( "" ),
myHorUnits( "" ), myVerUnits( "" ),
+ myName( "" ),
myAutoAssign( true ),
myColor( 0,0,0 ),
myMarker( Plot2d::Circle ),
myVerTitle = curve.getVerTitle();
myHorUnits = curve.getHorUnits();
myVerUnits = curve.getVerUnits();
+ myName = curve.getName();
myColor = curve.getColor();
myMarker = curve.getMarker();
myLine = curve.getLine();
myVerTitle = curve.getVerTitle();
myHorUnits = curve.getHorUnits();
myVerUnits = curve.getVerUnits();
+ myName = curve.getName();
myColor = curve.getColor();
myMarker = curve.getMarker();
myLine = curve.getLine();
return myVerUnits;
}
+/*!
+ Sets curve's name
+ */
+void Plot2d_Curve::setName( const QString& theName )
+{
+ myName = theName;
+}
+/*!
+ Gets curve's name
+ */
+QString Plot2d_Curve::getName() const
+{
+ return myName;
+}
+
/*!
Adds one point for curve.
*/
void setVerUnits( const QString& );
QString getVerUnits() const;
+ void setName( const QString& );
+ QString getName() const;
+
void addPoint( double, double, const QString& = QString() );
void insertPoint( int, double, double, const QString& = QString() );
void deletePoint( int );
QString myVerTitle;
QString myHorUnits;
QString myVerUnits;
+ QString myName;
QColor myColor;
Plot2d::MarkerType myMarker;
Plot2d::LineType myLine;
updateCurve( curve, update );
}
else {
- QwtPlotCurve* aPCurve = new QwtPlotCurve( curve->getVerTitle() );
+ QwtPlotCurve* aPCurve = new QwtPlotCurve( !curve->getName().isEmpty() ?
+ curve->getName() : curve->getVerTitle() );
aPCurve->attach( myPlot );
//myPlot->setCurveYAxis(curveKey, curve->getYAxis());
QSize( myMarkerSize, myMarkerSize ) ) );
aPCurve->setData( curve->horData(), curve->verData(), curve->nbPoints() );
}
- aPCurve->setTitle( curve->getVerTitle() );
+ aPCurve->setTitle( !curve->getName().isEmpty() ? curve->getName() :
+ curve->getVerTitle() );
aPCurve->setVisible( true );
if ( update )
myPlot->replot();
for (; it != aCurves.end(); ++it ) {
aCurve = *it;
if ( hasPlotCurve( aCurve ) )
- getPlotCurve( aCurve )->setTitle( aCurve->getVerTitle() );
+ getPlotCurve( aCurve )->setTitle( !aCurve->getName().isEmpty() ?
+ aCurve->getName() : aCurve->getVerTitle() );
}
}