added support for pillars
some new helper methods/classes
This commit is contained in:
@@ -165,6 +165,7 @@ namespace Floorplan {
|
||||
DRYWALL,
|
||||
GLASS,
|
||||
METAL,
|
||||
METALLIZED_GLAS,
|
||||
_END,
|
||||
};
|
||||
|
||||
@@ -356,8 +357,10 @@ namespace Floorplan {
|
||||
struct FloorObstacleCircle : public FloorObstacle {
|
||||
Point2 center;
|
||||
float radius;
|
||||
FloorObstacleCircle(const Material material, const Point2 center, const float radius) : FloorObstacle(material), center(center), radius(radius) {;}
|
||||
FloorObstacleCircle(const Material material, const float cx, const float cy, const float radius) : FloorObstacle(material), center(cx,cy), radius(radius) {;}
|
||||
float height = 0; // 0 = floor's height
|
||||
FloorObstacleCircle(const Material material, const Point2 center, const float radius, const float height=0) : FloorObstacle(material), center(center), radius(radius), height(height) {;}
|
||||
FloorObstacleCircle(const Material material, const float cx, const float cy, const float radius, const float height=0) : FloorObstacle(material), center(cx,cy), radius(radius), height(height) {;}
|
||||
//float getHeight(const Floor* f) const {return (height > 0) ? (height) : (f->height);}
|
||||
};
|
||||
|
||||
/** door obstacle */
|
||||
|
||||
@@ -29,6 +29,18 @@ public:
|
||||
return std::make_pair(nullptr, nullptr);
|
||||
}
|
||||
|
||||
/** get the AP for the given Name [if available] */
|
||||
static std::pair<Floorplan::AccessPoint*, Floorplan::Floor*> getAPByName(const Floorplan::IndoorMap* map, const std::string& name) {
|
||||
for (Floorplan::Floor* f : map->floors) {
|
||||
for (Floorplan::AccessPoint* ap : f->accesspoints) {
|
||||
if (name == ap->name) {
|
||||
return std::make_pair(ap, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::make_pair(nullptr, nullptr);
|
||||
}
|
||||
|
||||
/** get all APs within the map */
|
||||
static std::vector<std::pair<Floorplan::AccessPoint*, Floorplan::Floor*>> getAPs(const Floorplan::IndoorMap* map) {
|
||||
std::vector<std::pair<Floorplan::AccessPoint*, Floorplan::Floor*>> res;
|
||||
@@ -40,6 +52,18 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
/** get the Fingerprint-Loation for the given Name [if available] */
|
||||
static std::pair<Floorplan::FingerprintLocation*, Floorplan::Floor*> getFingerprintLocationByName(const Floorplan::IndoorMap* map, const std::string& name) {
|
||||
for (Floorplan::Floor* f : map->floors) {
|
||||
for (Floorplan::FingerprintLocation* fpl : f->fpLocations) {
|
||||
if (name == fpl->name) {
|
||||
return std::make_pair(fpl, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::make_pair(nullptr, nullptr);
|
||||
}
|
||||
|
||||
/** get all ground-truth points within the map as hash-map: id->pos */
|
||||
static std::unordered_map<int, Point3> getGroundTruthPoints(const Floorplan::IndoorMap* map) {
|
||||
std::unordered_map<int, Point3> res;
|
||||
|
||||
@@ -412,7 +412,8 @@ namespace Floorplan {
|
||||
return new FloorObstacleCircle(
|
||||
parseMaterial(el->Attribute("material")),
|
||||
el->FloatAttribute("cx"), el->FloatAttribute("cy"),
|
||||
el->FloatAttribute("radius")
|
||||
el->FloatAttribute("radius"),
|
||||
el->FloatAttribute("height")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -344,6 +344,7 @@ namespace Floorplan {
|
||||
obstacle->SetAttribute("cx", circle->center.x);
|
||||
obstacle->SetAttribute("cy", circle->center.y);
|
||||
obstacle->SetAttribute("radius", circle->radius);
|
||||
obstacle->SetAttribute("height", circle->height);
|
||||
obstacles->InsertEndChild(obstacle);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user