#include <cylinder.h>
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 | |
T | x1 |
x coordinate for first sphere | |
T | y1 |
y coordinate for first sphere | |
T | z1 |
z coordinate for first sphere | |
T | x2 |
x coordinate for second sphere | |
T | y2 |
y coordinate for second sphere | |
T | z2 |
z coordinate for second sphere | |
S | size1 |
diameter of first sphere | |
S | size2 |
diameter of second sphere | |
S | size |
diameter of the cylinder | |
byte | color |
An index which specifies a color. |
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.
|
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.
|
|
Default constructor. This is needed since arrays of cylinders are allocated. |
|
x coordinate for first sphere
|
|
y coordinate for first sphere
|
|
z coordinate for first sphere
|
|
x coordinate for second sphere
|
|
y coordinate for second sphere
|
|
z coordinate for second sphere
|
|
diameter of first sphere
|
|
diameter of second sphere
|
|
diameter of the cylinder
|
|
An index which specifies a color.
|