GRALESHELL

cmdimageplane.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 CMDIMAGEPLANE_H
00027 
00028 #define CMDIMAGEPLANE_H
00029 
00030 #include <shellp/shellcommand.h>
00031 #include <shellp/shellcmdrealarg.h>
00032 #include <shellp/shellcmdintarg.h>
00033 #include <shellp/shellcmdstringarg.h>
00034 #include <shellp/shellcmdboolarg.h>
00035 #include <grale/vector2d.h>
00036 
00037 namespace grale
00038 {
00039         class GravitationalLens;
00040 }
00041 
00042 namespace shellp
00043 {
00044         class IOSystem;
00045 }
00046 
00047 class CmdImagePlane : public shellp::ShellCommand
00048 {
00049 public:
00050         CmdImagePlane(const std::string &cmdname);
00051         ~CmdImagePlane();
00052 protected:
00053         double GetX1() const                                                            { return x1arg->getValue(); }
00054         double GetX2() const                                                            { return x2arg->getValue(); }
00055         double GetY1() const                                                            { return y1arg->getValue(); }
00056         double GetY2() const                                                            { return y2arg->getValue(); }
00057         int GetNumX() const                                                             { return numxarg->getValue(); }
00058         int GetNumY() const                                                             { return numyarg->getValue(); }
00059 protected:
00060         shellp::ShellCmdRealArg *x1arg,*y1arg,*x2arg,*y2arg;
00061         shellp::ShellCmdIntArg *numxarg,*numyarg;
00062 };
00063 
00064 class CmdImagePlaneLocal : public CmdImagePlane
00065 {
00066 public:
00067         CmdImagePlaneLocal(const std::string &cmdname);
00068         ~CmdImagePlaneLocal();
00069         bool execute();
00070 };
00071 
00072 class CmdImagePlaneRemote : public CmdImagePlane
00073 {
00074 public:
00075         CmdImagePlaneRemote(const std::string &cmdname);
00076         ~CmdImagePlaneRemote();
00077         bool execute();
00078 private:
00079         shellp::ShellCmdStringArg *ipstrarg;
00080         shellp::ShellCmdIntArg *portarg;
00081 };
00082 
00083 class CmdImagePlanePlotGnuplot : public shellp::ShellCommand
00084 {
00085 public:
00086         CmdImagePlanePlotGnuplot(const std::string &cmdname);
00087         ~CmdImagePlanePlotGnuplot();
00088         bool execute();
00089 private:
00090         shellp::ShellCmdStringArg *fnamearg;
00091         shellp::ShellCmdBoolArg *imgarg,*srcarg,*critarg,*caustarg;
00092         shellp::ShellCmdStringArg *xlabelarg,*ylabelarg;
00093         shellp::ShellCmdBoolArg *colorarg;
00094         shellp::ShellCmdIntArg *fntsizearg;
00095         shellp::ShellCmdBoolArg *gridarg;
00096         shellp::ShellCmdIntArg *m_pSubSample;
00097         shellp::ShellCmdBoolArg *m_pFlipXArg;
00098 };
00099 
00100 class CmdImagePlanePlotPNG : public shellp::ShellCommand
00101 {
00102 public:
00103         CmdImagePlanePlotPNG(const std::string &cmdname);
00104         ~CmdImagePlanePlotPNG();
00105         bool execute();
00106 private:
00107         shellp::ShellCmdStringArg *fnamearg;
00108         shellp::ShellCmdBoolArg *imgarg,*srcarg,*critarg,*caustarg;
00109         shellp::ShellCmdIntArg *m_pSubSample;
00110 };
00111 
00112 class CmdImagePlanePlotAscii : public shellp::ShellCommand
00113 {
00114 public:
00115         CmdImagePlanePlotAscii(const std::string &cmdname);
00116         ~CmdImagePlanePlotAscii();
00117         bool execute();
00118 private:
00119         shellp::ShellCmdStringArg *fnamearg;
00120         shellp::ShellCmdBoolArg *imgarg,*srcarg,*critarg,*caustarg;
00121         shellp::ShellCmdIntArg *m_pSubSample;
00122 };
00123 
00124 class CmdImagePlanePlotFITS : public shellp::ShellCommand
00125 {
00126 public:
00127         CmdImagePlanePlotFITS(const std::string &cmdname);
00128         ~CmdImagePlanePlotFITS();
00129         bool execute();
00130 private:
00131         shellp::ShellCmdStringArg *fnamearg;
00132         shellp::ShellCmdIntArg *m_pSubSample;
00133         shellp::ShellCmdBoolArg *m_pPlotImages;
00134 };
00135 
00136 class CmdImagePlanePlotMagnification : public shellp::ShellCommand
00137 {
00138 public:
00139         CmdImagePlanePlotMagnification(const std::string &cmdname);
00140         ~CmdImagePlanePlotMagnification();
00141         bool execute();
00142 private:
00143         shellp::ShellCmdStringArg *fnamearg;
00144 };
00145 
00146 class CmdImagePlaneLensPlane : public shellp::ShellCommand
00147 {
00148 public:
00149         CmdImagePlaneLensPlane(const std::string &cmdname);
00150         ~CmdImagePlaneLensPlane();
00151         bool execute();
00152 };
00153 
00154 class CmdImagePlaneTraceBase : public shellp::ShellCommand
00155 {
00156 public:
00157         CmdImagePlaneTraceBase(const std::string &cmdName);
00158         ~CmdImagePlaneTraceBase();
00159 protected:
00160         void ListPoint(shellp::IOSystem *pIOSys, grale::Vector2D<double> point);
00161         void ListPoint(shellp::IOSystem *pIOSys, grale::Vector2D<double> point, double magnification);
00162 };
00163 
00164 class CmdImagePlaneTraceBeta : public CmdImagePlaneTraceBase
00165 {
00166 public:
00167         CmdImagePlaneTraceBeta(const std::string &cmdName);
00168         ~CmdImagePlaneTraceBeta();
00169         bool execute();
00170 private:
00171         shellp::ShellCmdRealArg *m_pXArg;
00172         shellp::ShellCmdRealArg *m_pYArg;
00173         shellp::ShellCmdIntArg *m_pNumIterationsArg;
00174         shellp::ShellCmdBoolArg *m_pMagnificationArg;
00175 };
00176 
00177 class CmdImagePlaneTraceTheta : public CmdImagePlaneTraceBase
00178 {
00179 public:
00180         CmdImagePlaneTraceTheta(const std::string &cmdName);
00181         ~CmdImagePlaneTraceTheta();
00182         bool execute();
00183 private:
00184         shellp::ShellCmdRealArg *m_pXArg;
00185         shellp::ShellCmdRealArg *m_pYArg;
00186 };
00187 
00188 class CmdImagePlaneTimeDelay : public shellp::ShellCommand
00189 {
00190 public:
00191         CmdImagePlaneTimeDelay(const std::string &cmdName);
00192         ~CmdImagePlaneTimeDelay();
00193         bool execute();
00194 private:
00195         void ListPoint(shellp::IOSystem *pIOSys, grale::Vector2D<double> point, double timeDelay);
00196 
00197         shellp::ShellCmdRealArg *m_pLensRedshiftArg;
00198         shellp::ShellCmdRealArg *m_pXArg;
00199         shellp::ShellCmdRealArg *m_pYArg;
00200         shellp::ShellCmdIntArg *m_pNumIterationsArg;
00201 };
00202 
00203 class CmdImagePlaneTraceImgData : public shellp::ShellCommand
00204 {
00205 public:
00206         CmdImagePlaneTraceImgData(const std::string &cmdName);
00207         ~CmdImagePlaneTraceImgData();
00208         bool execute();
00209 private:
00210         shellp::ShellCmdStringArg *m_pFileNameArg;
00211 };
00212 
00213 #endif // CMDIMAGEPLANE_H