MCPcopy Create free account
hub / github.com/cutechess/cutechess / getRegion

Method getRegion

projects/gui/3rdparty/qcustomplot/qcustomplot.cpp:23269–23296  ·  view source on GitHub ↗

! \internal This function is part of the curve optimization algorithm of \ref getCurveLines. It returns the region of the given point (\a key, \a value) with respect to a rectangle defined by \a keyMin, \a keyMax, \a valueMin, and \a valueMax. The regions are enumerated from top to bottom (\a valueMin to \a valueMax) and left to right (\a keyMin to \a keyMax): <table style="width:1

Source from the content-addressed store, hash-verified

23267 curve optimization algorithm, region 5 is considered to be the visible portion of the plot.
23268*/
23269int QCPCurve::getRegion(double key, double value, double keyMin, double valueMax, double keyMax, double valueMin) const
23270{
23271 if (key < keyMin) // region 123
23272 {
23273 if (value > valueMax)
23274 return 1;
23275 else if (value < valueMin)
23276 return 3;
23277 else
23278 return 2;
23279 } else if (key > keyMax) // region 789
23280 {
23281 if (value > valueMax)
23282 return 7;
23283 else if (value < valueMin)
23284 return 9;
23285 else
23286 return 8;
23287 } else // region 456
23288 {
23289 if (value > valueMax)
23290 return 4;
23291 else if (value < valueMin)
23292 return 6;
23293 else
23294 return 5;
23295 }
23296}
23297
23298/*! \internal
23299

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected