Source
205
205
else {
206
206
success = false;
207
207
}
208
208
return success;
209
209
}
210
210
211
211
void Histogram::defineLine( int index, QVector<double>& xVals,
212
212
QVector<double>& yVals, bool useLogY ) const{
213
213
assert( xVals.size() == 2 );
214
214
assert( yVals.size() == 2 );
215
-
//int dataCount = xValues.size();
216
-
assert( index >= 0 && index < dataCount);
215
+
assert( index >= 0 && index < xVals.size());
217
216
xVals[0] = xValues[index];
218
217
xVals[1] = xValues[index];
219
218
yVals[0] = computeYValue( 0, useLogY );
220
219
yVals[1] = computeYValue( yValues[index], useLogY );
221
220
}
222
221
223
222
void Histogram::defineStepHorizontal( int index, QVector<double>& xVals,
224
223
QVector<double>& yVals, bool useLogY ) const{
225
224
assert( xVals.size() == 2 );
226
225
assert( yVals.size() == 2 );
239
238
xVals[1] = xValues[index];
240
239
}
241
240
yVals[0] = computeYValue(yValues[index], useLogY);
242
241
yVals[1] = yVals[0];
243
242
}
244
243
245
244
void Histogram::defineStepVertical( int index, QVector<double>& xVals,
246
245
QVector<double>& yVals, bool useLogY ) const {
247
246
assert( xVals.size() == 2 );
248
247
assert( yVals.size() == 2 );
249
-
//int count = xValues.size();
250
-
assert( index >= 0 && index < count );
248
+
assert( index >= 0 && index < (int)xValues.size());
251
249
if ( index > 0 ){
252
250
xVals[0] = (xValues[index] + xValues[index-1])/2;
253
251
}
254
252
else {
255
253
xVals[0] = xValues[0];
256
254
}
257
255
xVals[1] = xVals[0];
258
256
259
257
if ( index > 0 ){
260
258
yVals[0] = computeYValue(yValues[index-1], useLogY );