HyperspaceExplorer 0.7.1
FunctionParameter.h
00001 /*
00002 Hyperspace Explorer - visualizing higher-dimensional geometry
00003 Copyright (C) 2008-2010  Lene Preuss <lene.preuss@gmail.com>
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License along
00016 with this program; if not, write to the Free Software Foundation, Inc.,
00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 
00019 */
00020 
00021 #ifndef FUNCTION_PARAMETER_H
00022 #define FUNCTION_PARAMETER_H
00023 
00024 #include "FunctionParameterValue.h"
00025 
00026 #include <string>
00027 #include <memory>
00028 
00030 
00049 class FunctionParameter {
00050 
00051     public:
00052 
00054         typedef std::shared_ptr< FunctionParameterValueBase > value_ptr_type;
00056         typedef std::shared_ptr< FunctionParameter > parameter_ptr_type;
00057 
00059         FunctionParameter(const std::string &name, const std::string &description = "");
00060 
00062         double toDouble() const;
00064         unsigned toUnsigned() const;
00066         int toInt() const;
00068         std::string toString() const;
00069 
00071         VecMath::Rotation<5> toRotation5() const;
00073         VecMath::Rotation<6> toRotation6() const;
00075         VecMath::Rotation<7> toRotation7() const;
00077         VecMath::Rotation<8> toRotation8() const;
00079         VecMath::Rotation<9> toRotation9() const;
00081         VecMath::Rotation<10> toRotation10() const;
00082 
00084         const std::string &getName() const;
00085 
00087         void setName(const std::string &name);
00088 
00090         const std::string &getDescription() const;
00091 
00093         void setDescription(const std::string &description);
00094 
00096         void setValue(FunctionParameter::value_ptr_type value);
00097 
00099         void setValue(const std::string &newValue);
00100 
00102         void setDefaultValue(FunctionParameter::value_ptr_type defaultValue);
00103 
00105         FunctionParameter::value_ptr_type value() const;
00106 
00108         FunctionParameter::value_ptr_type defaultValue() const;
00109 
00110     private:
00111 
00113         std::string _name;
00114 
00116         std::string _description;
00117 
00119         FunctionParameter::value_ptr_type _value;
00120 
00122         FunctionParameter::value_ptr_type _defaultValue;
00123 };
00124 
00125 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:14 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo