added main menu added debug display many debug widgets for plotting live data worked on android live sensors added offline-data sensor feeding some dummy data sensors worked on the map display added ui debug for grid-points, particles and weights added a cool dude to display the estimation added real filtering based on the Indoor components c++11 fixes for android compilation online and offline filtering support new resampling technique for testing map loading via dialog
49 lines
810 B
C
49 lines
810 B
C
#ifndef PLOT_RANGE_H
|
|
#define PLOT_RANGE_H
|
|
|
|
struct Range {
|
|
|
|
float min;
|
|
float max;
|
|
|
|
Range() : min(0), max(0) {;}
|
|
|
|
Range(const float min, const float max) : min(min), max(max) {
|
|
;
|
|
}
|
|
|
|
float getSize() const {
|
|
return max-min;
|
|
}
|
|
|
|
float getCenter() const {
|
|
return (max+min)/2;
|
|
}
|
|
|
|
bool isValid() const {
|
|
return getSize() > 0;
|
|
}
|
|
|
|
/** resize the region. 1.0 = keep-as-is */
|
|
void scale(const float val) {
|
|
const float center = getCenter();
|
|
const float size = getSize();
|
|
min = center - size / 2 * val;
|
|
max = center + size / 2 * val;
|
|
}
|
|
|
|
/** adjust (grow) the range */
|
|
void adjust(const float val) {
|
|
if (val < min) {min = val;}
|
|
if (val > max) {max = val;}
|
|
}
|
|
|
|
void adjust(const Range& o) {
|
|
if (o.min < min) {min = o.min;}
|
|
if (o.max > max) {max = o.max;}
|
|
}
|
|
|
|
};
|
|
|
|
#endif // PLOT_RANGE_H
|