本文整理汇总了C++中QCPRange::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ QCPRange::contains方法的具体用法?C++ QCPRange::contains怎么用?C++ QCPRange::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCPRange
的用法示例。
在下文中一共展示了QCPRange::contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plotAnalyze
void plot_analytics::plotAnalyze( QCPGraph *target, plotStats *stats, QCPRange keyRange)
{
QCPGraphDataContainer::const_iterator plotIterator = target->data().data()->findBegin(keyRange.lower,true);
QCPGraphDataContainer::const_iterator targetDataEnd = target->data().data()->findEnd(keyRange.upper,true);
QCPGraphData currentPoint, prevPoint;
//Find the data ranges
currentPoint.key = keyRange.lower;
prevPoint = QCPGraphData(plotIterator->key, plotIterator->value);
while(plotIterator != targetDataEnd && (keyRange.contains(plotIterator->key) || stats->totalData_entrys < 2))
{
currentPoint = QCPGraphData(plotIterator->key, plotIterator->value);
handlePoints(currentPoint, prevPoint, stats);
//Value is weighted to account for datapoints that may not be equally spaced
if(!isInvalidData(currentPoint.value) && !isInvalidData(prevPoint.value))
stats->avgValue += currentPoint.value*(currentPoint.key-prevPoint.key);
prevPoint = QCPGraphData(plotIterator->key, plotIterator->value);
++plotIterator;
}
//Divide by total seconds
stats->avgValue /= stats->totalData_seconds;
}
示例2: clearUnwantedPoints
void plot_analytics::clearUnwantedPoints(QCPGraph *target, QCPGraph *enableReference, QCPRange valueEnableRange)
{
QCPGraphDataContainer::iterator plotIterator = target->data()->begin();
QCPGraphDataContainer::const_iterator refIterator;
//First we scan and any time the reference plot is not in range wipe the plot data.
//TODO: This will break the plot, do we clone the plot? That could be a huge amount of data...
while(plotIterator != target->data()->end())
{
//Find closest reference point
refIterator = enableReference->data().data()->findBegin(plotIterator->key, true);
if (!valueEnableRange.contains(refIterator->value))
plotIterator->value = std::numeric_limits<double>::quiet_NaN();
++plotIterator;
}
}