LibCapy - turtlegraphic

TurtleGraphic class.

Macros:

Enumerations:

None.

Typedefs:

None.

Struct CapyTurtleGraphicState :

Struct CapyTurtleGraphicState's properties:

Step vector

Position

Struct CapyTurtleGraphicState's methods:

Destructor

Struct CapyTurtleGraphic :

Struct CapyTurtleGraphic's properties:

Current state (initially, stepLength=1, theta=0);

List of stacked states

Image on which the turle draws (default: null)

Color of the line (default: white)

Struct CapyTurtleGraphic's methods:

Destructor

Forward command

Input argument(s):

step: the turtle moves forward 'step' steps while drawing a line

Move command

Input argument(s):

step: the turtle moves forward 'step' steps without drawing a line

Turn command

Input argument(s):

theta: 'theta' is added to the turtle direction

Resize command

Input argument(s):

scale: the turle step distance is multiplied by 'scale'

Push command

Output and side effect(s):

The current state is added on the top of the stack

Pop command

Output and side effect(s):

The state on the top of the stack is removed and becomes the current state.

Functions:

Create a CapyTurtleGraphic

Output and side effect(s):

Return a CapyTurtleGraphic

Allocate memory for a new CapyTurtleGraphic and create it

Output and side effect(s):

Return a CapyTurtleGraphic

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyTurtleGraphic* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyTurtleGraphic to free

2024-03-20
in LibCapy,
15 views
Copyright 2021-2024 Baillehache Pascal