#pragma once

#include "AlterableObject.hpp"
#include "Label.hpp"
#include "Shader.hpp"

/*
   Class: GridLine

     Implements a grid line object.
     Grid lines are used in bar charts, grouped bar charts and stacked bar charts.

     *Inherits* from <AlterableObject>.
*/
class GridLine: public AlterableObject {
  public:
    /*
       Constructor: GridLine

         Initializes the object.

       Parameters:

         iHeight - The data value that the grid line represents.
         iRow - The index of the grid line.
    */
    GridLine(int iHeight, int iRow);

    /*
       Destructor: ~GridLine

         Releases all allocated resources.
    */
    ~GridLine();


    /*
       Function: Draw

         Draws the grid line. *Inherited* from <AlterableObject>.

       Parameters:

         pPainter - The QPainter object that shall be used for painting.
    */
    void Draw(QPainter* pPainter);

    /*
       Function: DrawLabels

         Draws the label assigned to the grid line. *Inherited* from <AlterableObject>.

       Parameters:

         pPainter - The QPainter object that shall be used for painting.
    */
    void DrawLabels(QPainter* pPainter);

    /*
       Function: ChangePosition

         Changes the position of the grid line. *Inherited* from <AlterableObject>.

       Parameters:

         fDeltaLeft - Unused parameter.
         fDeltaTop - Total vertical distance according to the upper vertices.
         fDeltaBottom - Unused parameter.
    */
    void ChangePosition(float fDeltaLeft, float fDeltaTop, float fDeltaBottom);

    /*
       Function: ChangeAlpha

         Changes the alpha value of the grid line. *Inherited* from <AlterableObject>.

       Parameters:

         fDeltaAlpha - Change of alpha value.
    */
    void ChangeAlpha(float fDeltaAlpha);

    /*
       Function: GetRelativeHeight

         Returns the height of the Y coordinate of the grid line in viewing coordinates.

       Returns:

         The height of the Y coordinate of the grid line in viewing coordinates.
    */
    float GetRelativeHeight();

    /*
       Function: GetValue

         Returns the assigned value of the grid line as float value.

       Returns:

         The assigned value of the grid line as float value.
    */
    float GetValue();

    /*
       Function: GetRed

         Returns the red color value of the grid line.

       Returns:

         The red color value of the grid line.
    */
    float GetRed();

    /*
       Function: GetGreen

         Returns the green color value of the grid line.

       Returns:

         The green color value of the grid line.
    */
    float GetGreen();

    /*
       Function: GetBlue

         Returns the blue color value of the grid line.

       Returns:

         The blue color value of the grid line.
    */
    float GetBlue();

    /*
       Function: GetAlpha

         Returns the alpha color value of the grid line.

       Returns:

         The alpha color value of the grid line.
    */
    float GetAlpha();

    /*
       Function: GetHeight

         Returns the assigned value of the grid line.

       Returns:

         The assigned value of the grid line.
    */
    int GetHeight();

    /*
       Function: GetRow

         Returns the index of the grid line.

       Returns:

         The index of the grid line.
    */
    int GetRow();

  private:
    glm::vec4* vVertices;
    glm::vec4* vColors;
    int* vIndices;
    int iHeight;
    int iRow;
    float fRelativeHeight;
    Label* pLabel;
    Shader* pShader;
};