/******************************* * Private functions *******************************/ void PlotSectorHistogram::updateDatas( const SectorHistogram &histogram ) { const int nbSectors = histogram.size(); QVector<QwtIntervalSample> datasHistogram(0); if ( nbSectors > 0 ) { datasHistogram.fill(QwtIntervalSample(),nbSectors); _datasCurve->resize(2*nbSectors+1); QVector<QwtPointPolar>::Iterator beginCurve = _datasCurve->begin(); QVector<QwtIntervalSample>::Iterator beginHist = datasHistogram.begin(); int i, value; qreal left, right; for ( i=0 ; i<nbSectors ; ++i ) { const PiePart &part = PieChartSingleton::getInstance()->sector(i); value = histogram[i]; left = part.maxAngle(); right = part.minAngle(); (*beginCurve).setAzimuth(right); (*beginCurve++).setRadius(value); (*beginCurve).setAzimuth(left); (*beginCurve++).setRadius(value); (*beginHist).value = value; (*beginHist++).interval.setInterval(right,left); } (*beginCurve).setAzimuth(PieChartSingleton::getInstance()->sector(0).minAngle()); (*beginCurve).setRadius(histogram[0]); } else { _datasCurve->resize(0); } _histogramData.setSamples(datasHistogram); }
void PlotEllipticalAccumulationHistogram::updateDatas( const EllipticalAccumulationHistogram & histogram ) { QVector<QwtIntervalSample> datasHistogram(0); if ( histogram.size() > 0 ) { datasHistogram.reserve(histogram.size()); int i=0; QVector<qreal>::ConstIterator begin = histogram.begin(); const QVector<qreal>::ConstIterator end = histogram.end(); while ( begin != end ) { datasHistogram.append(QwtIntervalSample(*begin++,i,i+1)); ++i; } } _histogramData.setSamples(datasHistogram); }
void PlotKnotPithProfile::update( const KnotPithProfile & histogram ) { QVector<QwtIntervalSample> datasHistogram(0); if ( histogram.size() > 0 ) { datasHistogram.reserve(histogram.size()); int i=0; QVector<qreal>::ConstIterator begin = histogram.begin(); const QVector<qreal>::ConstIterator end = histogram.end(); while ( begin != end ) { datasHistogram.append(QwtIntervalSample(qAcos(*begin++)*RAD_TO_DEG_FACT,i,i+1)); ++i; } } _histogramData.setSamples(datasHistogram); }
void PlotIntensityDistributionHistogram::updateDatas( const IntensityDistributionHistogram &histogram, const Interval<int> &intensityInterval ) { QVector<QwtIntervalSample> datasHistogram(0); if ( histogram.size() > 0 ) { datasHistogram.reserve(histogram.size()); int i=intensityInterval.min(); QVector<qreal>::ConstIterator begin = histogram.begin(); const QVector<qreal>::ConstIterator end = histogram.end(); while ( begin != end ) { datasHistogram.append(QwtIntervalSample(*begin++,i,i+1)); ++i; } } _histogramData.setSamples(datasHistogram); }