#ifndef __PHYSIKSDRAWER_H_
#define __PHYSIKSDRAWER_H_

#include <QGLWidget>
#include <universe.h>

class PhysiksDrawer : public QGLWidget {
    Q_OBJECT

    public:
        /** \brief Default Qt-Style constructor.    */
        PhysiksDrawer(QWidget *parent = NULL);

        /** \brief Alternate constructor. Includes the functionality of 
         * bindUniverse.
         * \param universe  a pointer to the universe that must be illustrated
         */
        PhysiksDrawer(Physiks::Universe *universe, QWidget *parent = NULL);

        /** \brief Registers a Universe instance with this widget's instance.
         * \param universe  a pointer to the universe that must be illustrated.
         */
        void bindUniverse(Physiks::Universe *universe);

    public slots:
        /** \brief See QGLWidget::updateGL for a description of what this 
         * function is supposed to do.  */
        void updateGL();

    protected:
        /** \brief See QGLWidget::initializeGL for a description of what this 
         * function is supposed to do.  */
        void initializeGL();

        /** \brief See QGLWidget::resizeGL for a description of what this 
         * function is supposed to do.  */
        void resizeGL(int w, int h);

        /** \brief See QGLWidget::paintGL for a description of what this 
         * function is supposed to do.  */
        void paintGL();

        /** \brief Draws a sphere of radius and location specified by arguments 
         * \param vec   the location/position of the sphere 
         * \param radius    the radius of the sphere    */
        void drawSphere(const Physiks::Vector &vec, const PHYSCALAR radius);    

        /** \brief Generic drawing function for all objects in Physiks. 
         * Determines the type of its parameter and appropriately delegates 
         * the actual drawing to other functions.
         * \param part  the object to be illustrated    */
        void drawObject(const Physiks::PhysicalObject &part);

    private:
        Physiks::Universe *universe;

    signals:
        void clicked();
};

#endif

