Add geometry handling.
This commit is contained in:
parent
9c116b1efd
commit
c1389218f2
37 changed files with 294 additions and 278 deletions
|
@ -1,7 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include "AbstractGeometricItem.h"
|
||||
#include "Point.h"
|
||||
|
||||
class Rectangle
|
||||
class Rectangle : public AbstractGeometricItem
|
||||
{
|
||||
public:
|
||||
|
||||
Rectangle(const Point& bottomLeft, const Point& topRight)
|
||||
: mBottomLeft(bottomLeft),
|
||||
mTopRight(topRight)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Rectangle GetBounds() const override
|
||||
{
|
||||
return Rectangle(mBottomLeft, mTopRight);
|
||||
}
|
||||
|
||||
void Sample(Grid* grid) const override
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
double GetHeight() const
|
||||
{
|
||||
return mBottomLeft.GetDeltaY(mTopRight);
|
||||
}
|
||||
|
||||
double GetWidth() const
|
||||
{
|
||||
return mBottomLeft.GetDeltaX(mTopRight);
|
||||
}
|
||||
|
||||
private:
|
||||
Point mBottomLeft;
|
||||
Point mTopRight;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue