! Returns the data range which is contained in both this data range and \a other. This method is very similar to \ref bounded, with one distinction: If this range and the \a other range share no intersection, the returned data range will be empty with begin and end set to 0. (\ref bounded would return a range with begin and end set to one of the boundaries of \a other, depending on wh
| 2312 | \see QCPDataSelection::intersection |
| 2313 | */ |
| 2314 | QCPDataRange QCPDataRange::intersection(const QCPDataRange &other) const |
| 2315 | { |
| 2316 | QCPDataRange result(qMax(mBegin, other.mBegin), qMin(mEnd, other.mEnd)); |
| 2317 | if (result.isValid()) |
| 2318 | return result; |
| 2319 | else |
| 2320 | return {}; |
| 2321 | } |
| 2322 | |
| 2323 | /*! |
| 2324 | Returns whether this data range and \a other share common data points. |
nothing calls this directly
no test coverage detected