Class Documentation

Name:Forest
Version:1.0
ID:ID_FOREST
Status:Stable
Category:Effect
Date:July 2001
Author:Rocklyte Systems, Pascal Pensa, Guillaume Ramey
Copyright:  Guillaume Ramey, Pascal Pensa (c) 1995, Rocklyte Systems (c) 2000-2001.
Short:  Draws multiple tree-like fractals.



Description

The Forest class is a fractal generator that draws multiple tree-like structures to generate a colourful forest. The formula was converted from the X screensaver distribution, so you may have seen this effect in use before.

Once initialised, the fractal generator will run automatically until it is freed from the system. The trees are drawn in a single burst, then there is a gap of approximately 10 seconds before the graphics are cleared and the generator starts drawing again from scratch. A number of options are available for manipulating the way in which the fractals are generated. Details on the settings are documented for each individual field, so refer to them if you require more information.

Structure

The Forest object consists of the following public fields:

Conformity  Defines the level of conformity used to generate each tree.
IterationLevel  Determines the amount of branches generated for each tree.
MaxAngle  Defines the maximum possible angle in each branch' differential.
MaxElements  The total number of trees drawn by the generator is defined by this field.
MaxHeight  The maximum height allowed for each tree.
MinAngle  Defines the minimum possible angle in each branch' differential.
MinHeight  The minimum height allowed for each tree.
Field:Conformity
Short:Defines the level of conformity used to generate each tree.
Type:LONG
Status:Read/Write

Changing this field allows you to alter the conformity of the generated trees. Low values will generate many trees that conform to a similar shape, while high values will generate more variants. The field cannot be set to a value greater than 30.


Field:IterationLevel
Short:Determines the amount of branches generated for each tree.
Type:LONG
Status:Read/Write

The iteration level defines how many 'branches' each tree will have. The higher the value, the more the fractals will look like genuine trees. The minimum value is 0 and the maximum value is 5. Note that the processor time required to draw each tree will increase when more branches need to be drawn.


Field:MaxAngle
Short:Defines the maximum possible angle in each branch' differential.
Type:LONG
Status:Read/Write

Manipulating the MinAngle and MaxAngle fields allows you to control the breadth of the trees. Setting low MinAngle and MaxAngle values will create thin-looking trees, higher values will create broader looking trees.

The MaxAngle field cannot be set to a number greater than 50 and the MinAngle cannot be set to a value less than three.


Field:MaxElements
Short:The total number of trees drawn by the generator is defined by this field.
Type:LONG
Status:Read/Init

You may specify the exact amount of trees to be drawn by the fractal generator by setting the MaxElements field. It is recommended that you use a setting between 50 and 100 for a reasonable effect.


Field:MaxHeight
Short:The maximum height allowed for each tree.
Type:LONG
Status:Read/Write

The maximum height of each tree is defined in this field. The height is calculated proportionatly from this value, so the setting is not pixel relative. The maximum possible height is 100, and the value cannot be less than that of the MinHeight field.


Field:MinAngle
Short:Defines the minimum possible angle in each branch' differential.
Type:LONG
Status:Read/Write

Manipulating the MinAngle and MaxAngle fields allows you to control the breadth of the trees. Setting low MinAngle and MaxAngle values will create thin-looking trees, higher values will create broader looking trees.

The MaxAngle field cannot be set to a number greater than 50 and the MinAngle cannot be set to a value less than three.


Field:MinHeight
Short:The minimum height allowed for each tree.
Type:LONG
Status:Read/Write

The minimum height of each tree is defined in this field. The height is calculated proportionatly from this value, so the setting is not pixel relative. The minimum possible height is 3, and the value cannot be greater than that of the MaxHeight field.