#ifndef __SBLENDED_FLOORPLAN_H
	#define __SBLENDED_FLOORPLAN_H


	#include "vector2d.h"
    #include "scene.h"
	#include <iostream>
    #include <fstream>
    #include <vector>
	#include <string>
	#include <map>
	#include <sstream>
	#include <math.h>

    namespace FloorPlan
    {

        class Vertex
        {
            public:
                std::string name;
                float x;
                float y;
        };

        class Wall
        {
            public:
                enum Alignment { Left=-1, Centered=0, Right=1 };
                Vertex* Other(Vertex* v);

                Vertex* from;
                Vertex* to;
                float width;
                Alignment alignment;
        };

        class Level
        {
            protected:
                std::vector<Vertex*> Vertices;
                std::vector<Wall*> Walls;

            public:
                Level();
                virtual ~Level();
                Vertex* AddVertex(std::string name, float x, float y);
                Wall* AddWall(Vertex* from, Vertex* to, float width);

                Vector2D GetIntersectionPoint(Wall* wall, Vertex* vertex, Wall* PrevWall);
                Mesh* ToMesh(float VerticalOffset, int id);

                float height;
        };

        class House
        {
            protected:
                std::vector<Level*> Levels;
            public:
                House(std::string filename);
                virtual ~House();
                Level* AddLevel(float height);
                Scene* ToScene();
        };


    }

#endif
