stuff-from-scratch/src/geometry/LineSegment.h

28 lines
436 B
C
Raw Normal View History

2022-08-03 20:05:01 +00:00
#pragma once
#include "AbstractGeometricItem.h"
#include "Point.h"
class LineSegment : public AbstractGeometricItem
{
public:
LineSegment(PointPtr p0, PointPtr p1);
static std::shared_ptr<LineSegment> Create(PointPtr p0, PointPtr p1);
double getLength() const;
Point* getPoint0() const;
Point* getPoint1() const;
void Sample(Grid* grid) const
{
}
private:
PointPtr mP0;
PointPtr mP1;
};