LSystem.h
Go to the documentation of this file.00001 /**<!--------------------------------------------------------------------> 00002 @class LSystem 00003 @author Travis Fischer (fisch0920@gmail.com) 00004 @date December 2006 00005 00006 @brief 00007 Models a Lindenmayer System, which may be used to simulate a varient of 00008 effects in Nature, such as plant growth and fractals. 00009 <!-------------------------------------------------------------------->**/ 00010 00011 #ifndef LSYSTEM_H_ 00012 #define LSYSTEM_H_ 00013 00014 #include <common/common.h> 00015 00016 class LSystem { 00017 00018 public: 00019 ///@name Constructors 00020 //@{----------------------------------------------------------------- 00021 00022 inline LSystem(const std::string &rules, const std::string &axiom) 00023 : m_rules(rules), m_axiom(axiom) 00024 { } 00025 00026 00027 //@}----------------------------------------------------------------- 00028 ///@name Main usage interface 00029 //@{----------------------------------------------------------------- 00030 00031 inline std::string process(unsigned maxDepth) { 00032 return _process(m_axiom, maxDepth); 00033 } 00034 00035 00036 //@}----------------------------------------------------------------- 00037 protected: 00038 std::string _process(const std::string &state, unsigned depth); 00039 virtual std::string _processRule(char c) = 0; 00040 00041 protected: 00042 std::string m_rules; 00043 std::string m_axiom; 00044 }; 00045 00046 #endif // LSYSTEM_H_ 00047
Generated on 28 Feb 2009 for Milton by
1.5.6