#pragma once

#include "DiscretePoint.h"

#include <memory>
#include <cmath>

class Point
{
public:

    Point(double x = 0, double y = 0, double z = 0);

    Point(const DiscretePoint& point);

    Point(const Point& reference, double offSetX, double offSetY, double offSetZ = 0);

    ~Point();

    static std::shared_ptr<Point> Create(double x, double y, double z = 0);

    double getX() const;

    double getY() const;

    double getZ() const;

    double getDistance(const Point& point) const;

    double getDistance(Point* point) const;

    double getDeltaX(const Point& point) const;

    double getDeltaY(const Point& point) const;

    void scale(double x, double y, double z = 1.0)
    {
        mX = x*mX;
        mY = y*mY;
        mZ = z*mZ;
    }

    void translate(double x, double y, double z = 0.0)
    {
        mX += x;
        mY += y;
        mZ += z;
    }

    bool operator==(const Point& rhs) const
    {
       return (mX == rhs.mX)
       && (mY == rhs.mY)
       && (mZ == rhs.mZ);
    }
    bool operator!=(const Point& rhs) const
    {
      return !operator==(rhs);
    }

private:
    double mX{0};
    double mY{0};
    double mZ{0};
};

using PointPtr = std::shared_ptr<Point>;
