Initial plotting support.
This commit is contained in:
parent
df450a7be0
commit
c2027801be
34 changed files with 756 additions and 20 deletions
|
@ -20,6 +20,7 @@ public:
|
|||
POINT,
|
||||
PATH,
|
||||
CIRCLE,
|
||||
POLYGON,
|
||||
UNKNOWN
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ list(APPEND HEADERS
|
|||
points/PointCollection.h
|
||||
points/DiscretePoint.h
|
||||
primitives/Circle.h
|
||||
primitives/Quad.h
|
||||
primitives/Polygon.h
|
||||
primitives/Rectangle.h
|
||||
primitives/Triangle.h
|
||||
)
|
||||
|
@ -49,7 +49,7 @@ list(APPEND SOURCES
|
|||
points/PointCollection.cpp
|
||||
points/DiscretePoint.cpp
|
||||
primitives/Circle.cpp
|
||||
primitives/Quad.cpp
|
||||
primitives/Polygon.cpp
|
||||
primitives/Rectangle.cpp
|
||||
primitives/Triangle.cpp
|
||||
)
|
||||
|
|
|
@ -1,6 +1,36 @@
|
|||
#pragma once
|
||||
|
||||
#include "Point.h"
|
||||
#include "Vector.h"
|
||||
|
||||
class Rotation
|
||||
{
|
||||
public:
|
||||
enum class Axis
|
||||
{
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
USER
|
||||
};
|
||||
|
||||
|
||||
Rotation(double angle = 0.0, Axis axis = Axis::Z, const Point& loc = {}, const Vector& customAxis = {})
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
double mAngle{ 0 };
|
||||
Axis mAxis{ Axis::Z };
|
||||
Point mPoint;
|
||||
Vector mCustomAxis;
|
||||
};
|
||||
|
||||
struct Scale
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class Transform
|
||||
{
|
||||
|
|
38
src/base/geometry/primitives/Polygon.cpp
Normal file
38
src/base/geometry/primitives/Polygon.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include "Polygon.h"
|
||||
|
||||
namespace ntk {
|
||||
Polygon::Polygon(const std::vector<Point>& points)
|
||||
: AbstractGeometricItem()
|
||||
{
|
||||
if (points.size() > 0)
|
||||
{
|
||||
mStartPoint = points[0];
|
||||
}
|
||||
mPoints = PointCollection(points);
|
||||
}
|
||||
|
||||
const PointCollection& Polygon::getPoints() const
|
||||
{
|
||||
return mPoints;
|
||||
}
|
||||
|
||||
Bounds Polygon::getBounds() const
|
||||
{
|
||||
return mPoints.getBounds();
|
||||
}
|
||||
|
||||
const Point& Polygon::getLocation() const
|
||||
{
|
||||
return mStartPoint;
|
||||
}
|
||||
|
||||
void Polygon::sample(SparseGrid<bool>*) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Polygon::Type Polygon::getType() const
|
||||
{
|
||||
return Polygon::Type::POLYGON;
|
||||
}
|
||||
}
|
27
src/base/geometry/primitives/Polygon.h
Normal file
27
src/base/geometry/primitives/Polygon.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include "AbstractGeometricItem.h"
|
||||
|
||||
#include "PointCollection.h"
|
||||
|
||||
namespace ntk{
|
||||
class Polygon : public AbstractGeometricItem
|
||||
{
|
||||
public:
|
||||
Polygon(const std::vector<Point>& points);
|
||||
|
||||
const PointCollection& getPoints() const;
|
||||
|
||||
Bounds getBounds() const override;
|
||||
|
||||
const Point& getLocation() const override;
|
||||
|
||||
void sample(SparseGrid<bool>*) const override;
|
||||
|
||||
Type getType() const override;
|
||||
|
||||
private:
|
||||
Point mStartPoint;
|
||||
PointCollection mPoints;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue