Gyoto
GyotoScreen.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2011-2013 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 
140  friend class Gyoto::SmartPointer<Gyoto::Screen>;
141 
142  private:
143  double tobs_;
144  double fov_;
145  // double tmin_;
147 
148  double distance_;
149  double dmax_;
150 
152 
158  double euler_[3];
159  double ex_[3];
160  double ey_[3];
161  double ez_[3];
162 
163  double fourvel_[4];
164  double screen1_[4];
165  double screen2_[4];
166  double screen3_[4];
167 
168  double alpha0_;
169  double delta0_;
170  SmartPointer<Metric::Generic> gg_;
171 
175  SmartPointer<Spectrometer::Generic> spectro_;
176 
182  double freq_obs_;
183 
184  public:
185 
186  // Constructors - Destructor
187  // -------------------------
188  Screen() ;
189  Screen(const Screen& ) ;
190  Screen * clone() const;
191 
192  virtual ~Screen() ;
193 
194  // Mutators / assignment
195  // ---------------------
196 
198  void setProjection(const double paln,
199  const double inclination,
200  const double argument);
202  void setProjection(const double distance,
203  const double paln,
204  const double inclination,
205  const double argument);
206 
208 
211  void setDistance(double dist);
212 
214 
217  void setDmax(double dist);
218 
220 
224  void setDistance(double dist, const std::string unit);
225 
227 
231  void setInclination(double);
232 
234 
238  void setInclination(double, const std::string &unit);
239 
240  void setPALN(double);
242  void setPALN(double, const std::string &unit);
244  void setArgument(double);
246  void setArgument(double, const std::string &unit);
248  void setSpectrometer(SmartPointer<Spectrometer::Generic> spectro);
250  SmartPointer<Spectrometer::Generic> getSpectrometer() const ;
252 
257  void setFreqObs(double fo);
258 
259 
266  void setFreqObs(double fo, const std::string &unit);
267 
271  double getFreqObs() const ;
272 
278  double getFreqObs(const std::string &unit) const;
279 
281 
289  void setObserverPos(const double pos[4]);
290 
291  void setFourVel(const double coord[4]);
293  void setScreen1(const double coord[4]);
295  void setScreen2(const double coord[4]);
297  void setScreen3(const double coord[4]);
299 
300  // Accessors
301  // ---------
302 
304 
307  int getCoordKind() const;
308 
310 
313  double getDistance() const;
314 
316 
319  double getDistance(const std::string&) const;
320 
322 
325  double getDmax() const;
326 
328 
332  double getInclination() const;
333 
335 
339  double getInclination(const std::string&) const;
340 
341  double getPALN() const;
342  double getPALN(const std::string&) const;
343  double getArgument() const;
344  double getArgument(const std::string&) const;
345 
346  SmartPointer<Metric::Generic> getMetric() const;
347  void setMetric(SmartPointer<Metric::Generic> gg);
348 
350  double getTime();
351 
353  double getTime(const std::string &);
354 
356  void setTime(double, const std::string &);
357 
359  void setTime(double);
360 
362  double getFieldOfView();
363 
365  double getFieldOfView(std::string unit);
366 
368  void setFieldOfView(double);
369 
371  void setFieldOfView(double, const std::string &unit);
372 
374  void setAlpha0(double);
376  void setDelta0(double);
377 
379  void setAnglekind(int);
380 
384  void setResolution(size_t);
385 
387 
398  void getObserverPos(double coord[]) const;
399 
401 
404  void getFourVel(double fourvel[]) const;
405 
407 
410  void getScreen1(double output[]) const;
411 
413 
416  void getScreen2(double output[]) const;
417 
419 
422  void getScreen3(double output[]) const;
423 
425 
434  void getRayCoord(double x, double y, double coord[]) const;
435 
437 
445  void getRayCoord(const size_t i, const size_t j, double coord[]) const;
446 
447  void coordToSky(const double pos[4], double skypos[3]) const;
449 
450  void coordToXYZ(const double pos[4], double xyz[3]) const;
452 
453  void computeBaseVectors() ;
455 
457  // friend std::ostream& operator<<(std::ostream& , const Screen& ) ;
458  std::ostream& print(std::ostream&) const ;
459  std::ostream& printBaseVectors(std::ostream&) const ;
460 
461  // UDUNITS
462 # ifdef HAVE_UDUNITS
463 
472  void mapPixUnit();
473 
475 
478  void unmapPixUnit();
479 # endif
480 
481 
482 #ifdef GYOTO_USE_XERCES
483  public:
484  void fillElement(FactoryMessenger *fmp);
485  static SmartPointer<Screen> Subcontractor(FactoryMessenger* fmp);
487 #endif
488 
489 
490 };
491 
492 #endif