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

StelAppGraphicsWidget.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2009 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
00018  */
00019 
00020 #ifndef _STELAPPGRAPHICSWIDGET_HPP_
00021 #define _STELAPPGRAPHICSWIDGET_HPP_
00022 
00023 #include <QGraphicsWidget>
00024 
00025 class StelViewportEffect;
00026 
00031 class StelAppGraphicsWidget : public QGraphicsWidget
00032 {
00033     Q_OBJECT
00034 public:
00035     StelAppGraphicsWidget(class StelRenderer* renderer);
00036     ~StelAppGraphicsWidget();
00037 
00039     void init(class QSettings* conf);
00040 
00043     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget=0);
00044 
00047     void setViewportEffect(const QString& effectName);
00049     QString getViewportEffect() const;
00050 
00052     void setDoPaint(bool b) {doPaint=b;}
00053     
00054 protected:
00055     virtual void keyPressEvent(QKeyEvent* event);
00056     virtual void keyReleaseEvent(QKeyEvent* event);
00057     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
00058     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
00059     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
00060     virtual void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
00061     virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
00062 
00063 private:
00065     friend class StelAppGraphicsWidgetRenderClient;
00066 
00067     double previousPaintTime;
00069     class StelApp* stelApp;
00071     int paintState;
00072     
00074     class StelRenderer* renderer;
00075 
00077     bool paintPartial();
00078 
00079     StelViewportEffect* viewportEffect;
00080     void distortPos(QPointF* pos);
00081     
00082     bool doPaint;
00083 };
00084 
00085 #endif // _STELAPPGRAPHICSWIDGET_HPP_
00086 
Generated on Thu Jan 31 14:05:40 2013 for Stellarium by  doxygen 1.6.3