#pragma once

struct Bounds
{
    Bounds(double minX = 0.0, double maxX = 0.0, double minY = 0.0, double maxY = 0.0, double minZ = 0.0, double maxZ = 0.0)
        : mMinX(minX),
        mMaxX(maxX),
        mMinY(minY),
        mMaxY(maxY),
        mMinZ(minZ),
        mMaxZ(maxZ)
    {

    }
    double mMinX{ 0.0 };
    double mMaxX{ 0.0 };
    double mMinY{ 0.0 };
    double mMaxY{ 0.0 };
    double mMinZ{ 0.0 };
    double mMaxZ{ 0.0 };

    void intialize(double x, double y, double z = 0.0)
    {
        mMinX = x;
        mMaxX = x;

        mMinY = y;
        mMaxY = y;

        mMinZ = z;
        mMaxZ = z;
    }

    void includePoint(double x, double y, double z)
    {
        if (x < mMinX)
        {
            mMinX = x;
        }
        else if (x > mMaxX)
        {
            mMaxX = x;
        }

        if (y < mMinY)
        {
            mMinY = y;
        }
        else if (y > mMaxY)
        {
            mMaxY = y;
        }

        if (z < mMinZ)
        {
            mMinZ = z;
        }
        else if (z > mMaxZ)
        {
            mMaxZ = z;
        }
    }

    bool operator==(const Bounds& rhs) const
    {
        return (mMinX == rhs.mMinX)
            && (mMaxX == rhs.mMaxX)

            && (mMinY == rhs.mMinY)
            && (mMaxY == rhs.mMaxY)

            && (mMinZ == rhs.mMinZ)
            && (mMaxZ == rhs.mMaxZ);
    }

    bool operator!=(const Bounds& rhs) const
    {
        return !operator==(rhs);
    }
};