Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_plot_spectrocurve.cpp
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_spectrocurve.cpp
r4271 r8127 42 42 */ 43 43 QwtPlotSpectroCurve::QwtPlotSpectroCurve( const QwtText &title ): 44 QwtPlotSeriesItem <QwtPoint3D>( title )44 QwtPlotSeriesItem( title ) 45 45 { 46 46 init(); … … 52 52 */ 53 53 QwtPlotSpectroCurve::QwtPlotSpectroCurve( const QString &title ): 54 QwtPlotSeriesItem <QwtPoint3D>( QwtText( title ) )54 QwtPlotSeriesItem( QwtText( title ) ) 55 55 { 56 56 init(); … … 72 72 73 73 d_data = new PrivateData; 74 d_series = new QwtPoint3DSeriesData();74 setData( new QwtPoint3DSeriesData() ); 75 75 76 76 setZ( 20.0 ); … … 99 99 100 100 /*! 101 \ brief Return the current paint attributes101 \return True, when attribute is enabled 102 102 \sa PaintAttribute, setPaintAttribute() 103 103 */ … … 113 113 void QwtPlotSpectroCurve::setSamples( const QVector<QwtPoint3D> &samples ) 114 114 { 115 delete d_series; 116 d_series = new QwtPoint3DSeriesData( samples ); 117 itemChanged(); 118 } 115 setData( new QwtPoint3DSeriesData( samples ) ); 116 } 117 118 /*! 119 Assign a series of samples 120 121 setSamples() is just a wrapper for setData() without any additional 122 value - beside that it is easier to find for the developer. 123 124 \param data Data 125 \warning The item takes ownership of the data object, deleting 126 it when its not used anymore. 127 */ 128 void QwtPlotSpectroCurve::setSamples( 129 QwtSeriesData<QwtPoint3D> *data ) 130 { 131 setData( data ); 132 } 119 133 120 134 /*! … … 137 151 } 138 152 153 legendChanged(); 139 154 itemChanged(); 140 155 } … … 162 177 { 163 178 d_data->colorRange = interval; 179 180 legendChanged(); 164 181 itemChanged(); 165 182 } … … 189 206 { 190 207 d_data->penWidth = penWidth; 208 209 legendChanged(); 191 210 itemChanged(); 192 211 } … … 208 227 \param xMap Maps x-values into pixel coordinates. 209 228 \param yMap Maps y-values into pixel coordinates. 210 \param canvasRect Contents rect of the canvas229 \param canvasRect Contents rectangle of the canvas 211 230 \param from Index of the first sample to be painted 212 231 \param to Index of the last sample to be painted. If to < 0 the … … 228 247 from = 0; 229 248 230 if ( from > =to )249 if ( from > to ) 231 250 return; 232 251 … … 240 259 \param xMap Maps x-values into pixel coordinates. 241 260 \param yMap Maps y-values into pixel coordinates. 242 \param canvasRect Contents rect of the canvas261 \param canvasRect Contents rectangle of the canvas 243 262 \param from Index of the first sample to be painted 244 263 \param to Index of the last sample to be painted. If to < 0 the … … 260 279 d_data->colorTable = d_data->colorMap->colorTable( d_data->colorRange ); 261 280 281 const QwtSeriesData<QwtPoint3D> *series = data(); 282 262 283 for ( int i = from; i <= to; i++ ) 263 284 { 264 const QwtPoint3D sample = d_series->sample( i );285 const QwtPoint3D sample = series->sample( i ); 265 286 266 287 double xi = xMap.transform( sample.x() ); … … 283 304 d_data->colorRange, sample.z() ); 284 305 285 painter->setPen( QPen( QColor ( rgb ), d_data->penWidth ) );306 painter->setPen( QPen( QColor::fromRgba( rgb ), d_data->penWidth ) ); 286 307 } 287 308 else … … 290 311 d_data->colorRange, sample.z() ); 291 312 292 painter->setPen( QPen( QColor ( d_data->colorTable[index] ),313 painter->setPen( QPen( QColor::fromRgba( d_data->colorTable[index] ), 293 314 d_data->penWidth ) ); 294 315 }
Note:
See TracChangeset
for help on using the changeset viewer.