#include <mturtle.h>
Inheritance diagram for Turtle:
Public Methods | |
Turtle (TurtleDevice &dev, double step, double drot) | |
void | drawLSystem (const String &lstring) |
void | forward () |
virtual OStream & | operator>> (OStream &out) const |
Definition at line 120 of file mturtle.h.
|
Standard constructor.
Definition at line 128 of file mturtle.h. References TurtleState::jumpTo(), and TurtleState::mRot. |
|
Draws the given L-System description string produced by LGrammar. Standard commands for L-Systems are accepted: F = forward one 'step' length (see the constructor), pen down. f = forward one 'step' length (see the constructor), pen up. + = turn right by the 'drot' amount given in constructor.
] = pop the topmost location from the stack. Definition at line 64 of file mturtle.cc. References TurtleState::copy(), TurtleDevice::end(), forward(), String::length(), TurtleState::mCoord, Array::size(), TurtleDevice::start(), TurtleDevice::tip(), and TurtleState::turnBy(). |
|
Moves the turle forward one 'step' length (see the constructor).
Definition at line 57 of file mturtle.cc. References TurtleDevice::forwardLine(), TurtleState::jumpTo(), TurtleState::mCoord, TurtleState::mRot, Coord2D::x, and Coord2D::y. Referenced by drawLSystem(). |
|
Implementation for Object. Dumps the object description to the given stream. Definition at line 109 of file mturtle.cc. References TurtleState::mCoord, TurtleState::mRot, OStream::printf(), Coord2D::x, and Coord2D::y. |