#ifndef CELLSHAPESTRUCT_H
#define CELLSHAPESTRUCT_H

#include <array>
#include <vector>
#include <random>

struct CellBase
{
    CellBase(double _xspan = 3.0, double _yspan = 3.0, double _zspan = 3.5);

    virtual void setCoordinate(double x, double y, double z) = 0;

    void setSpan(double _xspan, double _yspan, double _zspan);

    std::vector<std::array<double, 3>> p;
protected:
    double xspan;
    double yspan;
    double zspan;
};

struct CellVertex : public CellBase
{
    CellVertex(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

	virtual void setCoordinate(double x, double y, double z) override;
};

struct CellPolyVertex : public CellBase
{
    CellPolyVertex(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0, int _pointNum = -1);

	virtual void setCoordinate(double x, double y, double z) override;

    int pointNum = 0;
};

struct CellLine : public CellBase
{
    CellLine(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

	virtual void setCoordinate(double x, double y, double z) override;
};

struct CellPolyLine : public CellBase
{
    CellPolyLine(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0, int _pointNum = -1);

	virtual void setCoordinate(double x, double y, double z) override;
    int pointNum = 0;
};

struct CellTriangle : public CellBase
{
    CellTriangle(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

    virtual void setCoordinate(double x, double y, double z) override;

};

struct CellQuad : public CellBase
{
    CellQuad(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

    virtual void setCoordinate(double x, double y, double z) override;
};

struct CellTetra : public CellBase
{
    CellTetra(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

    virtual void setCoordinate(double x, double y, double z) override;
};

struct CellHexahedron : public CellBase
{
    CellHexahedron(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0)
        : CellBase(_xspan, _yspan, _zspan)
    {
        p.resize(8);
    }

    virtual void setCoordinate(double x, double y, double z) override
    {
        p[0] = {x - xspan / 2.0, y - yspan / 2.0 , z - zspan / 2.0 };
        p[1] = {x + xspan / 2.0, y - yspan / 2.0, z - zspan / 2.0};
        p[2] = {x + xspan / 2.0, y + yspan / 2.0, z - zspan / 2.0};
        p[3] = {x - xspan / 2.0, y + yspan / 2.0, z - zspan / 2.0};

        p[4] = {x - xspan / 2.0, y - yspan / 2.0, z + zspan / 2.0};
        p[5] = {x + xspan / 2.0, y - yspan / 2.0, z + zspan / 2.0};
        p[6] = {x + xspan / 2.0, y + yspan / 2.0, z + zspan / 2.0};
        p[7] = {x - xspan / 2.0, y + yspan / 2.0, z + zspan / 2.0};
    }
};

struct CellWedge : public CellBase
{
    CellWedge(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

    virtual void setCoordinate(double x, double y, double z) override;

};

struct CellPyramid : public CellBase
{
    CellPyramid(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

    virtual void setCoordinate(double x, double y, double z) override;

};


struct CellPentagonalPrism : public CellBase
{
    CellPentagonalPrism(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

    virtual void setCoordinate(double x, double y, double z) override;

};


struct CellHexagonalPrism : public CellBase
{
    CellHexagonalPrism(double _xspan = 3.0, double _yspan = 4.0, double _zspan = 5.0);

    virtual void setCoordinate(double x, double y, double z) override;

};


#endif // CELLSHAPESTRUCT_H
