MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / inverse

Method inverse

3rdparty/qcustomplot/qcustomplot.cpp:2739–2757  ·  view source on GitHub ↗

! Returns a data selection which is the exact inverse of this data selection, with \a outerRange defining the base range on which to invert. If \a outerRange is smaller than the \ref span of this data selection, it is expanded accordingly. For example, this method can be used to retrieve all unselected segments by setting \a outerRange to the full data range of the plottable, and callin

Source from the content-addressed store, hash-verified

2737 selected segments.
2738*/
2739QCPDataSelection QCPDataSelection::inverse(const QCPDataRange &outerRange) const
2740{
2741 if (isEmpty())
2742 return QCPDataSelection(outerRange);
2743 QCPDataRange fullRange = outerRange.expanded(span());
2744
2745 QCPDataSelection result;
2746 // first unselected segment:
2747 if (mDataRanges.first().begin() != fullRange.begin())
2748 result.addDataRange(QCPDataRange(fullRange.begin(), mDataRanges.first().begin()), false);
2749 // intermediate unselected segments:
2750 for (int i=1; i<mDataRanges.size(); ++i)
2751 result.addDataRange(QCPDataRange(mDataRanges.at(i-1).end(), mDataRanges.at(i).begin()), false);
2752 // last unselected segment:
2753 if (mDataRanges.last().end() != fullRange.end())
2754 result.addDataRange(QCPDataRange(mDataRanges.last().end(), fullRange.end()), false);
2755 result.simplify();
2756 return result;
2757}
2758/* end of 'src/selection.cpp' */
2759
2760

Callers 2

getDataSegmentsMethod · 0.80
getDataSegmentsMethod · 0.80

Calls 8

isEmptyFunction · 0.85
expandedMethod · 0.80
addDataRangeMethod · 0.80
simplifyMethod · 0.80
beginMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected