vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rule.h
Go to the documentation of this file.
1 #ifndef RULE_H_
2 #define RULE_H_
3 
4 #include <vector>
5 #include "fparser/fparser.hh"
6 #include "staticstring.h"
7 
8 using std::string;
9 
10 namespace AP_LSystem {
14 struct Rule
15 {
17  FunctionParser* condition;
18  std::string variables;
19  FunctionParser * probabilityFactor;
20  std::vector<StaticString*> staticStrings;
21  std::vector<FunctionParser*> dynamicStrings;
22  string leftContext;
23  string rightContext;
24 
29 
33  Rule(const Rule &);
34 
38  Rule& operator=( const Rule & );
39 
43  ~Rule();
44 
50  void processProbabilityFactor(string * rule, string::iterator & it);
51 
57  void processCondition(string * rule, string::iterator & it);
58 
64  void processParameters(string * rule, string::iterator & it);
65 
73  bool addStaticString(string * rule, string::iterator & it);
74 
80  void addDynamicString(string * rule, string::iterator & it);
81 
87  bool evaluateCondition( double * p );
88 
89 private:
97  void addQueryFunctions( FunctionParser * expression, string & expressionString);
98 };
99 }
100 
101 #endif