worked on 3D walls

This commit is contained in:
k-a-z-u
2018-07-24 18:08:08 +02:00
parent 3d79fd5af0
commit f7e4323d58
11 changed files with 261 additions and 49 deletions

View File

@@ -192,6 +192,7 @@ namespace Floorplan {
struct Stair;
struct Elevator;
struct GroundTruthPoint;
struct FloorObstacleWallDoor;
struct FloorOutline : public std::vector<FloorOutlinePolygon*> {
bool enabled = true;
@@ -350,6 +351,7 @@ namespace Floorplan {
Point2 to;
float thickness_m;
float height_m = 0; // 0 = floor's height
std::vector<FloorObstacleWallDoor*> doors;
FloorObstacleLine(const ObstacleType type, const Material material, const Point2 from, const Point2 to, const float thickness_m = 0.2f, const float height_m = 0) : FloorObstacle(material), type(type), from(from), to(to), thickness_m(thickness_m), height_m(height_m) {;}
FloorObstacleLine(const ObstacleType type, const Material material, const float x1, const float y1, const float x2, const float y2, const float thickness_m = 0.2f, const float height_m = 0) : FloorObstacle(material), type(type), from(x1,y1), to(x2,y2), thickness_m(thickness_m), height_m(height_m) {;}
};
@@ -376,6 +378,25 @@ namespace Floorplan {
float getSize() const {return (to-from).length();}
};
/** door obstacle */
struct FloorObstacleWallDoor : public FloorObstacle {
DoorType type;
float atLinePos;
float width;
float height;
bool leftRight = false;
bool inOut = false;
FloorObstacleWallDoor(const DoorType type, const Material material, const float atLinePos, const float width, const float height) : FloorObstacle(material), type(type), atLinePos(atLinePos), width(width), height(height) {;}
Point2 getStart(const FloorObstacleLine* wall) const {
const Point2 dir = wall->to - wall->from;
return wall->from + dir * atLinePos;
}
Point2 getEnd(const FloorObstacleLine* wall) const {
const Point2 dir = wall->to - wall->from;
return getStart(wall) + dir.normalized() * (leftRight ? -width : +width);
}
};
/** 3D obstacle */
struct FloorObstacleObject : public FloorObstacle {
std::string file;