GyotoSpectrum.h
Go to the documentation of this file.
/*
Copyright 2011-2016 Thibaut Paumard
This file is part of Gyoto.
Gyoto is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gyoto is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GyotoSpectrum_H_
#define __GyotoSpectrum_H_
#include "GyotoRegister.h"
#include "GyotoObject.h"
namespace Gyoto{
namespace Register { class Entry; }
class FactoryMessenger;
namespace Spectrum {
class Generic;
typedef Gyoto::SmartPointer<Gyoto::Spectrum::Generic>
Subcontractor_t(Gyoto::FactoryMessenger* fmp, std::vector<std::string> const &);
template<typename T> SmartPointer<Spectrum::Generic> Subcontractor
(FactoryMessenger* fmp, std::vector<std::string> const & plugins) {
SmartPointer<T> sp = new T();
sp -> plugins(plugins) ;
#ifdef GYOTO_USE_XERCES
if (fmp) sp -> setParameters(fmp);
#endif
return sp;
}
void Register(std::string kind, Gyoto::Spectrum::Subcontractor_t* scp);
Gyoto::Spectrum::Subcontractor_t* getSubcontractor(std::string name,
std::vector<std::string> &plugins,
int errmode=0);
extern Register::Entry* Register_;
void initRegister();
}
}
#include <GyotoSmartPointer.h>
#include <string>
class Gyoto::Spectrum::Generic
: public Gyoto::SmartPointee,
public Gyoto::Object
{
friend class Gyoto::SmartPointer<Gyoto::Spectrum::Generic>;
protected:
public:
GYOTO_OBJECT;
Generic();
Generic(const std::string kind);
Generic(const Spectrum::Generic &);
virtual Generic * clone() const;
virtual ~Generic() ;
virtual double operator()(double nu) const =0;
virtual double operator()(double nu, double opacity, double ds) const;
virtual double integrate(double nu1, double nu2) ;
virtual double integrate(double nu1, double nu2,
const Spectrum::Generic * opacity, double ds) ;
};
#endif
GyotoObject.h
Introspectable objects.
GYOTO_OBJECT
#define GYOTO_OBJECT
Declare class::properties and class::getProperties().
Definition GyotoObject.h:84
GyotoRegister.h
Gyoto registers.
GyotoSmartPointer.h
Reference-counting pointers.
Gyoto::FactoryMessenger
Factory / SmartPointee::Subcontractor_t interface.
Definition GyotoFactoryMessenger.h:92
Gyoto::Object
Object with properties.
Definition GyotoObject.h:152
Gyoto::Register::Entry
Entry in a register (or a full register).
Definition GyotoRegister.h:117
Gyoto::SmartPointee
Can be pointed to by a SmartPointer.
Definition GyotoSmartPointer.h:81
Gyoto::SmartPointer
Pointers performing reference counting.
Definition GyotoSmartPointer.h:135
Gyoto::Spectrum::Generic
Spectrum emitted by an Astrobj.
Definition GyotoSpectrum.h:137
Gyoto::Spectrum::Generic::clone
virtual Generic * clone() const
Cloner.
Gyoto::Spectrum::Generic::integrate
virtual double integrate(double nu1, double nu2)
Integrate optically thick I_nu.
Gyoto::Register
Gyoto registers.
Definition GyotoAstrobj.h:46
Gyoto::Spectrum
Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star).
Definition GyotoBlackBodySpectrum.h:35
Gyoto::Spectrum::Register
void Register(std::string kind, Gyoto::Spectrum::Subcontractor_t *scp)
Make a Spectrum kind known to the Factory.
Gyoto::Spectrum::Subcontractor
SmartPointer< Spectrum::Generic > Subcontractor(FactoryMessenger *fmp, std::vector< std::string > const &plugins)
Subcontractor template.
Definition GyotoSpectrum.h:63
Gyoto::Spectrum::Subcontractor_t
Gyoto::SmartPointer< Gyoto::Spectrum::Generic > Subcontractor_t(Gyoto::FactoryMessenger *fmp, std::vector< std::string > const &)
A function to build instances of a specific Spectrum::Generic sub-class.
Definition GyotoSpectrum.h:52
Gyoto::Spectrum::Register_
Register::Entry * Register_
The Spectrum register.
Gyoto::Spectrum::getSubcontractor
Gyoto::Spectrum::Subcontractor_t * getSubcontractor(std::string name, std::vector< std::string > &plugins, int errmode=0)
Query the Spectrum register.
Gyoto::Spectrum::initRegister
void initRegister()
Empty the Spectrum register.
Gyoto
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44