Switch to template types for vectors

This commit is contained in:
jmsgrogan 2023-01-30 14:53:49 +00:00
parent 9f036d6438
commit 8192ef78e8
105 changed files with 1614 additions and 1424 deletions

View file

@ -1,18 +1,9 @@
#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),
mWidth(width),
mHeight(height)
Rectangle::Rectangle(double width, double height)
: mWidth(width),
mHeight(height)
{
}
@ -24,19 +15,14 @@ namespace ntk {
Bounds Rectangle::getBounds() const
{
const auto minX = mBottomLeft.getX();
const auto maxX = mBottomLeft.getX() + mWidth;
const auto minX = 0.0;
const auto maxX = mWidth;
const auto minY = mBottomLeft.getY();
const auto maxY = mBottomLeft.getY() + mHeight;
const auto minY = 0.0;
const auto maxY = mHeight;
return { minX , maxX , minY , maxY };
}
void Rectangle::sample(SparseGrid<bool>*) const
{
}
double Rectangle::getHeight() const
{
return mHeight;
@ -47,11 +33,6 @@ namespace ntk {
return mWidth;
}
const Point& Rectangle::getLocation() const
{
return mBottomLeft;
}
double Rectangle::getRadius() const
{
return mRadius;