Документ взят из кэша поисковой машины. Адрес оригинального документа : http://astro.uni-altai.ru/~aw/stellarium/api/StelSkyDrawer_8hpp_source.html
Дата изменения: Unknown
Дата индексирования: Fri Feb 28 07:46:11 2014
Кодировка:

Поисковые слова: arp 220
Stellarium: core/StelSkyDrawer.hpp Source File
Stellarium 0.12.3
StelSkyDrawer.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2007 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef _STELSKYDRAWER_HPP_
21 #define _STELSKYDRAWER_HPP_
22 
23 #include "StelProjectorType.hpp"
24 #include "VecMath.hpp"
25 #include "RefractionExtinction.hpp"
26 
27 #include "renderer/StelIndexBuffer.hpp"
28 #include "renderer/StelVertexBuffer.hpp"
29 
30 #include <QObject>
31 
32 
33 class StelToneReproducer;
34 class StelCore;
35 
39 class StelSkyDrawer : public QObject
40 {
41  Q_OBJECT
42 public:
44  StelSkyDrawer(StelCore* core, class StelRenderer* renderer);
47 
49  void init();
50 
53  void update(double deltaTime);
54 
56  void preDrawPointSource();
57 
59  void postDrawPointSource(StelProjectorP projector);
60 
61 
75  bool pointSourceVisible(StelProjector* projector, const Vec3f& v, const float rcMag[2],
76  bool checkInScreen, Vec3f& outWindowCoordinates)
77  {
78  // If radius is negative
79  if (rcMag[0] <= 0.0f){return false;}
80  return checkInScreen ? projector->projectCheck(v, outWindowCoordinates)
81  : projector->project(v, outWindowCoordinates);
82  }
83 
103  void drawPointSource(const Vec3f& win, const float rcMag[2], unsigned int bV)
104  {
105  return drawPointSource(win, rcMag, colorTable[bV]);
106  }
107 
108  void drawPointSource(const Vec3f& win, const float rcMag[2], const Vec3f& bcolor);
109 
111  void drawSunCorona(StelProjectorP projector, const Vec3d& v, float radius, float alpha);
112 
119  void postDrawSky3dModel(StelProjectorP projector, const Vec3d& v, float illuminatedArea, float mag, const Vec3f& color = Vec3f(1.f,1.f,1.f));
120 
125  bool computeRCMag(float mag, float rcMag[2]) const;
126 
132  void reportLuminanceInFov(float lum, bool fastAdaptation=false);
133 
135  void preDraw();
136 
140  static float surfacebrightnessToLuminance(float sb);
144  static float luminanceToSurfacebrightness(float lum);
145 
147  static inline float indexToBV(unsigned char bV)
148  {
149  return (float)bV*(4.f/127.f)-0.5f;
150  }
151 
153  static inline const Vec3f& indexToColor(unsigned char bV)
154  {
155  return colorTable[bV];
156  }
157 
158 public slots:
160  void setRelativeStarScale(double b=1.0) {starRelativeScale=b;}
162  float getRelativeStarScale() const {return starRelativeScale;}
163 
165  void setAbsoluteStarScale(double b=1.0) {starAbsoluteScaleF=b;}
167  float getAbsoluteStarScale() const {return starAbsoluteScaleF;}
168 
170  void setTwinkleAmount(double b) {twinkleAmount=b;}
172  float getTwinkleAmount() const {return twinkleAmount;}
173 
175  void setFlagTwinkle(bool b) {flagStarTwinkle=b;}
177  bool getFlagTwinkle() const {return flagStarTwinkle;}
178 
180  void setDrawStarsAsPoints(bool b) {drawStarsAsPoints=b;}
182  bool getDrawStarsAsPoints() const {return drawStarsAsPoints;}
183 
187  void setBortleScale(int index);
189  int getBortleScale() const {return bortleScaleIndex;}
190 
194  float getLimitMagnitude() const {return limitMagnitude;}
195 
199  // FIXME: Exposed to scripts - make sure it synchs with the GUI. --BM
200  void setFlagStarMagnitudeLimit(bool b) {flagStarMagnitudeLimit = b;}
204  // FIXME: Exposed to scripts - make sure it synchs with the GUI. --BM
205  void setFlagNebulaMagnitudeLimit(bool b) {flagNebulaMagnitudeLimit = b;}
207  bool getFlagStarMagnitudeLimit() const {return flagStarMagnitudeLimit;}
209  bool getFlagNebulaMagnitudeLimit() const {return flagNebulaMagnitudeLimit;}
210 
212  float getCustomStarMagnitudeLimit() const {return customStarMagLimit;}
215  void setCustomStarMagnitudeLimit(double limit) {customStarMagLimit=limit;}
217  float getCustomNebulaMagnitudeLimit() const {return customNebulaMagLimit;}
220  void setCustomNebulaMagnitudeLimit(double limit) {customNebulaMagLimit=limit;}
221 
225  float