repositories
/
lsystem3d.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[lsystem3d.git]
/
src
/
lindenmayersystem.h
diff --git
a/src/lindenmayersystem.h
b/src/lindenmayersystem.h
index efadab9a31aa785c94ae1350faec03008159feec..d71fde6b6530225b9fb471a26a40768ffbe400ad 100644
(file)
--- a/
src/lindenmayersystem.h
+++ b/
src/lindenmayersystem.h
@@
-28,8
+28,6
@@
#include "model.h"
#include "turtle.h"
#include "model.h"
#include "turtle.h"
-using namespace std;
-
/**
/**
@@
-38,9
+36,10
@@
using namespace std;
class LindenmayerSystem
{
public:
class LindenmayerSystem
{
public:
+
/**
* Constructor
/**
* Constructor
- * @param model
the model for generation
+ * @param model
empty model
*/
LindenmayerSystem(Model *model);
*/
LindenmayerSystem(Model *model);
@@
-49,6
+48,16
@@
public:
*/
~LindenmayerSystem();
*/
~LindenmayerSystem();
+ /**
+ * Clear all parameters
+ */
+ void clear();
+
+ /**
+ * Generate L-system data
+ */
+ void generate();
+
/**
* Set the initial rule (the axiom)
* @param axiom the axiom
/**
* Set the initial rule (the axiom)
* @param axiom the axiom
@@
-74,6
+83,18
@@
public:
*/
void setNumIterations(int numIterations);
*/
void setNumIterations(int numIterations);
+ /**
+ * Set diameter of segment
+ * @param diameter the diameter
+ */
+ void setDiameter(double diameter);
+
+ /**
+ * Set diameter factor
+ * @param diameterFactor the diameter factor
+ */
+ void setDiameterFactor(double diameterFactor);
+
/**
* Get the initial rule (the axiom)
* @return the axiom
/**
* Get the initial rule (the axiom)
* @return the axiom
@@
-99,39
+120,40
@@
public:
int getNumIterations();
/**
int getNumIterations();
/**
- * Generate l-system data
+ * Get the generated model
+ * @return generated model
*/
*/
-
void generate
();
+
Model *getModel
();
protected:
/**
protected:
/**
- *
Walk through the rule string for specified number of level
s
- * @param rule
the
rule
- * @param level
current iterat
ion level
+ *
Recursively apply the replacement rule
s
+ * @param rule rule
+ * @param level
recurs
ion level
*/
void recursiveWalk(string rule, int level);
/**
* Verify and preprocess one rule string
*/
void recursiveWalk(string rule, int level);
/**
* Verify and preprocess one rule string
- * @param rule
OrAxiom
the rule
+ * @param rule the rule
* @return the preprocessed rule
*/
* @return the preprocessed rule
*/
- string verifyAndPreprocessRule(string rule
OrAxiom
);
+ string verifyAndPreprocessRule(string rule);
/**
* Unpreprocess one rule string
/**
* Unpreprocess one rule string
- * @param rule
OrAxiom
the rule
+ * @param rule the rule
* @return the unpreprocessed rule
*/
* @return the unpreprocessed rule
*/
- string unpreprocessRule(string rule
OrAxiom
);
+ string unpreprocessRule(string rule);
// Parameters
string _axiom;
// Parameters
string _axiom;
- map<string,string> _rules;
// TODO: use unsorted container?
+ map<string,string> _rules; // TODO: use unsorted container?
int _numIterations;
int _numIterations;
- Model *_model; // The
model for generation
+ Model *_model; // The
active model
Turtle *_turtle; // The rendering turtle
};
Turtle *_turtle; // The rendering turtle
};