#pragma once

#include "AbstractGeometricItem.h"
#include "Point.h"

template<class T>
class Grid;

class LineSegment : public AbstractGeometricItem
{
public:
    LineSegment(const Point& p0, const Point& p1);

    static std::unique_ptr<LineSegment> Create(const Point& p0, const Point& p1);

    double getLength() const;

    const Point& getPoint0() const;

    const Point& getPoint1() const;

    void sample(Grid<unsigned char>* grid) const override;

    Bounds getSize() const override;

    const Point& getLocation() const override;

private:
    Point mP0;
    Point mP1;
};
