X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fturtle.h;h=d28f75fe35024214c1663788ddd05533207159ec;hb=HEAD;hp=d56c09a371acd848cd19990bcb3ae8204d3f5ef6;hpb=15c82487a77555b040f3f4e03bc11da8b9bc5905;p=lsystem3d.git diff --git a/src/turtle.h b/src/turtle.h index d56c09a..d28f75f 100644 --- a/src/turtle.h +++ b/src/turtle.h @@ -1,6 +1,6 @@ // Copyright (C) 2006 Erik Dahlberg // -// This file is part of LSystem3d. +// This file is part of LSystem3D. // // LSystem3D is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -33,14 +33,15 @@ using namespace std; /** - * The model renderer + * The model creator */ class Turtle { public: + /** * Constructor - * @param model render this model + * @param model create this model */ Turtle(Model *model); @@ -49,6 +50,12 @@ public: */ ~Turtle(); + + /** + * Reset to default state + */ + void reset(); + /** * Turn left */ @@ -89,6 +96,11 @@ public: */ void walk(); + /** + * Walk forward, creating a filled surface + */ + void fillWalk(); + /** * Save current state to stack */ @@ -99,25 +111,6 @@ public: */ void pop(); - /** - * Reset to default state - */ - void reset(); - - /** - * Decrement diameter of segment - */ - void decrementDiameter(); - - /** - * Begin creation of a filled surface - */ - void fenceInBegin(); - - /** - * End creation of a filled surface - */ - void fenceInEnd(); /** * Set turn/pitch/roll angle @@ -125,6 +118,7 @@ public: */ void setAngle(double radians); + /** * Get turn/pitch/roll angle * @return the angle, in radians @@ -133,23 +127,22 @@ public: protected: - Coordinate _position; // current position + Coordinate _position; // Current position - Vector _heading; // forward pointing vector - Vector _left; // left pointing vector - Vector _up; // up pointing vector + Vector _heading; // Forward pointing vector + Vector _left; // Left pointing vector + Vector _up; // Up pointing vector - double _angle; // turn/pitch/roll angle - double _diameter; // diameter of segment - bool _fenceMode; // create filled surface? + double _angle; // Turn/pitch/roll angle, in radians - stack _positionStack; // positions in stack - stack _headingStack; // heading vectors in stack - stack _leftStack; // left vectors in stack - stack _upStack; // up vectors in stack - stack _diameterStack; // diameters in stack + stack _positionStack; // Positions in stack + stack _headingStack; // Heading vectors in stack + stack _leftStack; // Left vectors in stack + stack _upStack; // Up vectors in stack + stack _diameterStack; // Diameters in stack + stack _colorIndexStack; // Colors indices in stack - Model *_model; // the rendered model + Model *_model; // The created model };