repositories
/
lsystem3d.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ed62b5
)
* Adaptation to new classes Rule, RuleSet.
author
spixx
<spixx>
Sat, 11 Nov 2006 12:02:33 +0000
(12:02 +0000)
committer
spixx
<spixx>
Sat, 11 Nov 2006 12:02:33 +0000
(12:02 +0000)
src/lindenmayersystem.h
patch
|
blob
|
blame
|
history
diff --git
a/src/lindenmayersystem.h
b/src/lindenmayersystem.h
index d71fde6b6530225b9fb471a26a40768ffbe400ad..b937e72a95e819f3685eb870b2011a142c94f9e7 100644
(file)
--- a/
src/lindenmayersystem.h
+++ b/
src/lindenmayersystem.h
@@
-1,6
+1,6
@@
// Copyright (C) 2006 Erik Dahlberg
//
// Copyright (C) 2006 Erik Dahlberg
//
-// This file is part of LSystem3
d
.
+// This file is part of LSystem3
D
.
//
// LSystem3D is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
//
// LSystem3D is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@
-22,11
+22,14
@@
#ifndef LINDENMAYERSYSTEM_H
#define LINDENMAYERSYSTEM_H
#ifndef LINDENMAYERSYSTEM_H
#define LINDENMAYERSYSTEM_H
-#include <map>
#include <string>
#include "model.h"
#include "turtle.h"
#include <string>
#include "model.h"
#include "turtle.h"
+#include "rule.h"
+#include "ruleset.h"
+
+using namespace std;
@@
-62,14
+65,13
@@
public:
* Set the initial rule (the axiom)
* @param axiom the axiom
*/
* Set the initial rule (the axiom)
* @param axiom the axiom
*/
- void setAxiom(
string
axiom);
+ void setAxiom(
Rule
axiom);
/**
* Set one rule
/**
* Set one rule
- * @param name rule name
* @param rule the rule
*/
* @param rule the rule
*/
- void setRule(
string name, string
rule);
+ void setRule(
Rule
rule);
/**
* Set the turn/pitch/roll angle
/**
* Set the turn/pitch/roll angle
@@
-78,10
+80,10
@@
public:
void setAngle(double degrees);
/**
void setAngle(double degrees);
/**
- * Set
the number of iterations
- * @param
numIterations number of iterations
+ * Set
depth of recursion
+ * @param
depth depth of recursion
*/
*/
- void set
NumIterations(int numIterations
);
+ void set
Depth(int depth
);
/**
* Set diameter of segment
/**
* Set diameter of segment
@@
-99,13
+101,13
@@
public:
* Get the initial rule (the axiom)
* @return the axiom
*/
* Get the initial rule (the axiom)
* @return the axiom
*/
-
string
getAxiom();
+
Rule
getAxiom();
/**
* Get all rules
* @return the rules
*/
/**
* Get all rules
* @return the rules
*/
-
map<string,string>
getRules();
+
RuleSet
getRules();
/**
* Get the turn/pitch/roll angle
/**
* Get the turn/pitch/roll angle
@@
-114,10
+116,10
@@
public:
double getAngle();
/**
double getAngle();
/**
- * Get
the number of iterations
- * @return
number of iterations
+ * Get
depth of recursion
+ * @return
depth of recursion
*/
*/
- int get
NumIterations
();
+ int get
Depth
();
/**
* Get the generated model
/**
* Get the generated model
@@
-134,24
+136,10
@@
protected:
*/
void recursiveWalk(string rule, int level);
*/
void recursiveWalk(string rule, int level);
- /**
- * Verify and preprocess one rule string
- * @param rule the rule
- * @return the preprocessed rule
- */
- string verifyAndPreprocessRule(string rule);
-
- /**
- * Unpreprocess one rule string
- * @param rule the rule
- * @return the unpreprocessed rule
- */
- string unpreprocessRule(string rule);
-
// Parameters
// Parameters
-
string
_axiom;
- map<string,string> _rules; // TODO: use unsorted container?
- int _
numIterations
;
+
Rule
_axiom;
+ RuleSet _rules;
+ int _
depth
;
Model *_model; // The active model
Turtle *_turtle; // The rendering turtle
Model *_model; // The active model
Turtle *_turtle; // The rendering turtle