Gyoto
GyotoUniformSphere.h
Go to the documentation of this file.
1 
11 /*
12  Copyright 2011 Frederic Vincent, Thibaut Paumard
13 
14  This file is part of Gyoto.
15 
16  Gyoto is free software: you can redistribute it and/or modify
17  it under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  Gyoto is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  GNU General Public License for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
28  */
29 
30 
31 #ifndef __GyotoUniformSphere_H_
32 #define __GyotoUniformSphere_H_
33 
34 namespace Gyoto{
35  namespace Astrobj { class UniformSphere; }
36 }
37 
38 #include <GyotoMetric.h>
39 #include <GyotoStandardAstrobj.h>
40 #include <GyotoSpectrum.h>
41 
42 #ifdef GYOTO_USE_XERCES
43 #include <GyotoRegister.h>
44 #endif
45 
46 #include <string>
47 
85  friend class Gyoto::SmartPointer<Gyoto::Astrobj::UniformSphere>;
86 
87  // Data :
88  // -----
89  protected:
90  double radius_ ;
91  SmartPointer<Spectrum::Generic> spectrum_;
92  SmartPointer<Spectrum::Generic> opacity_;
93 
94  // Constructors - Destructor
95  // -------------------------
96  public:
103  UniformSphere(std::string kind,
104  SmartPointer<Metric::Generic> gg, double radius) ;
106 
113  UniformSphere(std::string kind);
114 
115  UniformSphere(const UniformSphere& orig);
116 
117  virtual ~UniformSphere() ;
118 
119  // Accessors
120  // ---------
121  public:
122  virtual std::string className() const ;
123  virtual std::string className_l() const ;
124 
125  virtual void setSpectrum(SmartPointer<Spectrum::Generic>);
127  virtual SmartPointer<Spectrum::Generic> getSpectrum() const;
129  virtual void setOpacity(SmartPointer<Spectrum::Generic>);
131  virtual SmartPointer<Spectrum::Generic> getOpacity() const;
133  double getRadius() const ;
134  void setRadius(double);
135  double getRadius(std::string) const ;
136  void setRadius(double, std::string);
137 
138  public:
139  virtual int setParameter(std::string name,
140  std::string content,
141  std::string unit) ;
142 
143 #ifdef GYOTO_USE_XERCES
144 
149  virtual void fillElement(FactoryMessenger *fmp) const ;
151 
161  virtual void setParameters(FactoryMessenger *fmp) ;
163 #endif
164 
165  virtual double operator()(double const coord[4]) ;
167 
168  protected:
173  virtual void getCartesian(double const * const dates, size_t const n_dates,
174  double * const x, double * const y,
175  double * const z, double * const xprime=NULL,
176  double * const yprime=NULL, double * const zprime=NULL) =0;
178 
179  virtual void getVelocity(double const pos[4], double vel[4]) = 0;
181 
182  using Standard::emission;
183  virtual double emission(double nu_em, double dsem,
184  double cp[8], double co[8]=NULL) const;
187  virtual double integrateEmission(double nu1, double nu2, double dsem,
188  double c_ph[8], double c_obj[8]=NULL) const;
189  virtual double transmission(double nuem, double dsem, double*) const ;
191 
192 };
193 
194 
195 #endif