GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSkyProjection.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GSkyProjection.hpp - Abstract sky projection base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2010-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 GSkyProjection.hpp
23  * @brief Abstract sky projection base class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GSKYPROJECTION_HPP
28 #define GSKYPROJECTION_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GBase.hpp"
33 #include "GFitsHDU.hpp"
34 #include "GSkyDir.hpp"
35 #include "GSkyPixel.hpp"
36 
37 
38 /***********************************************************************//**
39  * @class GSkyProjection
40  *
41  * @brief Abstract sky projection base class
42  *
43  * This class defines an abstract projection from sky coordinates into
44  * pixel coordinates. Sky coordinates are implemented using the GSkyDir
45  * class, pixel coordinates are implemented using the GSkyPixel class.
46  ***************************************************************************/
47 class GSkyProjection : public GBase {
48 
49  // Operator friends
50  friend bool operator==(const GSkyProjection &a, const GSkyProjection &b);
51  friend bool operator!=(const GSkyProjection &a, const GSkyProjection &b);
52 
53 public:
54  // Constructors and destructors
55  GSkyProjection(void);
56  GSkyProjection(const GSkyProjection& proj);
57  virtual ~GSkyProjection(void);
58 
59  // Operators
60  virtual GSkyProjection& operator=(const GSkyProjection& proj);
61 
62  // Pure virtual methods
63  virtual void clear(void) = 0;
64  virtual GSkyProjection* clone(void) const = 0;
65  virtual std::string classname(void) const = 0;
66  virtual int size(void) const = 0;
67  virtual std::string code(void) const = 0;
68  virtual std::string name(void) const = 0;
69  virtual void read(const GFitsHDU& hdu) = 0;
70  virtual void write(GFitsHDU& hdu) const = 0;
71  virtual double solidangle(const GSkyPixel& pixel) const = 0;
72  virtual GSkyDir pix2dir(const GSkyPixel& pixel) const = 0;
73  virtual GSkyPixel dir2pix(const GSkyDir& dir) const = 0;
74  virtual std::string print(const GChatter& chatter = NORMAL) const = 0;
75 
76  // Virtual methods
77  virtual std::string coordsys(void) const;
78  virtual void coordsys(const std::string& coordsys);
79 
80 protected:
81  // Protected methods
82  void init_members(void);
83  void copy_members(const GSkyProjection& proj);
84  void free_members(void);
85  virtual bool compare(const GSkyProjection& proj) const = 0;
86 
87  // Protected members
88  int m_coordsys; //!< 0=CEL, 1=GAL
89 };
90 
91 #endif /* GSKYPROJECTION_HPP */
Sky direction class interface definition.
Abstract FITS extension base class.
Definition: GFitsHDU.hpp:51
Definition of interface for all GammaLib classes.
virtual GSkyProjection & operator=(const GSkyProjection &proj)
Assignment operator.
virtual void read(const GFitsHDU &hdu)=0
virtual int size(void) const =0
virtual std::string name(void) const =0
virtual std::string code(void) const =0
Abstract FITS extension base class definition.
Sky map pixel class.
Definition: GSkyPixel.hpp:74
void copy_members(const GSkyProjection &proj)
Copy class members.
friend bool operator!=(const GSkyProjection &a, const GSkyProjection &b)
Non-equality operator.
virtual bool compare(const GSkyProjection &proj) const =0
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
GSkyProjection(void)
Void constructor.
int m_coordsys
0=CEL, 1=GAL
GChatter
Definition: GTypemaps.hpp:33
friend bool operator==(const GSkyProjection &a, const GSkyProjection &b)
Equality operator.
virtual void write(GFitsHDU &hdu) const =0
virtual std::string coordsys(void) const
Returns coordinate system.
void free_members(void)
Delete class members.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
virtual double solidangle(const GSkyPixel &pixel) const =0
virtual std::string classname(void) const =0
Return class name.
void init_members(void)
Initialise class members.
virtual void clear(void)=0
Clear object.
Abstract sky projection base class.
virtual GSkyDir pix2dir(const GSkyPixel &pixel) const =0
Sky map pixel class definition.
Sky direction class.
Definition: GSkyDir.hpp:62
virtual ~GSkyProjection(void)
Destructor.
virtual GSkyPixel dir2pix(const GSkyDir &dir) const =0
virtual GSkyProjection * clone(void) const =0
Clones object.