00001 /* 00002 toxic - A Global Illumination Renderer 00003 Copyright (C) 2003-2004 Francois Beaune 00004 Contact: http://toxicengine.sourceforge.net/ 00005 00006 This file is part of toxic. 00007 00008 toxic is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 toxic is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with toxic; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 #ifndef TOXIC_DRIVER_CLPARSER_H 00024 #define TOXIC_DRIVER_CLPARSER_H 00025 00026 #include "common/misc/commandlineparser.h" 00027 #include "renderer/globals.h" 00028 00029 #include <string> 00030 00031 namespace toxic { 00032 00033 class DriverSettings; 00034 00035 class CLParser : public sheep::CommandLineParser<CLParser> { 00036 public: 00037 //! The constructor binds the class to an instance of the DriverSettings class. 00038 //! Ownership of the DriverSettings instance remains to the caller. 00039 CLParser(DriverSettings *driver_settings); 00040 00041 //! Parses the command line. Stops program execution on failure. 00042 void Parse(int argc, char **argv); 00043 00044 private: 00045 DriverSettings *m_driver_settings; //!< The DriverSettings class to which the class is binded. 00046 std::string m_progname; //!< m_progname = argv[0]. 00047 00048 void print_usage() const; 00049 00050 void filename_handler(const std::string &filename); 00051 00052 void opt_output(const std::string &filename); 00053 void opt_width(int width); 00054 void opt_height(int height); 00055 void opt_save_gpm(const std::string &filename); 00056 void opt_load_gpm(const std::string &filename); 00057 void opt_save_cpm(const std::string &filename); 00058 void opt_load_cpm(const std::string &filename); 00059 void opt_driver_settings(const std::string &filename); 00060 void opt_scene_settings(const std::string &filename); 00061 void opt_skip_render(); 00062 void opt_help(); 00063 }; 00064 00065 } 00066 00067 #endif // !TOXIC_DRIVER_CLPARSER_H
1.3.6