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 
155  friend class Gyoto::SmartPointer<Gyoto::Scenery>;
156 
157 
158  // Data :
159  // -----
160  protected:
161 
166 
167 
171  double delta_; // default integration step for the photons
172 
174 
181 
188 
195 
196 # ifdef HAVE_UDUNITS
197  Gyoto::SmartPointer<Gyoto::Units::Converter> intensity_converter_;
200  Gyoto::SmartPointer<Gyoto::Units::Converter> spectrum_converter_;
202  Gyoto::SmartPointer<Gyoto::Units::Converter> binspectrum_converter_;
203 # endif
204 
206 
207  // Constructors - Destructor
208  // -------------------------
209  public:
210  Scenery();
211  Scenery (const Scenery& o);
212  Scenery * clone() const;
213 
215 
219  Scenery(SmartPointer<Metric::Generic>, SmartPointer<Screen>, SmartPointer<Astrobj::Generic>);
220 
221  ~Scenery();
222 
223  // Mutators / assignment
224  // ---------------------
225  public:
226  // Accessors
227  // ---------
228  SmartPointer<Metric::Generic> metric() const;
229 
232  void metric(SmartPointer<Metric::Generic>);
233  SmartPointer<Screen> screen() const;
234 
238  void screen(SmartPointer<Screen>);
239  SmartPointer<Astrobj::Generic> astrobj() const;
240 
243  void astrobj(SmartPointer<Astrobj::Generic>);
244 
245 
246  SmartPointer<Photon> clonePhoton() const;
247 
248  double delta() const ;
249  double delta(const std::string &unit) const ;
250  void delta(double);
251  void delta(double, const std::string &unit);
252 
254 
257  void setRequestedQuantities(Quantity_t quant) ;
258 
260 
264  void setRequestedQuantities(std::string squant) ;
265 
268 
270  std::string getRequestedQuantitiesString() const ;
271 
273 
277 
279  double tMin() const ;
281  double tMin(const std::string &unit) const ;
283  void tMin(double);
285  void tMin(double, const std::string &unit);
286 
287  void adaptive (bool mode) ;
288  bool adaptive () const ;
289 
291  void integrator(std::string type);
293  std::string integrator() const;
294 
296  double deltaMin() const;
298  void deltaMin(double h1);
299 
301  double deltaMax() const;
302 
304  void deltaMax(double h1);
305 
307  double deltaMaxOverR() const;
309  void deltaMaxOverR(double t);
310 
312  void absTol(double);
314  double absTol()const;
316  void relTol(double);
318  double relTol()const;
319 
320  void secondary (bool sec) ;
321  bool secondary () const ;
322 
323  void maxiter (size_t miter) ;
324  size_t maxiter () const ;
325 
326  void nThreads(size_t);
327  size_t nThreads() const ;
328 
330  void intensityConverter(std::string unit);
332  void spectrumConverter(std::string unit);
334  void binSpectrumConverter(std::string unit);
335 
337 
341  void setPropertyConverters(Gyoto::Astrobj::Properties *prop);
342 
343  // Worker:
344  public:
346 
387  void rayTrace(size_t imin, size_t imax, size_t jmin, size_t jmax,
388  Astrobj::Properties* data, double * impactcoords = NULL);
389 
390 
392 
399  void operator() (size_t i, size_t j, Astrobj::Properties *data,
400  double * impactcoords = NULL, Photon * ph = NULL);
401 
402 #ifdef GYOTO_USE_XERCES
403  public:
405 
409  void fillElement(FactoryMessenger *fmp);
411  static SmartPointer<Scenery> Subcontractor(Gyoto::FactoryMessenger*);
412 
413 #endif
414 
415 };
416 
417 #endif
double deltaMax() const
Passed to ph_.
bool adaptive() const
Get ph_.adaptive_.
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:51
double relTol() const
Passed to ph_.
double deltaMin() const
Passed to ph_.
Astronomical objects (light emitters)
SmartPointer< Astrobj::Generic > astrobj() const
Get ph_.obj_.
double tMin() const
Get ph_.tmin_.
A null geodesic transporting light.
Definition: GyotoPhoton.h:51
Ray-tracing scene.
Definition: GyotoScenery.h:154
Reference-counting pointers.
static SmartPointer< Scenery > Subcontractor(Gyoto::FactoryMessenger *)
Instanciate Scenery from an XML description.
size_t nthreads_
Number of parallel threads to use in rayTrace()
Definition: GyotoScenery.h:194
#define size_t
If not defined in .
Definition: GyotoConfig.h:305
void binSpectrumConverter(std::string unit)
Set Scenery::binspectrum_converter_.
Gyoto::Photon ph_
Template Photon.
Definition: GyotoScenery.h:187
Gyoto::Quantity_t quantities_
Quantities to compute.
Definition: GyotoScenery.h:180
SmartPointer< Photon > clonePhoton() const
Clone the internal Photon.
double absTol() const
Passed to ph_.
std::string getRequestedQuantitiesString() const
Get a string representation of Scenery::quantities_.
size_t nThreads() const
Get nthreads_;.
double delta() const
Get default step in geometrical units.
void rayTrace(size_t imin, size_t imax, size_t jmin, size_t jmax, Astrobj::Properties *data, double *impactcoords=NULL)
Perform ray-tracing for a square area on Screen.
Gyoto::SmartPointer< Gyoto::Units::Converter > binspectrum_converter_
See Astrobj::Properties::intensity_converter_.
Definition: GyotoScenery.h:202
size_t maxiter() const
Get ph_.maxiter_.
Gyoto::SmartPointer< Gyoto::Units::Converter > intensity_converter_
See Astrobj::Properties::intensity_converter_.
Definition: GyotoScenery.h:198
Gyoto ubiquitous macros and typedefs.
Base class for metric description.
size_t maxiter_
Maximum number of iterations when integrating.
Definition: GyotoScenery.h:205
void fillElement(FactoryMessenger *fmp)
Fill XML section.
Quantity_t getRequestedQuantities() const
Get Scenery::quantities_.
Gyoto::SmartPointer< Gyoto::Units::Converter > spectrum_converter_
See Astrobj::Properties::intensity_converter_.
Definition: GyotoScenery.h:200
size_t getScalarQuantitiesCount() const
Get number of requested quantities of scalar nature.
void intensityConverter(std::string unit)
Set Scenery::intensity_converter_.
std::string integrator() const
Passed to ph_.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:42
unsigned int Quantity_t
Type for observabke quantities.
Definition: GyotoDefs.h:73
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:79
void setPropertyConverters(Gyoto::Astrobj::Properties *prop)
Copy converters to Astrobj::Properties instance.
SmartPointer< Screen > screen() const
Get Scenery::screen_.
SmartPointer< Metric::Generic > metric() const
Get ph_.Worldline::metric_.
GYOTO converters.
Scenery * clone() const
Cloner.
Description of the observer screen.
double deltaMaxOverR() const
Passed to ph_.
double delta_
Definition: GyotoScenery.h:171
bool secondary() const
Get ph_.secondary_.
void setRequestedQuantities(Quantity_t quant)
Set Scenery::quantities_.
SmartPointer< Screen > screen_
Definition: GyotoScenery.h:165
void spectrumConverter(std::string unit)
Set Scenery::spectrum_converter_.
A single light ray.