![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
00001 /* 00002 * Author and Copyright of this file and of the stellarium telescope feature: 00003 * Johannes Gajdosik, 2006 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef _TELESCOPEMGR_HPP_ 00021 #define _TELESCOPEMGR_HPP_ 00022 00023 #include "StelObjectModule.hpp" 00024 #include "StelFader.hpp" 00025 #include "VecMath.hpp" 00026 #include "StelTextureTypes.hpp" 00027 #include "StelProjectorType.hpp" 00028 00029 #include <QString> 00030 #include <QStringList> 00031 #include <QMap> 00032 00033 class StelProjector; 00034 class StelNavigator; 00035 class StelFont; 00036 class StelObject; 00037 class Telescope; 00038 class StelPainter; 00039 00047 class TelescopeMgr : public StelObjectModule 00048 { 00049 Q_OBJECT 00050 00051 public: 00052 TelescopeMgr(void); 00053 virtual ~TelescopeMgr(void); 00054 00056 // Methods defined in the StelModule class 00057 virtual void init(); 00058 virtual void draw(StelCore *core); 00059 virtual void update(double deltaTime); 00060 virtual void setStelStyle(const StelStyle& style); 00061 virtual double getCallOrder(StelModuleActionName actionName) const; 00062 00064 // Methods defined in the StelObjectModule class 00065 virtual QList<StelObjectP> searchAround(const Vec3d& v, double limitFov, const StelCore* core) const; 00066 virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; 00067 virtual StelObjectP searchByName(const QString& name) const; 00068 virtual QStringList listMatchingObjectsI18n(const QString& objPrefix, int maxNbItem=5) const; 00069 00071 // Methods specific to TelescopeMgr 00075 void telescopeGoto(int telescopeNr, const Vec3d &j2000Pos); 00076 00078 void deleteAllTelescopes(); 00079 00080 public slots: 00082 void setFlagTelescopes(bool b) {telescopeFader=b;} 00084 bool getFlagTelescopes() const {return (bool)telescopeFader;} 00085 00087 void setFlagTelescopeName(bool b) {nameFader=b;} 00089 bool getFlagTelescopeName() const {return nameFader==true;} 00090 00092 void setCircleColor(const Vec3f &c) {circleColor = c;} 00094 const Vec3f& getCircleColor() const {return circleColor;} 00095 00097 const Vec3f& getLabelColor() const {return labelColor;} 00099 void setLabelColor(const Vec3f &c) {labelColor = c;} 00100 00102 void setFontSize(float fontSize); 00103 00107 void moveTelescopeToSelected(void); 00108 00109 private: 00111 void drawPointer(const StelProjectorP& prj, const StelNavigator* nav, const StelPainter& sPainter); 00112 00114 void communicate(void); 00115 00116 LinearFader nameFader; 00117 LinearFader telescopeFader; 00118 Vec3f circleColor; 00119 Vec3f labelColor; 00120 StelFont *telescope_font; 00121 StelTextureSP telescopeTexture; 00122 00123 QMap<int, Telescope*> telescope_map; 00124 00125 // The selection pointer texture 00126 StelTextureSP texPointer; 00127 }; 00128 00129 00130 #endif // _TELESCOPEMGR_HPP_