GammaLib 2.0.0
Loading...
Searching...
No Matches
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 ***************************************************************************/
47class 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
53public:
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
80protected:
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 */
Definition of interface for all GammaLib classes.
Abstract FITS extension base class definition.
Sky direction class interface definition.
Sky map pixel class definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Interface class for all GammaLib classes.
Definition GBase.hpp:52
Abstract FITS extension base class.
Definition GFitsHDU.hpp:51
Sky direction class.
Definition GSkyDir.hpp:62
Sky map pixel class.
Definition GSkyPixel.hpp:74
Abstract sky projection base class.
friend bool operator==(const GSkyProjection &a, const GSkyProjection &b)
Equality operator.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
void copy_members(const GSkyProjection &proj)
Copy class members.
virtual bool compare(const GSkyProjection &proj) const =0
void free_members(void)
Delete class members.
virtual std::string coordsys(void) const
Returns coordinate system.
virtual std::string code(void) const =0
virtual std::string classname(void) const =0
Return class name.
virtual void read(const GFitsHDU &hdu)=0
int m_coordsys
0=CEL, 1=GAL
virtual double solidangle(const GSkyPixel &pixel) const =0
virtual GSkyProjection * clone(void) const =0
Clones object.
virtual int size(void) const =0
friend bool operator!=(const GSkyProjection &a, const GSkyProjection &b)
Non-equality operator.
void init_members(void)
Initialise class members.
virtual void clear(void)=0
Clear object.
virtual GSkyPixel dir2pix(const GSkyDir &dir) const =0
virtual std::string name(void) const =0
virtual GSkyProjection & operator=(const GSkyProjection &proj)
Assignment operator.
GSkyProjection(void)
Void constructor.
virtual ~GSkyProjection(void)
Destructor.
virtual void write(GFitsHDU &hdu) const =0
virtual GSkyDir pix2dir(const GSkyPixel &pixel) const =0