added fixed interval smoothing
This commit is contained in:
@@ -47,8 +47,9 @@ public:
|
||||
}
|
||||
|
||||
/** align the given value onto the grid */
|
||||
static int align(const int val) {
|
||||
return val / MiscSettings::gridSize_cm * MiscSettings::gridSize_cm;
|
||||
template <typename T> static int align(Grid<T>& grid, const int val) {
|
||||
volatile const float gridSize_cm = grid.getGridSize_cm();
|
||||
return std::round(val / gridSize_cm) * gridSize_cm;
|
||||
}
|
||||
|
||||
/** all floors within the building */
|
||||
@@ -58,23 +59,20 @@ public:
|
||||
|
||||
Stairs s01, s12, s23;
|
||||
|
||||
const LengthF h0 = LengthF::cm(align(getHeight(0)));
|
||||
const LengthF h1 = LengthF::cm(align(getHeight(1)));
|
||||
const LengthF h2 = LengthF::cm(align(getHeight(2)));
|
||||
const LengthF h3 = LengthF::cm(align(getHeight(3)));
|
||||
LengthF h0, h1, h2, h3;
|
||||
|
||||
// all ground-truth points
|
||||
std::unordered_map<int, Point3> gtwp;
|
||||
|
||||
FHWSFloors() {;}
|
||||
FHWSFloors(LengthF h0, LengthF h1, LengthF h2, LengthF h3) : h0(h0), h1(h1), h2(h2), h3(h3) {;}
|
||||
|
||||
};
|
||||
|
||||
/** load the entire floorplan */
|
||||
static FHWSFloors getFloors() {
|
||||
template <typename T> static FHWSFloors getFloors(Grid<T>& grid) {
|
||||
|
||||
FloorplanFactorySVG fpFac(MiscSettings::floorplan, 2.822222);
|
||||
FHWSFloors f;
|
||||
FHWSFloors f(LengthF::cm(align(grid, getHeight(0))), LengthF::cm(align(grid, getHeight(1))), LengthF::cm(align(grid, getHeight(2))), LengthF::cm(align(grid, getHeight(3))));
|
||||
|
||||
f.f0 = fpFac.getFloor("floor_0");
|
||||
f.f1 = fpFac.getFloor("floor_1");
|
||||
|
||||
Reference in New Issue
Block a user