Skip to content
Snippets Groups Projects
Select Git revision
  • 750ed26bdde2c34cbf657e621afaef605cf80994
  • master default
2 results

test_LLO.py

Blame
  • Forked from finesse / pykat
    Source project has a limited visibility.
    AbstractGraphicsEngine.h 4.72 KiB
    #ifndef ABSTRACTGRAPHICSENGINE_H_
    #define ABSTRACTGRAPHICSENGINE_H_
    
    #include "BOINCClientAdapter.h"
    #include "Resource.h"
    
    /**
     * \brief This abstract class provides common features for all graphics engines
     * 
     * All graphics engines (Open GL visualisation code) have to be derived from this class.
     * First of all it defines the common interface which the rest of the graphics framework
     * expects any implementing classes to support. Apart from that, this class also defines
     * common properties like event idetifiers and basic access to BOINC client information.
     *  
     * \author Oliver Bock\n
     * Max-Planck-Institute for Gravitational Physics\n
     * Hannover, Germany
     */
    class AbstractGraphicsEngine
    {
    public:
    	/// Destructor
    	virtual ~AbstractGraphicsEngine();
    	
    	/**
    	 * \brief This method is called when an implementing graphics engine should initialize itself
    	 * 
    	 * \param width The current width of the display surface
    	 * \param height The current height of the display surface
    	 * \param font A pointer to a Resource object containing TTF font faces for text rendering 
    	 */
    	virtual void initialize(const int width, const int height, const Resource *font) = 0;
    	
    	/**
    	 * \brief This method is called when the windowing system encounters a window resize event
    	 * 
    	 * \param width The new width of the display surface
    	 * \param height The new height of the display surface
    	 */
    	virtual void resize(const int width, const int height) = 0;
    	
    	/**
    	 * \brief This method is called when an implementing graphics engine should render one frame
    	 * 
    	 * \param timeOfDay The current time in "seconds since the Epoch" (with microsecond precision)
    	 */	
    	virtual void render(const double timeOfDay) = 0;
    	
    	/**
    	 * \brief Defined mouse button identifiers
    	 * 
    	 * \see mouseButtonEvent
    	 * \see mouseMoveEvent
    	 */ 	
    	enum MouseButton {
    		MouseButtonLeft = 1,
    		MouseButtonRight = 2
    	};
    	
    	/**
    	 * \brief This method is called when the windowing system encounters a mouse button event
    	 * 
    	 * \param positionX The mouse position on the x-axis when the event occurred (range: 0-width)
    	 * \param positionY The mouse position on the y-axis when the event occurred (range: 0-height)
    	 * \param buttonPressed The mouse button pressed (if any) when the event occurred.
    	 * It can be identified using the elements of \ref MouseButton.
    	 * 
    	 * \see MouseButton
    	 */	
    	virtual void mouseButtonEvent(const int positionX, const int positionY, const MouseButton buttonPressed) = 0;