Fractal Class Reference

#include <Fractal.h>

List of all members.


Public Member Functions

 Fractal ()
 Public constructor.
virtual ~Fractal ()
 Virtual destructor.
common::ErrorCodeType Allocate (int width, int height)
 Allocates fractal.
common::ErrorCodeType Generate (int scale)
 Generates fractal.
common::ErrorCodeType GetData (int x, int y, int &rData) const
 Gets fractal data.

Private Member Functions

common::ErrorCodeType SetData (int x, int y, int data)
 Sets fractal data.
common::ErrorCodeType Pass (int xstep, int ystep, int step, int scale)
 Makes single fractal generation pass.

Private Attributes

unsigned char * m_pData
 Pointer to array of fractal data.
int m_Size
 Size of one side of the fractal data.

Detailed Description

Utility class for generating fractals.
Full Description
This class provides a mechanism for generating generic fractals.

Constructor & Destructor Documentation

Fractal (  ) 

Public constructor.

Full Description
This method creates a new instance of the class.
Returns:
New instance of the class.

~Fractal (  )  [virtual]

Virtual destructor.

Full Description
This method destroys an existing instance of the class.
Returns:
None.


Member Function Documentation

common::ErrorCodeType Allocate ( int  width,
int  height 
)

Allocates fractal.

Full Description
This method allocates a fractal of the given width and height. The actual size of the fractal is equal to the nearest power of two that will fit both the height and width.
Returns:
Success if successful.

Failure otherwise.

Parameters:
width  Width of fractal.
height  Height of fractal.

common::ErrorCodeType Generate ( int  scale  ) 

Generates fractal.

Full Description
This method generates a fractal using the given scaling factor. The scaling factor controls the "jaggedness" of the fractal. Lower scaling factors produce smoother fractals.
Returns:
Success if successful.

Failure otherwise.

Parameters:
scale  Scaling factor.

common::ErrorCodeType GetData ( int  x,
int  y,
int &  rData 
) const

Gets fractal data.

Full Description
This method gets data from a given location on the fractal.
Returns:
Success if successful.

Failure otherwise.

Parameters:
x  X coordinate.
y  Y coordinate.
rData  Fractal data.

common::ErrorCodeType SetData ( int  x,
int  y,
int  data 
) [private]

Sets fractal data.

Full Description
This method sets data at a given location on the fractal.
Returns:
Success if successful.

Failure otherwise.

Parameters:
x  X coordinate.
y  Y coordinate.
data  Fractal data.

common::ErrorCodeType Pass ( int  xstep,
int  ystep,
int  step,
int  scale 
) [private]

Makes single fractal generation pass.

Full Description
This method generates a single pass of the fractal. Passes are generated at increasingly fine resolutions until all points in the fractal have been set.
Returns:
Always returns ERROR_CODE_SUCCESS.
Parameters:
xstep  X step direction.
ystep  Y step direction.
step  Width of step.
scale  Scaling factor.


Member Data Documentation

unsigned char* m_pData [private]

Pointer to array of fractal data.

int m_Size [private]

Size of one side of the fractal data.


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