~ubuntu-branches/ubuntu/vivid/gyoto/vivid

« back to all changes in this revision

Viewing changes to include/GyotoSpectrum.h

  • Committer: Package Import Robot
  • Author(s): Thibaut Paumard
  • Date: 2014-10-21 14:21:10 UTC
  • mfrom: (8.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20141021142110-1u2odjj2r0hvdh5g
Tags: 0.2.3-1
* New upstream release
* Move to debian-astro team

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "GyotoRegister.h"
31
31
 
32
32
namespace Gyoto{
 
33
  namespace Register { class Entry; }
33
34
  class FactoryMessenger;
 
35
 
34
36
  /// Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star)
35
37
  namespace Spectrum {
36
38
    class Generic;
37
 
#if defined GYOTO_USE_XERCES
38
39
 
39
40
    /// A function to build instances of a specific Spectrum::Generic sub-class
40
41
    /**
60
61
    template<typename T> SmartPointer<Spectrum::Generic> Subcontractor
61
62
      (FactoryMessenger* fmp) {
62
63
      SmartPointer<T> sp = new T();
 
64
#ifdef GYOTO_USE_XERCES
63
65
      sp -> setParameters(fmp);
 
66
#endif
64
67
      return sp;
65
68
    }
66
69
 
107
110
     *  Gyoto::Register::init().
108
111
     */
109
112
    void initRegister();
110
 
#endif
111
113
  }
112
114
}
113
115
 
132
134
 
133
135
  virtual ~Generic() ; ///< Destructor: does nothing.
134
136
 
135
 
  const std::string getKind() const; ///< Get spectrum kind
 
137
  const std::string kind() const; ///< Get spectrum kind
136
138
 
137
139
  virtual double operator()(double nu) const =0;
138
140
          ///< I_nu = mySpectrum(nu), nu in Hz. Assumes optically thick regime.
170
172
  virtual double integrate(double nu1, double nu2,
171
173
                           const Spectrum::Generic * opacity, double ds) ;
172
174
 
 
175
  virtual void setParameter(std::string name,
 
176
                            std::string content,
 
177
                            std::string unit) ;
 
178
  ///< Set any parameter by its name
 
179
 
173
180
#ifdef GYOTO_USE_XERCES
174
181
  /**
175
182
   * Spectrum implementations should impement fillElement to save their
179
186
 
180
187
  virtual void fillElement(FactoryMessenger *fmp) const ;
181
188
                                             ///< called from Factory
182
 
  virtual void setParameter(std::string name,
183
 
                            std::string content,
184
 
                            std::string unit) ;
185
 
  ///< To be called by fillElement()
186
189
 
187
190
  /**
188
191
   * The Subcontractor_t function for each Spectrum kind should look