OpenMS
2.7.0
|
Given a set of levels (rows), try to add items at to topmost row which does not overlap an already placed item in this row (according to its x-coordinate) More...
#include <OpenMS/VISUAL/MISC/GUIHelpers.h>
Public Member Functions | |
OverlapDetector (int levels) | |
C'tor: number of levels must be >=1. More... | |
size_t | placeItem (double x_start, double x_end) |
Private Attributes | |
std::vector< double > | rows_ |
Given a set of levels (rows), try to add items at to topmost row which does not overlap an already placed item in this row (according to its x-coordinate)
If a collision occurs, try the row below. If no row is collision-free, pick the one with the smallest overlap.
X coordinates should always be positive.
|
explicit |
C'tor: number of levels
must be >=1.
size_t placeItem | ( | double | x_start, |
double | x_end | ||
) |
try to put an item which spans from x_start
to x_end
in the topmost row possible
|
private |