Gyoto
GyotoScreen.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2011 Thibaut Paumard, Frederic Vincent
9 
10  This file is part of Gyoto.
11 
12  Gyoto is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  Gyoto is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #ifndef __GyotoScreen_H_
27 #define __GyotoScreen_H_
28 
29 #include <iostream>
30 #include <fstream>
31 #include <string>
32 
33 namespace Gyoto {
34  class Screen;
35 }
36 
37 #include <GyotoDefs.h>
38 #include <GyotoUtils.h>
39 #include <GyotoSmartPointer.h>
40 #include <GyotoMetric.h>
41 #include <GyotoSpectrometer.h>
42 
146 class Gyoto::Screen : protected Gyoto::SmartPointee {
147  friend class Gyoto::SmartPointer<Gyoto::Screen>;
148 
149  private:
150  double tobs_;
151  double fov_;
152  // double tmin_;
153  size_t npix_;
154 
155  double distance_;
156  double dmax_;
157 
163  double euler_[3];
164  double ex_[3];
165  double ey_[3];
166  double ez_[3];
167 
168  SmartPointer<Metric::Generic> gg_;
169 
170  SmartPointer<Spectrometer> spectro_;
171 
172  public:
173 
174  // Constructors - Destructor
175  // -------------------------
176  Screen() ;
177  Screen(const Screen& ) ;
178  Screen * clone() const;
179 
180  virtual ~Screen() ;
181 
182  // Mutators / assignment
183  // ---------------------
184 
186  void setProjection(const double paln,
187  const double inclination,
188  const double argument);
190  void setProjection(const double distance,
191  const double paln,
192  const double inclination,
193  const double argument);
194 
198  void setDistance(double dist);
199  void setDmax(double dist);
200 
205  void setDistance(double dist, const std::string unit);
207  void setInclination(double);
209  void setInclination(double, const std::string &unit);
210  void setPALN(double);
212  void setPALN(double, const std::string &unit);
213  void setArgument(double);
215  void setArgument(double, const std::string &unit);
216  void setSpectrometer(SmartPointer<Spectrometer> spectro);
217  SmartPointer<Spectrometer> getSpectrometer() const ;
218 
220 
228  void setObserverPos(const double pos[4]);
230 
231  // Accessors
232  // ---------
233 
234  int getCoordKind() const;
235  double getDistance() const;
236  double getDmax() const;
237  double getInclination() const;
238  double getPALN() const;
239  double getArgument() const;
240 
241 
242  SmartPointer<Metric::Generic> getMetric() const;
243  void setMetric(SmartPointer<Metric::Generic> gg);
244 
245  double getTime();
246  void setTime(double, const std::string &);
247  void setTime(double);
248  // double getMinimumTime();
249  // void setMinimumTime(double);
250  double getFieldOfView();
251  void setFieldOfView(double);
252  void setFieldOfView(double, const std::string &unit);
253  size_t getResolution();
254  void setResolution(size_t);
255 
256 
270  void getObserverPos(double coord[]) const;
272 
273 
284  void getRayCoord(double x, double y, double coord[]) const;
285  void getRayCoord(const size_t i, const size_t j, double coord[]) const;
286 
287  void coordToSky(const double pos[4], double skypos[3]) const;
289 
290  void coordToXYZ(const double pos[4], double xyz[3]) const;
292 
293  void computeBaseVectors() ;
295 
296 
297 
298 
300  friend std::ostream& operator<<(std::ostream& , const Screen& ) ;
301  std::ostream& print(std::ostream&) const ;
302  std::ostream& printBaseVectors(std::ostream&) const ;
303 
304 #ifdef GYOTO_USE_XERCES
305  public:
306  void fillElement(FactoryMessenger *fmp);
307  static SmartPointer<Screen> Subcontractor(FactoryMessenger* fmp);
308 #endif
309 
310 
311 };
312 
313 #endif