GRALESHELL

cmdunits.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 CMDUNITS_H
00027 
00028 #define CMDUNITS_H
00029 
00030 #include <shellp/shellcommand.h>
00031 #include <shellp/shellcmdrealarg.h>
00032 
00033 namespace shellp
00034 {
00035         class ShellCmdStringArg;
00036         class ShellCmdRealArg;
00037 }
00038 
00039 class CmdUnitMassShow : public shellp::ShellCommand
00040 {
00041 public:
00042         CmdUnitMassShow(const std::string &cmdname);
00043         ~CmdUnitMassShow();
00044         bool execute();
00045 };
00046 
00047 class CmdUnitAngularShow : public shellp::ShellCommand
00048 {
00049 public:
00050         CmdUnitAngularShow(const std::string &cmdname);
00051         ~CmdUnitAngularShow();
00052         bool execute();
00053 };
00054 
00055 class CmdUnitDistanceShow : public shellp::ShellCommand
00056 {
00057 public:
00058         CmdUnitDistanceShow(const std::string &cmdname);
00059         ~CmdUnitDistanceShow();
00060         bool execute();
00061 };
00062 
00063 class CmdUnitSet : public shellp::ShellCommand
00064 {
00065 protected:
00066         CmdUnitSet(const std::string &cmdname);
00067 public:
00068         ~CmdUnitSet();
00069 protected:
00070         double GetMultiplier() const                                                    { return multarg->getValue(); }
00071 private:
00072         shellp::ShellCmdRealArg *multarg;       
00073 };
00074 
00075 class CmdUnitMassSet : public CmdUnitSet
00076 {
00077 public:
00078         CmdUnitMassSet(const std::string &cmdname);
00079         ~CmdUnitMassSet();
00080         bool execute();
00081 private:
00082         shellp::ShellCmdStringArg *basearg;
00083 };
00084 
00085 class CmdUnitAngularSet : public CmdUnitSet
00086 {
00087 public:
00088         CmdUnitAngularSet(const std::string &cmdname);
00089         ~CmdUnitAngularSet();
00090         bool execute();
00091 private:
00092         shellp::ShellCmdStringArg *basearg;
00093 };
00094 
00095 class CmdUnitDistanceSet : public CmdUnitSet
00096 {
00097 public:
00098         CmdUnitDistanceSet(const std::string &cmdname);
00099         ~CmdUnitDistanceSet();
00100         bool execute();
00101 private:
00102         shellp::ShellCmdStringArg *basearg;
00103 };
00104 
00105 #endif // CMDUNITS_H
00106