vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lsystem.h
Go to the documentation of this file.
1 #ifndef LSYSTEM_H_
2 #define LSYSTEM_H_
3 
4 #include "abstractlsystem.h"
5 #include "rule.h"
6 #include "longstring.h"
7 
8 using std::multimap;
9 using std::vector;
10 using std::string;
11 
12 namespace AP_LSystem {
13 class LSystem : public AbstractLSystem
14 {
15 protected:
17  multimap<char, Rule> m_Rules;
18  multimap<char, Rule> m_Homomorphisms;
19  vector<string> m_SubSystemsFilenames;
20  vector< LongString *> m_SubSystemsWords;
21  string m_Ignore;
22 
23  // Loading and parsing
24  virtual void setAxiom(std::string &);
25  virtual void addRule(std::string *);
26  virtual void addHomomorphism(std::string *);
27  virtual void processPredecessor( Rule &, string *, string::iterator & ) = 0;
28  virtual void processRuleSuccessor( Rule &, string *, string::iterator &) = 0;
29  virtual void processHomomorphismSuccessor( Rule &, string *, string::iterator &) = 0;
30 
31  // Generating
36  virtual bool nextIteration();
37 
44  virtual bool transcribe( multimap<char, Rule> & rules );
45 
57  virtual multimap<char, Rule>::iterator * selectRule(multimap<char, Rule>::iterator & begin,
58  multimap<char, Rule>::iterator & end,
59  LongString * word,
60  unsigned int & pos,
61  double * parameters);
62 
70  virtual void generateSuccessor( LongString * word, multimap<char, Rule>::iterator & rule, double * params);
71 public:
72 
77 
81  LSystem( const LSystem & );
82 
86  ~LSystem();
87 
91  LSystem & operator=( const LSystem & );
92 
97  virtual void loadFromFile( AbstractFile * file );
98 
99  unsigned int wordLength() { return m_Word->length(); }
100  virtual void transcribeSubSystems( );
101  virtual LongString * translate( );
102  virtual void processCutSymbol( );
103 };
104 }
105 #endif // LSYSTEM_H_