MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / getRegion

Method getRegion

qcustomplot/qcustomplot.cpp:22477–22504  ·  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

22475 curve optimization algorithm, region 5 is considered to be the visible portion of the plot.
22476*/
22477int QCPCurve::getRegion(double key, double value, double keyMin, double valueMax, double keyMax, double valueMin) const
22478{
22479 if (key < keyMin) // region 123
22480 {
22481 if (value > valueMax)
22482 return 1;
22483 else if (value < valueMin)
22484 return 3;
22485 else
22486 return 2;
22487 } else if (key > keyMax) // region 789
22488 {
22489 if (value > valueMax)
22490 return 7;
22491 else if (value < valueMin)
22492 return 9;
22493 else
22494 return 8;
22495 } else // region 456
22496 {
22497 if (value > valueMax)
22498 return 4;
22499 else if (value < valueMin)
22500 return 6;
22501 else
22502 return 5;
22503 }
22504}
22505
22506/*! \internal
22507

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected