Clean project structure.
This commit is contained in:
parent
78a4fa99ff
commit
947bf937fd
496 changed files with 206 additions and 137 deletions
53
src/base/geometry/primitives/Rectangle.cpp
Normal file
53
src/base/geometry/primitives/Rectangle.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
#include "Rectangle.h"
|
||||
|
||||
namespace ntk {
|
||||
Rectangle::Rectangle(const Point& bottomLeft, const Point& topRight)
|
||||
: mBottomLeft(bottomLeft)
|
||||
{
|
||||
mHeight = mBottomLeft.getDeltaY(topRight);
|
||||
mWidth = mBottomLeft.getDeltaX(topRight);
|
||||
}
|
||||
|
||||
Rectangle::Rectangle(const Point& bottomLeft, double width, double height)
|
||||
: mBottomLeft(bottomLeft),
|
||||
mHeight(height),
|
||||
mWidth(width)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Rectangle::Type Rectangle::getType() const
|
||||
{
|
||||
return AbstractGeometricItem::Type::RECTANGLE;
|
||||
}
|
||||
|
||||
Bounds Rectangle::getBounds() const
|
||||
{
|
||||
const auto minX = mBottomLeft.getX();
|
||||
const auto maxX = mBottomLeft.getX() + mWidth;
|
||||
|
||||
const auto minY = mBottomLeft.getY();
|
||||
const auto maxY = mBottomLeft.getY() + mHeight;
|
||||
return { minX , maxX , minY , maxY };
|
||||
}
|
||||
|
||||
void Rectangle::sample(SparseGrid<bool>* grid) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
double Rectangle::getHeight() const
|
||||
{
|
||||
return mHeight;
|
||||
}
|
||||
|
||||
double Rectangle::getWidth() const
|
||||
{
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
const Point& Rectangle::getLocation() const
|
||||
{
|
||||
return mBottomLeft;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue