GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GModelSpatialDiffuse.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GModelSpatialDiffuse.hpp - Abstract diffuse spatial model base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2013-2016 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 _______________________________________________ */
41 class 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 
54 public:
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 std::string type(void) const = 0;
68  virtual double eval(const GPhoton& photon,
69  const bool& gradients = false) const = 0;
70  virtual GSkyDir mc(const GEnergy& energy, const GTime& time,
71  GRan& ran) const = 0;
72  virtual double mc_norm(const GSkyDir& dir,
73  const double& radius) const = 0;
74  virtual bool contains(const GSkyDir& dir,
75  const double& margin = 0.0) const = 0;
76  virtual GSkyRegion* region(void) const = 0;
77  virtual void read(const GXmlElement& xml) = 0;
78  virtual void write(GXmlElement& xml) const = 0;
79  virtual std::string print(const GChatter& chatter = NORMAL) const = 0;
80 
81  // Implemented virtual base class methods
82  virtual GClassCode code(void) const;
83 
84 protected:
85  // Protected methods
86  void init_members(void);
87  void copy_members(const GModelSpatialDiffuse& model);
88  void free_members(void);
89 };
90 
91 
92 /***********************************************************************//**
93  * @brief Return class code
94  *
95  * @return GModelSpatialDiffuse.
96  *
97  * Returns the code GModelSpatialDiffuse of the class.
98  ***************************************************************************/
99 inline
101 {
102  return GMODEL_SPATIAL_DIFFUSE;
103 }
104 
105 #endif /* GMODELSPATIALDIFFUSE_HPP */
GModelSpatialDiffuse(void)
Void constructor.
virtual std::string type(void) const =0
virtual void clear(void)=0
Clear object.
Energy value class definition.
Random number generator class definition.
XML element node class interface definition.
Sky direction class interface definition.
XML element node class.
Definition: GXmlElement.hpp:47
Abstract spatial model base class interface definition.
Random number generator class.
Definition: GRan.hpp:44
Time class.
Definition: GTime.hpp:54
virtual GSkyDir mc(const GEnergy &energy, const GTime &time, GRan &ran) const =0
Class that handles photons.
Definition: GPhoton.hpp:47
void copy_members(const GModelSpatialDiffuse &model)
Copy class members.
virtual double eval(const GPhoton &photon, const bool &gradients=false) const =0
void init_members(void)
Initialise class members.
Abstract interface for the sky region class.
Definition: GSkyRegion.hpp:57
virtual void write(GXmlElement &xml) const =0
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
virtual std::string classname(void) const =0
Return class name.
virtual double mc_norm(const GSkyDir &dir, const double &radius) const =0
GChatter
Definition: GTypemaps.hpp:33
virtual GModelSpatialDiffuse & operator=(const GModelSpatialDiffuse &model)
Assignment operator.
virtual bool contains(const GSkyDir &dir, const double &margin=0.0) const =0
Photon class definition.
void free_members(void)
Delete class members.
virtual GClassCode code(void) const
Return class code.
GClassCode
Definition: GTypemaps.hpp:42
Abstract spatial model base class.
Abstract diffuse spatial model base class.
virtual GModelSpatialDiffuse * clone(void) const =0
Clones object.
Sky direction class.
Definition: GSkyDir.hpp:62
virtual void read(const GXmlElement &xml)=0
Time class interface definition.
virtual GSkyRegion * region(void) const =0
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48
virtual ~GModelSpatialDiffuse(void)
Destructor.