Skip to content

Commit

Permalink
Doc improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
xalioth committed Nov 28, 2008
1 parent 8817d04 commit 73037fd
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 13 deletions.
Binary file modified doc/images/stellarium-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions doc/mainpage.doxygen
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ is targetted at developers of scripts, plugins and the core program.

@section architecture_sec Program Architecture

The code of Stellarium is split into several main blocks:
<ul>
<li>the main loop and main widget classes StelMainWindow, StelMainGraphicsView and StelAppGraphicsScene. Those classes have a single instance which is created at startup by the the ::main() function. They perform various tasks such as the main program window and openGL context creation, the creation of the stellarium core, the creation of the GUI. After initialization, they manage user's input event propagation and event loop. There are heavily based on Qt features.</li>
<li>the core which provides a number of generic services and features to the other components. The main class is the StelApp singleton class which is used everywhere in the code to access other elements. It is the StelApp instance which creates all the main core services and modules at initialization. Example services are OpenGL textures management with the StelTextureManager, font management with the StelFontMgr, sky images management (images which have a fixed position in the sky) with the StelSkyImageMgr etc.. Two especially important manager classes (the ones with the "Mgr" suffix) are the StelModuleMgr and StelCore classes: the first one manages the collection of StelModule instances which are registered in the program (see next point for more info on what a StelModule is). The second one provides performance critical features for rendering various elements using openGL, or for computing coordinate transformation and other mathematical services.</li>
<li>a collection of StelModule instances which display the main elements of the program such as planets and stars. Each StelModule should be registered to the StelModuleMgr. Because many components of Stellarium derive from the StelModule class, it is possible for the main loop to treat them generically by calling their standard methods such StelModule::update() and StelModule::draw() at each program iteration. It also allows other program components to access them by name. StelModule can also be loaded dynamically by Stellarium, which is the standard way of creating plugins.</li>
<li>the Graphical User Interface (StelGui). It is based on styled Qt widgets which are rendered directly in the openGL window. Users actions trigger signals which are connected to core and StelModules slots.</li>
<li>the script engine (StelScriptMgr) allows scripts to calls slots from the core and StelModules slots.</li>
</ul>
@image html stellarium-architecture.png

@section intro_scripts Scripting API
Expand Down
10 changes: 5 additions & 5 deletions doc/stellarium-architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/StelMainGraphicsView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
#define _STELMAINGRAPHICSVIEW_HPP_

#include <QGraphicsView>
#include <QResizeEvent>

class QGLWidget;
class QGraphicsScene;
class QResizeEvent;

//! @class StelMainGraphicsView
//! Reimplement a QGraphicsView for Stellarium.
//! It is the class creating the singleton GL Widget, the main StelApp instance as well as the main GUI.
class StelMainGraphicsView : public QGraphicsView
{
Q_OBJECT;
Expand All @@ -37,10 +39,10 @@ Q_OBJECT;
void init();

//! Get the StelMainGraphicsView singleton instance.
//! @return the StelMainGraphicsView singleton instance
static StelMainGraphicsView& getInstance() {Q_ASSERT(singleton); return *singleton;}

//! Get the main QGLWidget
//! @deprecated don't use that
QGLWidget* getOpenGLWin() {return glWidget;}

//! Delete openGL textures (to call before the GLContext disappears)
Expand Down Expand Up @@ -76,7 +78,7 @@ public slots:

signals:
//! emitted when saveScreenShot is requested with saveScreenShot().
//! doScreenshot() does th actual work (it has to do it in the main
//! doScreenshot() does the actual work (it has to do it in the main
//! thread, where as saveScreenShot() might get called from another one.
void screenshotRequested(void);

Expand Down
6 changes: 5 additions & 1 deletion src/StelMainWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@

#include <QSettings>
#include "StelApp.hpp"


//! @class StelMainWindow
//! Reimplement a QMainWindow for Stellarium.
//! It is the class in charge of switching betwee fullscreen or windowed mode.
class StelMainWindow : public QMainWindow
{
Q_OBJECT;
Expand All @@ -35,6 +38,7 @@ class StelMainWindow : public QMainWindow
//! @return the StelMainWindow singleton instance
static StelMainWindow& getInstance() {Q_ASSERT(singleton); return *singleton;}

//! Performs various initialization incluing the init of the StelMainGraphicsView instance.
void init();

public slots:
Expand Down
7 changes: 4 additions & 3 deletions src/core/StelPainter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ class StelPainter
//! @param poly The polygon to draw
void drawPolygon(const StelGeom::Polygon& poly) const;

//! Draw a small circle arc between points start and stop with rotation point in rotCenter
//! The angle between start and stop must be < 180 deg
//! Draw a small circle arc between points start and stop with rotation point in rotCenter.
//! The angle between start and stop must be < 180 deg.
//! Each time the small circle crosses the edge of the viewport, the viewportEdgeIntersectCallback is called with the
//! screen 2d position, direction of the currently drawn arc toward the inside of the viewport
//! screen 2d position, direction of the currently drawn arc toward the inside of the viewport.
//! If rotCenter is equal to 0,0,0, the method draws a great circle.
void drawSmallCircleArc(const Vec3d& start, const Vec3d& stop, const Vec3d& rotCenter, void (*viewportEdgeIntersectCallback)(const Vec3d& screenPos, const Vec3d& direction, const void* userData)=NULL, const void* userData=NULL) const;

//! Draw a parallel arc in the current frame. The arc start from point start
Expand Down

0 comments on commit 73037fd

Please sign in to comment.