#pragma once #include "DiscretePoint.h" #include "Vector.h" #include class Transform; template class Point { public: Point(double x = 0, double y = 0, double z = 0.0); Point(const Vector& v); Point(const Point<2>& p); Point(const Point& p) = default; Point(const DiscretePoint& point); Point(const Point& reference, double offSetX, double offSetY, double offSetZ = 0); ~Point(); void apply(const Transform& transform); double getX() const; double getY() const; double getZ() const; double getDistance(const Point& point) const; double getDeltaX(const Point& point) const; double getDeltaY(const Point& point) const; double getDeltaZ(const Point& point) const; Vector getOriginOffset() const; Vector getDelta(const Point& point) const; bool isAtOrigin() const; bool isEqual(const Point& rhs) const; void moveBy(const Vector& vector); void scale(double x, double y = 0.0, double z = 0.0); void moveBy(double x, double y = 0.0, double z = 0.0); Point operator+(const Vector& vector) { Point p(*this); p += vector; return p; } void operator+=(const Vector& vector) { moveBy(vector); } bool operator==(const Point& rhs) const { return isEqual(rhs); } bool operator!=(const Point& rhs) const { return !operator==(rhs); } private: std::vector mCoords; }; using Point3 = Point<3>; using Point2 = Point<2>; using PointPtr3 = std::unique_ptr >; using PointPtr2 = std::unique_ptr >;