From c22cb46a26e45324300b71b8b13689aa2dfa7172 Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Fri, 14 Mar 2008 00:15:58 +0000 Subject: [PATCH] initial default implementation of GHealpix class --- include/GHealpix.hpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/Makefile.am | 1 + include/Makefile.in | 1 + src/GHealpix.cpp | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/GImage.cpp | 2 +- src/Makefile.am | 1 + src/Makefile.in | 3 ++- 7 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 include/GHealpix.hpp create mode 100644 src/GHealpix.cpp diff --git a/include/GHealpix.hpp b/include/GHealpix.hpp new file mode 100644 index 0000000..aa0991f --- /dev/null +++ b/include/GHealpix.hpp @@ -0,0 +1,56 @@ +/*************************************************************************** + * GHealpix.hpp - Healpix sky representation class * + * ----------------------------------------------------------------------- * + * copyright : (C) 2008 by Jurgen Knodlseder * + * ----------------------------------------------------------------------- * + * * + * This program 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 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +/** + * @file GHealpix.hpp + * @brief GHealpix class definition. + * @author J. Knodlseder + */ + +#ifndef GHEALPIX_HPP +#define GHEALPIX_HPP + +/* __ Includes ___________________________________________________________ */ + +/* __ Namespaces _________________________________________________________ */ + + +/***********************************************************************//** + * @class GHealpix + * + * @brief GHealpix class interface defintion + ***************************************************************************/ +class GHealpix { + +public: + // Constructors and destructors + GHealpix(); + GHealpix(const GHealpix& pixels); + virtual ~GHealpix(); + + // Operators + GHealpix& operator= (const GHealpix& pixels); + + // Methods + +protected: + // Protected methods + void init_members(void); + void copy_members(const GHealpix& pixels); + void free_members(void); + GHealpix* clone(void) const; + + // Protected data area +private: +}; + +#endif /* GHEALPIX_HPP */ diff --git a/include/Makefile.am b/include/Makefile.am index 56d96c4..82b269f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -3,6 +3,7 @@ pkginclude_HEADERS = GammaLib.hpp \ GException.hpp \ GSkyDir.hpp \ GImage.hpp \ + GHealpix.hpp \ GData.hpp \ GResponse.hpp \ GLATResponse.hpp \ diff --git a/include/Makefile.in b/include/Makefile.in index 5516c6a..8f4bf2e 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -109,6 +109,7 @@ pkginclude_HEADERS = GammaLib.hpp \ GException.hpp \ GSkyDir.hpp \ GImage.hpp \ + GHealpix.hpp \ GData.hpp \ GResponse.hpp \ GLATResponse.hpp \ diff --git a/src/GHealpix.cpp b/src/GHealpix.cpp new file mode 100644 index 0000000..da80595 --- /dev/null +++ b/src/GHealpix.cpp @@ -0,0 +1,182 @@ +/*************************************************************************** + * GHealpix.cpp - Healpix sky representation class * + * ----------------------------------------------------------------------- * + * copyright : (C) 2008 by Jurgen Knodlseder * + * ----------------------------------------------------------------------- * + * * + * This program 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 2 of the License, or * + * (at your option) any later version. * + * * + * ----------------------------------------------------------------------- * + ***************************************************************************/ +/** + * @file GHealpix.cpp + * @brief GHealpix class implementation. + * @author J. Knodlseder + */ + +/* __ Includes ___________________________________________________________ */ +#include "GException.hpp" +#include "GHealpix.hpp" + +/* __ Namespaces _________________________________________________________ */ + +/* __ Method name definitions ____________________________________________ */ + +/* __ Macros _____________________________________________________________ */ + +/* __ Coding definitions _________________________________________________ */ + +/* __ Debug definitions __________________________________________________ */ + + + +/*========================================================================== + = = + = GHealpix constructors/destructors = + = = + ==========================================================================*/ + +/***********************************************************************//** + * @brief Constructor + ***************************************************************************/ +GHealpix::GHealpix() +{ + // Initialise class members for clean destruction + init_members(); + + // Return + return; +} + + +/***********************************************************************//** + * @brief Copy constructor + * + * @param pixels GHealpix instance which should be used for construction + ***************************************************************************/ +GHealpix::GHealpix(const GHealpix& pixels) +{ + // Initialise class members for clean destruction + init_members(); + + // Copy members + copy_members(pixels); + + // Return + return; +} + + +/***********************************************************************//** + * @brief Destructor + ***************************************************************************/ +GHealpix::~GHealpix() +{ + // Free members + free_members(); + + // Return + return; +} + + +/*========================================================================== + = = + = GHealpix operators = + = = + ==========================================================================*/ + +/***********************************************************************//** + * @brief Assignment operator + * + * @param[in] pixels GHealpix instance to be assigned + ***************************************************************************/ +GHealpix& GHealpix::operator= (const GHealpix& pixels) +{ + // Execute only if object is not identical + if (this != &pixels) { + + // Free members + free_members(); + + // Initialise private members for clean destruction + init_members(); + + // Copy members + copy_members(pixels); + + } // endif: object was not identical + + // Return this object + return *this; +} + + +/*========================================================================== + = = + = GHealpix public methods = + = = + ==========================================================================*/ + + +/*========================================================================== + = = + = GHealpix private methods = + = = + ==========================================================================*/ + +/***********************************************************************//** + * @brief Initialise class members + ***************************************************************************/ +void GHealpix::init_members(void) +{ + // Initialise members + + // Return + return; +} + + +/***********************************************************************//** + * @brief Copy class members + * + * @param[in] pixels GHealpix instance from which members should be copied + ***************************************************************************/ +void GHealpix::copy_members(const GHealpix& pixels) +{ + // Copy attributes + + // Return + return; +} + + +/***********************************************************************//** + * @brief Delete class members + ***************************************************************************/ +void GHealpix::free_members(void) +{ + // Free memory + + // Mark memory as free + + // Return + return; +} + + +/*========================================================================== + = = + = GHealpix friends = + = = + ==========================================================================*/ + + +/*========================================================================== + = = + = Other functions used by GHealpix = + = = + ==========================================================================*/ diff --git a/src/GImage.cpp b/src/GImage.cpp index 5db4389..b263462 100644 --- a/src/GImage.cpp +++ b/src/GImage.cpp @@ -55,7 +55,7 @@ GImage::GImage() /***********************************************************************//** * @brief Copy constructor * - * @param data GImage instance which should be used for construction + * @param image GImage instance which should be used for construction ***************************************************************************/ GImage::GImage(const GImage& image) { diff --git a/src/Makefile.am b/src/Makefile.am index 68b4cef..daa6e04 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,6 +13,7 @@ files = GException.cpp \ GSkyDir.cpp \ GNodeArray.cpp \ GImage.cpp \ + GHealpix.cpp \ data/GData.cpp \ rsp/GResponse.cpp \ rsp/GLATResponse.cpp \ diff --git a/src/Makefile.in b/src/Makefile.in index 2d89fb1..035edb3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -118,6 +118,7 @@ files = GException.cpp \ GSkyDir.cpp \ GNodeArray.cpp \ GImage.cpp \ + GHealpix.cpp \ data/GData.cpp \ rsp/GResponse.cpp \ rsp/GLATResponse.cpp \ @@ -166,7 +167,7 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libgamma_la_LIBADD = am__objects_1 = GException.lo GTools.lo GSkyDir.lo GNodeArray.lo \ - GImage.lo GData.lo GResponse.lo GLATResponse.lo \ + GImage.lo GHealpix.lo GData.lo GResponse.lo GLATResponse.lo \ GLATResponseTable.lo GLATAeff.lo GLATPsf.lo GLATEdisp.lo \ GObservation.lo GLATObservation.lo GFitsHeaderCard.lo \ GFitsHeader.lo GFitsData.lo GFitsImage.lo GFitsDblImage.lo \ -- libgit2 0.21.4