Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

cylinder< T, S > Class Template Reference

A class to keep track of cylinders which are displayed using OpenGL. More...

#include <cylinder.h>

List of all members.

Public Member Functions

 cylinder (double x1, double y1, double z1, double size1, double x2, double y2, double z2, double size2, double size, int color)
 Constructor with locations, sizes and color.

 cylinder ()
 Default constructor.


Public Attributes

x1
 x coordinate for first sphere

y1
 y coordinate for first sphere

z1
 z coordinate for first sphere

x2
 x coordinate for second sphere

y2
 y coordinate for second sphere

z2
 z coordinate for second sphere

size1
 diameter of first sphere

size2
 diameter of second sphere

size
 diameter of the cylinder

byte color
 An index which specifies a color.


Detailed Description

template<class T, class S>
class cylinder< T, S >

A class to keep track of cylinders which are displayed using OpenGL.

This file defines a cylinder class designed to use as few bytes as possible. It is defined as a template class to allow customizing the type for x, y and z coordinates and the type for sizes. One instantiation uses short ints for coordinates and bytes for sizes. This version keeps track of the x, y, z, color and size of a cylinder in 16 bytes. Another version uses floats for coordinates and sizes. This version has 37 bytes of data which would make its size 40 on most systems.

Author:
Ray Seyfarth


Constructor & Destructor Documentation

template<class T, class S>
cylinder< T, S >::cylinder< T, S > double  x1,
double  y1,
double  z1,
double  size1,
double  x2,
double  y2,
double  z2,
double  size2,
double  size,
int  color
 

Constructor with locations, sizes and color.

A cylinder extends from a sphere of radius size1 at (x1,y1,z1) to a sphere of radius size2 at (x2,y2,z2) and has radius size.

Parameters:
x1 X coordinate for first sphere
y1 Y coordinate for first sphere
z1 Z coordinate for first sphere
size1 Radius of sphere at (x1,y1,z1)
x2 X coordinate for second sphere
y2 Y coordinate for second sphere
z2 Z coordinate for second sphere
size2 Radius of sphere at (x2,y2,z2)
size Radius of the cylinder
color Color index for the cylinder

template<class T, class S>
cylinder< T, S >::cylinder< T, S >  ) 
 

Default constructor.

This is needed since arrays of cylinders are allocated.


Member Data Documentation

template<class T, class S>
T cylinder< T, S >::x1
 

x coordinate for first sphere

template<class T, class S>
T cylinder< T, S >::y1
 

y coordinate for first sphere

template<class T, class S>
T cylinder< T, S >::z1
 

z coordinate for first sphere

template<class T, class S>
T cylinder< T, S >::x2
 

x coordinate for second sphere

template<class T, class S>
T cylinder< T, S >::y2
 

y coordinate for second sphere

template<class T, class S>
T cylinder< T, S >::z2
 

z coordinate for second sphere

template<class T, class S>
S cylinder< T, S >::size1
 

diameter of first sphere

template<class T, class S>
S cylinder< T, S >::size2
 

diameter of second sphere

template<class T, class S>
S cylinder< T, S >::size
 

diameter of the cylinder

template<class T, class S>
byte cylinder< T, S >::color
 

An index which specifies a color.


The documentation for this class was generated from the following files:
Generated on Thu Nov 27 08:17:11 2003 for Animp - Animated Particles by doxygen 1.3.2