Gyoto
GyotoScenery.h
Go to the documentation of this file.
1 
8 /*
9  Copyright 2011 Thibaut Paumard
10 
11  This file is part of Gyoto.
12 
13  Gyoto is free software: you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  Gyoto is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
27 #ifndef __GyotoScenery_H_
28 #define __GyotoScenery_H_
29 
30 namespace Gyoto{
31  class Scenery;
32 }
33 
34 #include <GyotoDefs.h>
35 #include <GyotoSmartPointer.h>
36 #include <GyotoAstrobj.h>
37 #include <GyotoMetric.h>
38 #include <GyotoScreen.h>
39 #include <GyotoPhoton.h>
40 #include <GyotoConverters.h>
41 
111  friend class Gyoto::SmartPointer<Gyoto::Scenery>;
112 
113 
114  // Data :
115  // -----
116  protected:
120  SmartPointer<Metric::Generic> gg_;
121 
126 
130  SmartPointer<Astrobj::Generic> obj_;
131 
132  bool adaptive_;
133 
137  double delta_; // default integration step for the photons
138 
140 
147 
152 
160  double tmin_;
161 
168 
169 # ifdef HAVE_UDUNITS
170 
171  Gyoto::SmartPointer<Gyoto::Units::Converter> intensity_converter_;
173  Gyoto::SmartPointer<Gyoto::Units::Converter> spectrum_converter_;
175  Gyoto::SmartPointer<Gyoto::Units::Converter> binspectrum_converter_;
176 # endif
177 
179 
180  // Constructors - Destructor
181  // -------------------------
182  public:
183  Scenery();
184  Scenery (const Scenery& o);
185  Scenery * clone() const;
186 
188 
192  Scenery(SmartPointer<Metric::Generic>, SmartPointer<Screen>, SmartPointer<Astrobj::Generic>);
193 
194  ~Scenery();
195 
196  // Mutators / assignment
197  // ---------------------
198  public:
199  // Accessors
200  // ---------
201  SmartPointer<Metric::Generic> getMetric();
202 
205  void setMetric(SmartPointer<Metric::Generic>);
206  SmartPointer<Screen> getScreen();
207 
211  void setScreen(SmartPointer<Screen>);
212  SmartPointer<Astrobj::Generic> getAstrobj();
213 
216  void setAstrobj(SmartPointer<Astrobj::Generic>);
217  double getDelta() const ;
218  double getDelta(const std::string &unit) const ;
219  void setDelta(double);
220  void setDelta(double, const std::string &unit);
221 
223 
226  void setRequestedQuantities(Quantity_t quant) ;
227 
229 
233  void setRequestedQuantities(std::string squant) ;
234 
237 
239  std::string getRequestedQuantitiesString() const ;
240 
242 
246 
248  double getTmin() const ;
250  double getTmin(const std::string &unit) const ;
252  void setTmin(double);
254  void setTmin(double, const std::string &unit);
255 
256  void adaptive (bool mode) ;
257  bool adaptive () const ;
258 
259  void maxiter (size_t miter) ;
260  size_t maxiter () const ;
261 
262  void setNThreads(size_t);
263  size_t getNThreads() const ;
264 
266  void setIntensityConverter(std::string unit);
268  void setSpectrumConverter(std::string unit);
270  void setBinSpectrumConverter(std::string unit);
271 
273 
277  void setPropertyConverters(Gyoto::Astrobj::Properties *prop);
278 
279  // Worker:
280  public:
282 
323  void rayTrace(size_t imin, size_t imax, size_t jmin, size_t jmax,
324  Astrobj::Properties* data, double * impactcoords = NULL);
325 
326 
328 
335  void operator() (size_t i, size_t j, Astrobj::Properties *data,
336  double * impactcoords = NULL, Photon * ph = NULL);
337 
338 #ifdef GYOTO_USE_XERCES
339  public:
341 
345  void fillElement(FactoryMessenger *fmp);
347  static SmartPointer<Scenery> Subcontractor(Gyoto::FactoryMessenger*);
348 
349 #endif
350 
351 };
352 
353 #endif