stuff-from-scratch/src/base/geometry/primitives/Rectangle.cpp
2023-01-30 14:53:49 +00:00

45 lines
822 B
C++

#include "Rectangle.h"
namespace ntk {
Rectangle::Rectangle(double width, double height)
: mWidth(width),
mHeight(height)
{
}
Rectangle::Type Rectangle::getType() const
{
return AbstractGeometricItem::Type::RECTANGLE;
}
Bounds Rectangle::getBounds() const
{
const auto minX = 0.0;
const auto maxX = mWidth;
const auto minY = 0.0;
const auto maxY = mHeight;
return { minX , maxX , minY , maxY };
}
double Rectangle::getHeight() const
{
return mHeight;
}
double Rectangle::getWidth() const
{
return mWidth;
}
double Rectangle::getRadius() const
{
return mRadius;
}
void Rectangle::setRadius(double radius)
{
mRadius = radius;
}
}