GammaLib 2.0.0
Loading...
Searching...
No Matches
GModelSpatialDiffuse.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GModelSpatialDiffuse.hpp - Abstract diffuse spatial model base class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2013-2020 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- *
6 * *
7 * This program is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19 * *
20 ***************************************************************************/
21/**
22 * @file GModelSpatialDiffuse.hpp
23 * @brief Abstract diffuse spatial model base class interface definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GMODELSPATIALDIFFUSE_HPP
28#define GMODELSPATIALDIFFUSE_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include "GModelSpatial.hpp"
33#include "GPhoton.hpp"
34#include "GSkyDir.hpp"
35#include "GEnergy.hpp"
36#include "GTime.hpp"
37#include "GXmlElement.hpp"
38#include "GRan.hpp"
39
40/* __ Forward declarations _______________________________________________ */
41class GSkyRegion;
42
43
44/***********************************************************************//**
45 * @class GModelSpatialDiffuse
46 *
47 * @brief Abstract diffuse spatial model base class
48 *
49 * This class defines the interface for a diffuse model as spatial component
50 * of the factorized source model.
51 ***************************************************************************/
53
54public:
55 // Constructors and destructors
58 virtual ~GModelSpatialDiffuse(void);
59
60 // Operators
62
63 // Pure virtual methods
64 virtual void clear(void) = 0;
65 virtual GModelSpatialDiffuse* clone(void) const = 0;
66 virtual std::string classname(void) const = 0;
67 virtual double eval(const GPhoton& photon,
68 const bool& gradients = false) const = 0;
69 virtual GSkyDir mc(const GEnergy& energy, const GTime& time,
70 GRan& ran) const = 0;
71 virtual double mc_norm(const GSkyDir& dir,
72 const double& radius) const = 0;
73 virtual bool contains(const GSkyDir& dir,
74 const double& margin = 0.0) const = 0;
75 virtual void read(const GXmlElement& xml) = 0;
76 virtual void write(GXmlElement& xml) const = 0;
77 virtual std::string print(const GChatter& chatter = NORMAL) const = 0;
78
79 // Implemented virtual base class methods
80 virtual GClassCode code(void) const;
81
82protected:
83 // Protected methods
84 void init_members(void);
85 void copy_members(const GModelSpatialDiffuse& model);
86 void free_members(void);
87 virtual void set_region(void) const = 0;
88};
89
90
91/***********************************************************************//**
92 * @brief Return class code
93 *
94 * @return GModelSpatialDiffuse.
95 *
96 * Returns the code GModelSpatialDiffuse of the class.
97 ***************************************************************************/
98inline
103
104#endif /* GMODELSPATIALDIFFUSE_HPP */
Energy value class definition.
Abstract spatial model base class interface definition.
Photon class definition.
Random number generator class definition.
Sky direction class interface definition.
Time class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
GClassCode
Definition GTypemaps.hpp:42
@ GMODEL_SPATIAL_DIFFUSE
Definition GTypemaps.hpp:46
XML element node class interface definition.
Class that handles energies in a unit independent way.
Definition GEnergy.hpp:48
Abstract diffuse spatial model base class.
void init_members(void)
Initialise class members.
virtual GModelSpatialDiffuse * clone(void) const =0
Clones object.
virtual bool contains(const GSkyDir &dir, const double &margin=0.0) const =0
virtual GSkyDir mc(const GEnergy &energy, const GTime &time, GRan &ran) const =0
virtual double mc_norm(const GSkyDir &dir, const double &radius) const =0
virtual ~GModelSpatialDiffuse(void)
Destructor.
virtual GClassCode code(void) const
Return class code.
virtual void write(GXmlElement &xml) const =0
virtual GModelSpatialDiffuse & operator=(const GModelSpatialDiffuse &model)
Assignment operator.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
virtual double eval(const GPhoton &photon, const bool &gradients=false) const =0
void free_members(void)
Delete class members.
GModelSpatialDiffuse(void)
Void constructor.
void copy_members(const GModelSpatialDiffuse &model)
Copy class members.
virtual void set_region(void) const =0
virtual std::string classname(void) const =0
Return class name.
virtual void clear(void)=0
Clear object.
virtual void read(const GXmlElement &xml)=0
Abstract spatial model base class.
Class that handles photons.
Definition GPhoton.hpp:47
Random number generator class.
Definition GRan.hpp:44
Sky direction class.
Definition GSkyDir.hpp:62
Abstract interface for the sky region class.
Time class.
Definition GTime.hpp:55
XML element node class.