1 // Copyright (C) 2006 Erik Dahlberg
3 // This file is part of LSystem3D.
5 // LSystem3D is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // LSystem3D is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with LSystem3D; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef LINDENMAYERSYSTEM_H
23 #define LINDENMAYERSYSTEM_H
39 class LindenmayerSystem
45 * @param model empty model
47 LindenmayerSystem(Model
*model
);
55 * Clear all parameters
60 * Generate L-system data
65 * Set the initial rule (the axiom)
66 * @param axiom the axiom
68 void setAxiom(Rule axiom
);
72 * @param rule the rule
74 void setRule(Rule rule
);
77 * Set the turn/pitch/roll angle
78 * @param degrees the angle, in degrees
80 void setAngle(double degrees
);
83 * Set depth of recursion
84 * @param depth depth of recursion
86 void setDepth(int depth
);
89 * Set diameter of segment
90 * @param diameter the diameter
92 void setDiameter(double diameter
);
96 * @param diameterFactor the diameter factor
98 void setDiameterFactor(double diameterFactor
);
101 * Get the initial rule (the axiom)
113 * Get the turn/pitch/roll angle
114 * @return the angle, in degrees
119 * Get depth of recursion
120 * @return depth of recursion
125 * Get the generated model
126 * @return generated model
133 * Recursively apply the replacement rules
135 * @param level recursion level
137 void recursiveWalk(string rule
, int level
);
144 Model
*_model
; // The active model
145 Turtle
*_turtle
; // The rendering turtle