Torus2 Class Reference

A simple torus. More...

#include <Torus.h>

Inheritance diagram for Torus2:

VertexArrayObject RawObject List of all members.

Public Member Functions

 Torus2 (double radius_t, double radius_p, int n_sides, int n_rings)
 ~Torus2 ()
double GetBoundingRadius ()
BoundingBox GetBoundingBox ()
void SetTexture (GLuint texture_id)

Private Member Functions

 Torus2 ()
void Construct ()

Private Attributes

double r_t
double r_p
int n_sides
int n_rings
float * data
GLuint * indices

Detailed Description

A simple torus.

A textured torus using vertex arrays.

Definition at line 72 of file Torus.h.


Constructor & Destructor Documentation

Torus2::Torus2 double  radius_t,
double  radius_p,
int  n_sides,
int  n_rings
 

Constuctor: Brings the object into a consistent state.

Parameters:
radius_t Distance from the center of the torus to the center of a ring.
radius_p The radius of one single ring.
n_sides Number of sides per ring.
n_rings Number of rings that make up the torus.

Definition at line 64 of file Torus.cpp.

Torus2::~Torus2  ) 
 

Destructor.

Definition at line 77 of file Torus.cpp.

Torus2::Torus2  )  [private]
 

Hide the default constructor.


Member Function Documentation

void Torus2::Construct  )  [private]
 

Constructs the data for the torus (vertex data, index data and normals).

Definition at line 106 of file Torus.cpp.

BoundingBox Torus2::GetBoundingBox  )  [virtual]
 

Implementation of the GetBoundingBox routine.

Reimplemented from VertexArrayObject.

Definition at line 92 of file Torus.cpp.

double Torus2::GetBoundingRadius  )  [virtual]
 

Implementation of the GetBoundingRadius routine.

Reimplemented from VertexArrayObject.

Definition at line 87 of file Torus.cpp.

void Torus2::SetTexture GLuint  texture_id  ) 
 

Associates a texture with this torus.

Definition at line 82 of file Torus.cpp.


Member Data Documentation

float* Torus2::data [private]
 

Internal pointer to the vertex data.

Definition at line 128 of file Torus.h.

GLuint* Torus2::indices [private]
 

Internal pointer to the index data.

Definition at line 131 of file Torus.h.

int Torus2::n_rings [private]
 

Internally stores the number of rings that make up the torus.

Definition at line 125 of file Torus.h.

int Torus2::n_sides [private]
 

Internally stores the number of sides per ring.

Definition at line 122 of file Torus.h.

double Torus2::r_p [private]
 

Internally stores the p parameter of the torus.

Definition at line 119 of file Torus.h.

double Torus2::r_t [private]
 

Internally stores the t parameter of the torus.

Definition at line 116 of file Torus.h.


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