Initial commit.
This commit is contained in:
commit
59c6161fdb
134 changed files with 4751 additions and 0 deletions
7
src/geometry/CMakeLists.txt
Normal file
7
src/geometry/CMakeLists.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
list(APPEND geometry_LIB_INCLUDES
|
||||
DiscretePoint.cpp
|
||||
Point.cpp)
|
||||
|
||||
# add the library
|
||||
add_library(geometry SHARED ${geometry_LIB_INCLUDES})
|
||||
|
28
src/geometry/DiscretePoint.cpp
Normal file
28
src/geometry/DiscretePoint.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include "DiscretePoint.h"
|
||||
|
||||
|
||||
DiscretePoint::DiscretePoint(unsigned x, unsigned y)
|
||||
: mX(x),
|
||||
mY(y)
|
||||
{
|
||||
}
|
||||
|
||||
DiscretePoint::~DiscretePoint()
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
std::shared_ptr<DiscretePoint> DiscretePoint::Create(unsigned x, unsigned y)
|
||||
{
|
||||
return std::make_shared<DiscretePoint>(x, y);
|
||||
}
|
||||
|
||||
unsigned DiscretePoint::GetX() const
|
||||
{
|
||||
return mX;
|
||||
}
|
||||
|
||||
unsigned DiscretePoint::GetY() const
|
||||
{
|
||||
return mY;
|
||||
}
|
25
src/geometry/DiscretePoint.h
Normal file
25
src/geometry/DiscretePoint.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
class DiscretePoint
|
||||
{
|
||||
unsigned mX;
|
||||
unsigned mY;
|
||||
|
||||
public:
|
||||
|
||||
DiscretePoint(unsigned x, unsigned y);
|
||||
|
||||
~DiscretePoint();
|
||||
|
||||
std::shared_ptr<DiscretePoint> Create(unsigned x, unsigned y);
|
||||
|
||||
unsigned GetX() const;
|
||||
|
||||
unsigned GetY() const;
|
||||
};
|
||||
|
||||
using Pixel = DiscretePoint;
|
||||
using DiscretePointPtr = std::shared_ptr<DiscretePoint>;
|
||||
using PixelPtr = DiscretePointPtr;
|
18
src/geometry/Point.cpp
Normal file
18
src/geometry/Point.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "Point.h"
|
||||
|
||||
|
||||
Point::Point(double x, double y)
|
||||
: mX(x),
|
||||
mY(y)
|
||||
{
|
||||
}
|
||||
|
||||
Point::~Point()
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
std::shared_ptr<Point> Point::Create(double x, double y)
|
||||
{
|
||||
return std::make_shared<Point>(x, y);
|
||||
}
|
19
src/geometry/Point.h
Normal file
19
src/geometry/Point.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
class Point
|
||||
{
|
||||
double mX;
|
||||
double mY;
|
||||
|
||||
public:
|
||||
|
||||
Point(double x, double y);
|
||||
|
||||
~Point();
|
||||
|
||||
std::shared_ptr<Point> Create(double x, double y);
|
||||
};
|
||||
|
||||
using PointPtr = std::shared_ptr<Point>;
|
0
src/geometry/Rectangle.cpp
Normal file
0
src/geometry/Rectangle.cpp
Normal file
7
src/geometry/Rectangle.h
Normal file
7
src/geometry/Rectangle.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
class Rectangle
|
||||
{
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue