Public Member Functions

Turtle Class Reference

Turtle graphics interface (Logo code generator). More...

#include <Turtle.hpp>

Collaboration diagram for Turtle:
Collaboration graph
[legend]

Public Member Functions

 Turtle ()
 Turtle constructor.
string rewrite (const string prod, map< char, string > corresp, string scale, vector< string > iniPos, string iniAng) const
 Replace graphical instructions.

Detailed Description

Turtle graphics interface (Logo code generator).

Generates Logo code from the string produced by iteration by the L-system. The resulting code is outputted to the standard output, and can thus be redirected into a file, to then be inputted to a Logo interpreter such as ucblogo, which is available in common user GNU/Linux software repos.

Author:
Alexandre Trilla (atrilla)

Definition at line 57 of file Turtle.hpp.


Constructor & Destructor Documentation

Turtle::Turtle (  ) 

Turtle constructor.

Postcondition:
Builds the turtle graphics.

Member Function Documentation

string Turtle::rewrite ( const string  prod,
map< char, string >  corresp,
string  scale,
vector< string >  iniPos,
string  iniAng 
) const

Replace graphical instructions.

Parameters:
L-system production by iteration.
corresp The correspondence between symbols and drawing instructions.
scale Scale of the drawing.
iniPos The initial position.
iniAng The initial angle.
Precondition:
L-system must deliver production and parser must deliver the correspondence.
Postcondition:
Generates the instructions to draw.

The documentation for this class was generated from the following file: