Stellarium 0.11.4
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

StelMainGraphicsView Class Reference

Reimplement a QGraphicsView for Stellarium. More...

#include <StelMainGraphicsView.hpp>

List of all members.

Public Slots

void saveScreenShot (const QString &filePrefix="stellarium-", const QString &saveDir="")
 Save a screen shot.
bool getFlagInvertScreenShotColors () const
 Get whether colors are inverted when saving screenshot.
void setFlagInvertScreenShotColors (bool b)
 Set whether colors should be inverted when saving screenshot.
bool getFlagCursorTimeout ()
 Get the state of the mouse cursor timeout flag.
float getCursorTimeout () const
 Get the mouse cursor timeout in seconds.
void setFlagCursorTimeout (bool b)
 Get the state of the mouse cursor timeout flag.
void setCursorTimeout (float t)
 Set the mouse cursor timeout in seconds.
void setMinFps (float m)
 Set the minimum frames per second.
float getMinFps ()
 Get the current minimum frames per second.
void setMaxFps (float m)
 Set the maximum frames per second.
float getMaxFps ()
 Get the current maximum frames per second.
void updateScene ()
 Updates the scene and process all events.

Signals

void screenshotRequested (void)
 emitted when saveScreenShot is requested with saveScreenShot().

Public Member Functions

 StelMainGraphicsView (QWidget *parent)
void init (class QSettings *conf)
 Start the main initialization of Stellarium.
void deinitGL ()
 Delete openGL textures (to call before the GLContext disappears).
class StelAppGraphicsWidgetgetStelAppGraphicsWidget ()
 Return the QGraphicsWidget encapsulating the Stellarium main sky view.
QGraphicsWidget * getTopLevelGraphicsWidget ()
 Return the top level QGraphicsWidget which contains the layout containing the Stellarium main sky view.
StelMainScriptAPIProxygetMainScriptAPIProxy ()
 Get the script API proxy (for signal handling).
StelScriptMgrgetScriptMgr ()
 Get the script manager.

Static Public Member Functions

static StelMainGraphicsViewgetInstance ()
 Get the StelMainGraphicsView singleton instance.

Protected Member Functions

virtual void resizeEvent (QResizeEvent *event)
virtual void mouseMoveEvent (QMouseEvent *event)
virtual void mousePressEvent (QMouseEvent *event)
virtual void mouseReleaseEvent (QMouseEvent *event)
virtual void keyPressEvent (QKeyEvent *event)
virtual void keyReleaseEvent (QKeyEvent *event)
virtual void wheelEvent (QWheelEvent *wheelEvent)
virtual void drawBackground (QPainter *painter, const QRectF &rect)
 Update the mouse pointer state and schedule next redraw.

Detailed Description

Reimplement a QGraphicsView for Stellarium.

It is the class creating the singleton GL Widget, the main StelApp instance as well as the main GUI.


Member Function Documentation

void StelMainGraphicsView::deinitGL (  ) 

Delete openGL textures (to call before the GLContext disappears).

virtual void StelMainGraphicsView::drawBackground ( QPainter *  painter,
const QRectF &  rect 
) [protected, virtual]

Update the mouse pointer state and schedule next redraw.

This method is called automatically by Qt.

float StelMainGraphicsView::getCursorTimeout (  )  const [inline, slot]

Get the mouse cursor timeout in seconds.

bool StelMainGraphicsView::getFlagCursorTimeout (  )  [inline, slot]

Get the state of the mouse cursor timeout flag.

bool StelMainGraphicsView::getFlagInvertScreenShotColors (  )  const [inline, slot]

Get whether colors are inverted when saving screenshot.

static StelMainGraphicsView& StelMainGraphicsView::getInstance (  )  [inline, static]

Get the StelMainGraphicsView singleton instance.

StelMainScriptAPIProxy* StelMainGraphicsView::getMainScriptAPIProxy (  )  [inline]

Get the script API proxy (for signal handling).

float StelMainGraphicsView::getMaxFps (  )  [inline, slot]

Get the current maximum frames per second.

float StelMainGraphicsView::getMinFps (  )  [inline, slot]

Get the current minimum frames per second.

StelScriptMgr& StelMainGraphicsView::getScriptMgr (  )  [inline]

Get the script manager.

class StelAppGraphicsWidget* StelMainGraphicsView::getStelAppGraphicsWidget (  )  [inline]

Return the QGraphicsWidget encapsulating the Stellarium main sky view.

Use its layout if you want to add widget on the top of the main sky view.

QGraphicsWidget* StelMainGraphicsView::getTopLevelGraphicsWidget (  )  [inline]

Return the top level QGraphicsWidget which contains the layout containing the Stellarium main sky view.

Use its layout if you want to add widget on the side of the main sky view.

void StelMainGraphicsView::init ( class QSettings *  conf  ) 

Start the main initialization of Stellarium.

void StelMainGraphicsView::saveScreenShot ( const QString &  filePrefix = "stellarium-",
const QString &  saveDir = "" 
) [slot]

Save a screen shot.

The format of the file, and hence the filename extension depends on the architecture and build type.

  • filePrefix changes the beginning of the file name
  • shotDir changes the directory where the screenshot is saved If shotDir is "" then StelFileMgr::getScreenshotDir() will be used
void StelMainGraphicsView::screenshotRequested ( void   )  [signal]

emitted when saveScreenShot is requested with saveScreenShot().

doScreenshot() does the actual work (it has to do it in the main thread, where as saveScreenShot() might get called from another one.

void StelMainGraphicsView::setCursorTimeout ( float  t  )  [inline, slot]

Set the mouse cursor timeout in seconds.

void StelMainGraphicsView::setFlagCursorTimeout ( bool  b  )  [inline, slot]

Get the state of the mouse cursor timeout flag.

void StelMainGraphicsView::setFlagInvertScreenShotColors ( bool  b  )  [inline, slot]

Set whether colors should be inverted when saving screenshot.

void StelMainGraphicsView::setMaxFps ( float  m  )  [inline, slot]

Set the maximum frames per second.

Parameters:
m the new maximum fps setting.
void StelMainGraphicsView::setMinFps ( float  m  )  [inline, slot]

Set the minimum frames per second.

Usually this minimum will be switched to after there are no user events for some seconds to save power. However, if can be useful to set this to a high value to improve playing smoothness in scripts.

Parameters:
m the new minimum fps setting.
void StelMainGraphicsView::updateScene (  )  [inline, slot]

Updates the scene and process all events.

Generated on Sat Aug 25 22:13:32 2012 for Stellarium by  doxygen 1.6.3