#pragma once

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

/*
   Class: Axis

     Implements an axis object.

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

         Initializes the object.

       Parameters:

         iOrientation - <ORIENTATION_HORIZONTAL> or <ORIENTATION_VERTICAL>.
         sText - Text for the label of the axis. Default value is NULL.
    */
    Axis(int iOrientation, QString sText = NULL);

    /*
       Destructor: ~Axis

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


    /*
       Function: Draw

         Draws the axis. *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 axis. *Inherited* from <AlterableObject>.

       Parameters:

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

    /*
       Function: ChangePosition

         Unused function. *Inherited* from <AlterableObject>.

       Parameters:

         fDeltaLeft - Unused parameter.
         fDeltaTop - Unused parameter.
         fDeltaBottom - Unused parameter.
    */
    void ChangePosition(float fDeltaLeft, float fDeltaTop, float fDeltaBottom);

    /*
       Function: ChangeAlpha

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

       Parameters:

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

    /*
       Function: GetOrientation

         Returns the orientation of the axis, either <ORIENTATION_HORIZONTAL> or <ORIENTATION_VERTICAL>.

       Returns:

         The orientation of the axis.
    */
    int GetOrientation();

    /*
       Function: GetText

         Returns the text of the label assigned to the axis.

       Returns:

         The text of the label assigned to the axis.
    */
    QString GetText();

  private:
    glm::vec4* vHorizontalVertices;
    glm::vec4* vVerticalVertices;
    glm::vec4* vColors;
    int* vIndices;
    int iOrientation;
    QString sText;
    Label* pLabel;
    Shader* pShader;
};