TorusGenerator Class Reference

Provides the means to generate the coordinates of points on a torus. More...

#include <TorusGenerator.h>

List of all members.

Static Public Member Functions

static GraphicalObjectCreateTorus (RawObject *raw_object, double r_t, double r_p, int rings, int slices)
static GraphicalObjectCreateTorus (DLODObject *dlod_object, double r_t, double r_p, int rings, int slices)
static bool HasMore ()
static void StartTorus (double r_t, double r_p, int rings, int slices)
static Point GetNextPoint ()

Static Private Member Functions

static GraphicalObjectCreateRings (RawObject *raw_object, double r_t, double r_p, double min_t, double max_t, int rings, int slices)
static GraphicalObjectCreateRingPart (RawObject *raw_object, double r_t, double r_p, double curr_t, double min_p, double max_p, int slices)
static GraphicalObjectCreateRings (DLODObject *dlod_object, double r_t, double r_p, double min_t, double max_t, int rings, int slices)
static GraphicalObjectCreateRingPart (DLODObject *dlod_object, double r_t, double r_p, double curr_t, double min_p, double max_p, int slices)

Static Private Attributes

static int ring_index = 0
static int slice_index = 0
static double r_t = 0.0
static double r_p = 0.0
static int rings = 0
static int slices = 0


Detailed Description

Provides the means to generate the coordinates of points on a torus.

Class that provides three different ways of creating a torus. The first two build it recursively and group the objects created during the process together. While the first method creates a TerminalObjects at each end of the recursion and sets its position to a point located on the torus, the second method takes a DLODObject and clones it whenever the recursion ends. The third way of creating a torus is a set of static routines which just iteratively return points lying on a torus.

Definition at line 22 of file TorusGenerator.h.


Member Function Documentation

GraphicalObject * TorusGenerator::CreateRingPart RawObject raw_object,
double  r_t,
double  r_p,
double  curr_t,
double  min_p,
double  max_p,
int  slices
[static, private]
 

Creates a part of a ring of the torus using recursion.

Parameters:
raw_object The RawObject which shall be used at the end of the recursion to create a terminal object.
r_t The t parameter of the torus creation. This is the radius at which the rings of the torus are created.
r_p The p parameter of the torus creation. This is the radius of one single ring.
curr_t The current t value for this ring.
min_p The minimal p value of the part of the ring which shall be created.
max_p The maximal p value of the part of the ring which shall be created.
slices The number of points to be created during this routine.

Definition at line 34 of file TorusGenerator.cpp.

GraphicalObject * TorusGenerator::CreateRings DLODObject dlod_object,
double  r_t,
double  r_p,
double  min_t,
double  max_t,
int  rings,
int  slices
[static, private]
 

Creates a part of a torus using recursion. This routine is almost the same as the 'CreateRings (...)' routine above, with the only difference that a discrete level of detail object is cloned whenever the recursion ends.

Parameters:
dlod_object The discrete level of detail object which shall be cloned whenever the recursion ends.
r_t The t parameter of the torus creation. This is the radius at which the rings of the torus are created.
r_p The p parameter of the torus creation. This is the radius of one single ring.
min_t The minimal t value of the part of the torus which shall be created.
max_t The maximal t value of the part of the torus which shall be created.
rings The number of rings that shall be created.
slices The number of points on each created.

Definition at line 75 of file TorusGenerator.cpp.

GraphicalObject * TorusGenerator::CreateRings RawObject raw_object,
double  r_t,
double  r_p,
double  min_t,
double  max_t,
int  rings,
int  slices
[static, private]
 

Creates a part of a torus using recursion.

Parameters:
raw_object The RawObject which shall be used at the end of the recursion to create a terminal object.
r_t The t parameter of the torus creation. This is the radius at which the rings of the torus are created.
r_p The p parameter of the torus creation. This is the radius of one single ring.
min_t The minimal t value of the part of the torus which shall be created.
max_t The maximal t value of the part of the torus which shall be created.
rings The number of rings that shall be created.
slices The number of points on each created ring.

Definition at line 8 of file TorusGenerator.cpp.

GraphicalObject * TorusGenerator::CreateTorus DLODObject dlod_object,
double  r_t,
double  r_p,
int  rings,
int  slices
[static]
 

Similar to 'CreateTorus (...)' above, with the only difference that a discrete level of detail object is cloned whenever the recursion ends.

Parameters:
dlod_object The discrete level of detail object which shall be cloned whenever the recursion ends.
r_t The t parameter of the torus creation. This is the radius at which the rings of the torus are created.
r_p The p parameter of the torus creation. This is the radius of one single ring.
rings The number of rings that shall be created.
slices The number of points on each created ring.

Definition at line 70 of file TorusGenerator.cpp.

GraphicalObject * TorusGenerator::CreateTorus RawObject raw_object,
double  r_t,
double  r_p,
int  rings,
int  slices
[static]
 

Creates a torus of objects by recursively calling other routines. During the recursion, two objects are grouped together, while at the end of the recursion, a new terminal object with a specific appearance is created.

Parameters:
raw_object The RawObject which shall be used at the end of the recursion to create a terminal object.
r_t The t parameter of the torus creation. This is the radius at which the rings of the torus are created.
r_p The p parameter of the torus creation. This is the radius of one single ring.
rings The number of rings that shall be created.
slices The number of points on each created ring.

Definition at line 3 of file TorusGenerator.cpp.

Point TorusGenerator::GetNextPoint  )  [static]
 

Returns the next point of the torus creation.

Returns:
The next point of the torus creation.

Definition at line 161 of file TorusGenerator.cpp.

bool TorusGenerator::HasMore  )  [static]
 

States if there is a valid next point that can be calculated with the routine 'GetNextPoint ()'.

Returns:
true if there are still points on the torus to be created, false otherwise.

Definition at line 136 of file TorusGenerator.cpp.

void TorusGenerator::StartTorus double  r_t,
double  r_p,
int  rings,
int  slices
[static]
 

Starts a new torus.

Parameters:
r_t The t parameter of the torus creation. This is the radius at which the rings of the torus are created.
r_p The p parameter of the torus creation. This is the radius of one single ring.
rings The number of rings that shall be created.
slices The number of points on each created ring.

Definition at line 144 of file TorusGenerator.cpp.


Member Data Documentation

double TorusGenerator::r_p = 0.0 [static, private]
 

static member to store the current state.

Definition at line 91 of file TorusGenerator.h.

double TorusGenerator::r_t = 0.0 [static, private]
 

static member to store the current state.

Definition at line 89 of file TorusGenerator.h.

int TorusGenerator::ring_index = 0 [static, private]
 

static member to store the current state.

Definition at line 85 of file TorusGenerator.h.

int TorusGenerator::rings = 0 [static, private]
 

static member to store the current state.

Definition at line 93 of file TorusGenerator.h.

int TorusGenerator::slice_index = 0 [static, private]
 

static member to store the current state.

Definition at line 87 of file TorusGenerator.h.

int TorusGenerator::slices = 0 [static, private]
 

static member to store the current state.

Definition at line 95 of file TorusGenerator.h.


Generated on Sun Jul 2 13:20:41 2006 for Demo by  doxygen 1.4.6-NO