GRALESHELL

cmdsources.h

00001 /*
00002 
00003   This file is a part of GRALESHELL, a program to facilitate the simulation
00004   and inversion of gravitational lenses, based on the GRALE library.
00005 
00006   Copyright (C) 2008-2012 Jori Liesenborgs
00007 
00008   Contact: jori.liesenborgs@gmail.com
00009   
00010   This program is free software; you can redistribute it and/or modify
00011   it under the terms of the GNU General Public License as published by
00012   the Free Software Foundation; either version 2 of the License, or
00013   (at your option) any later version.
00014   
00015   This program is distributed in the hope that it will be useful,
00016   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018   GNU General Public License for more details.
00019   
00020   You should have received a copy of the GNU General Public License
00021   along with this program; if not, write to the Free Software
00022   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023   
00024 */
00025 
00026 #ifndef CMDSOURCES_H
00027 
00028 #define CMDSOURCES_H
00029 
00030 #include <shellp/shellcommand.h>
00031 #include <shellp/shellcmdrealarg.h>
00032 #include <shellp/shellcmdboolarg.h>
00033 #include <shellp/shellcmdintarg.h>
00034 #include <shellp/shellcmdstringarg.h>
00035 
00036 class CmdSourcePlane : public shellp::ShellCommand
00037 {
00038 public:
00039         CmdSourcePlane(const std::string &cmdname);
00040         ~CmdSourcePlane();
00041         bool execute();
00042 private:
00043         shellp::ShellCmdRealArg *Dsarg,*Ddsarg;
00044         shellp::ShellCmdBoolArg *delsrcarg;
00045 };
00046 
00047 class CmdSourcePlaneLoadSave : public shellp::ShellCommand
00048 {
00049 public:
00050         CmdSourcePlaneLoadSave(const std::string &cmdname);
00051         ~CmdSourcePlaneLoadSave();
00052 protected:
00053         shellp::ShellCmdStringArg *fnamearg;
00054         shellp::ShellCmdBoolArg *processsourcesarg;
00055 };
00056 
00057 class CmdSourcePlaneLoad : public CmdSourcePlaneLoadSave
00058 {
00059 public:
00060         CmdSourcePlaneLoad(const std::string &cmdname);
00061         ~CmdSourcePlaneLoad();
00062         bool execute();
00063 };
00064 
00065 class CmdSourcePlaneSave : public CmdSourcePlaneLoadSave
00066 {
00067 public:
00068         CmdSourcePlaneSave(const std::string &cmdname);
00069         ~CmdSourcePlaneSave();
00070         bool execute();
00071 };
00072 
00073 class CmdSourcesAddBase : public shellp::ShellCommand
00074 {
00075 protected:
00076         CmdSourcesAddBase(const std::string &cmdName);
00077 public:
00078         ~CmdSourcesAddBase();
00079 protected:
00080         int getSourceNumber() const                                             { return m_pSrcNumArg->getValue(); }
00081         double getX() const                                                     { return m_pXPosArg->getValue(); }
00082         double getY() const                                                     { return m_pYPosArg->getValue(); }
00083         double getBrightnessScale() const                                       { return m_pBrightnessScale->getValue(); }
00084 private:
00085         shellp::ShellCmdIntArg *m_pSrcNumArg;
00086         shellp::ShellCmdRealArg *m_pXPosArg, *m_pYPosArg;
00087         shellp::ShellCmdRealArg *m_pBrightnessScale;
00088 };
00089 
00090 class CmdSourcesAddCircular : public CmdSourcesAddBase
00091 {
00092 public:
00093         CmdSourcesAddCircular(const std::string &cmdName);
00094         ~CmdSourcesAddCircular();
00095         bool execute();
00096 private:
00097         shellp::ShellCmdRealArg *m_pRadiusArg;
00098         shellp::ShellCmdBoolArg *m_pFadeArg;
00099 };
00100 
00101 class CmdSourcesAddPoint : public CmdSourcesAddBase
00102 {
00103 public:
00104         CmdSourcesAddPoint(const std::string &cmdName);
00105         ~CmdSourcesAddPoint();
00106         bool execute();
00107 };
00108 
00109 class CmdSourcesAddRotatedBase : public CmdSourcesAddBase
00110 {
00111 protected:
00112         CmdSourcesAddRotatedBase(const std::string &cmdName);
00113 public:
00114         ~CmdSourcesAddRotatedBase();
00115 protected:
00116         double getAngle() const                                                 { return m_pAngleArg->getValue(); }
00117 private:
00118         shellp::ShellCmdRealArg *m_pAngleArg;
00119 };
00120 
00121 class CmdSourcesAddElliptical : public CmdSourcesAddRotatedBase
00122 {
00123 public:
00124         CmdSourcesAddElliptical(const std::string &cmdname);
00125         ~CmdSourcesAddElliptical();
00126         bool execute();
00127 private:
00128         shellp::ShellCmdRealArg *axisarg;
00129         shellp::ShellCmdRealArg *excentrarg;
00130         shellp::ShellCmdBoolArg *fadearg;
00131 };
00132 
00133 class CmdSourcesAddFITS : public CmdSourcesAddRotatedBase
00134 {
00135 public:
00136         CmdSourcesAddFITS(const std::string &cmdname);
00137         ~CmdSourcesAddFITS();
00138         bool execute();
00139 private:
00140         shellp::ShellCmdStringArg *fnamearg;
00141         shellp::ShellCmdRealArg *widtharg;
00142         shellp::ShellCmdRealArg *heightarg;
00143 };
00144 
00145 class CmdSourcesAddPolygon : public CmdSourcesAddRotatedBase
00146 {
00147 public:
00148         CmdSourcesAddPolygon(const std::string &cmdname);
00149         ~CmdSourcesAddPolygon();
00150         bool execute();
00151 private:
00152         shellp::ShellCmdStringArg *fnamearg;
00153         std::vector<shellp::ShellCmdArg *> pointargs;
00154         shellp::ShellCmdRealArg *xposarg,*yposarg;
00155 };
00156 
00157 class CmdSourcesDelete : public shellp::ShellCommand
00158 {
00159 public:
00160         CmdSourcesDelete(const std::string &cmdname);
00161         ~CmdSourcesDelete();
00162         bool execute();
00163 private:
00164         shellp::ShellCmdIntArg *srcnumarg;
00165 };
00166 
00167 class CmdSourcesClear : public shellp::ShellCommand
00168 {
00169 public:
00170         CmdSourcesClear(const std::string &cmdname);
00171         ~CmdSourcesClear();
00172         bool execute();
00173 };
00174 
00175 class CmdSourcesMove : public shellp::ShellCommand
00176 {
00177 public:
00178         CmdSourcesMove(const std::string &cmdname);
00179         ~CmdSourcesMove();
00180         bool execute();
00181 private:
00182         shellp::ShellCmdIntArg *srcnumarg;
00183         shellp::ShellCmdRealArg *xarg,*yarg;
00184         shellp::ShellCmdBoolArg *relarg;
00185 };
00186 
00187 class CmdSourcesRotate : public shellp::ShellCommand
00188 {
00189 public:
00190         CmdSourcesRotate(const std::string &cmdname);
00191         ~CmdSourcesRotate();
00192         bool execute();
00193 private:
00194         shellp::ShellCmdIntArg *srcnumarg;
00195         shellp::ShellCmdRealArg *anglearg;
00196         shellp::ShellCmdBoolArg *relarg;
00197 };
00198 
00199 class CmdSourcePlaneImagesData : public shellp::ShellCommand
00200 {
00201 public:
00202         CmdSourcePlaneImagesData(const std::string &cmdname);
00203         ~CmdSourcePlaneImagesData();
00204         bool execute();
00205 private:
00206         shellp::ShellCmdIntArg *numarg;
00207         shellp::ShellCmdIntArg *m_pImageNumberArg;
00208         shellp::ShellCmdBoolArg *m_pUseMagnifications;
00209 };
00210 
00211 class CmdSourcePlaneImagesDataPointSource : public shellp::ShellCommand
00212 {
00213 public:
00214         CmdSourcePlaneImagesDataPointSource(const std::string &cmdname);
00215         ~CmdSourcePlaneImagesDataPointSource();
00216         bool execute();
00217 private:
00218         shellp::ShellCmdIntArg *numarg;
00219         shellp::ShellCmdIntArg *m_pImageNumberArg;
00220         shellp::ShellCmdRealArg *m_pRadiusArg;
00221 };
00222 
00223 #endif // CMDSOURCES_H
00224