Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

JCube Class Reference

#include <CUBE.HPP>

List of all members.

Public Methods

 JCube ()
 JCube (double X)
 JCube (double X, double Y)
 JCube (double X, double Y, double Length)
double area () const
double volume () const

Protected Attributes

JSquare sq
double area_cache
double volume_cache

Friends

ostream & operator<< (ostream &output, const JCube &c)


Constructor & Destructor Documentation

JCube::JCube  
 

Definition at line 7 of file Cube.cpp.

00008   : sq( 0.0, 0.0, 0.0 ), area_cache( 0.0 ), volume_cache( 0.0 ) { }

JCube::JCube double    X
 

Definition at line 10 of file Cube.cpp.

00011   : sq( X, 0.0, 0.0 ), area_cache( 0.0 ), volume_cache( 0.0 ) { }

JCube::JCube double    X,
double    Y
 

Definition at line 13 of file Cube.cpp.

00014   : sq( X, Y, 0.0 ), area_cache( 0.0 ), volume_cache( 0.0 ) { }

JCube::JCube double    X,
double    Y,
double    Length
 

Definition at line 16 of file Cube.cpp.

00017   : sq( X, Y, Length ), area_cache( -1.0 ), volume_cache( -1.0 ) { }


Member Function Documentation

double JCube::area   const
 

JCube specific functions. ////////////////////////////////////////////////////////////////////////////.

Definition at line 24 of file Cube.cpp.

00024                          {   //  Area = 6 * square
00025   if ( area_cache < 0.0 ) {
00026     area_cache = 6 * sq.area();
00027   }
00028   return area_cache;
00029 }

double JCube::volume   const
 

Definition at line 32 of file Cube.cpp.

00032                            { // sq.length ^ 3
00033    if ( volume_cache < 0.0 ) {
00034      double l = sq.getLength();
00035      volume_cache = l * l * l;
00036    }
00037    return volume_cache;
00038 }


Friends And Related Function Documentation

ostream& operator<< ostream &    output,
const JCube &    c
[friend]
 

Definition at line 19 of file CUBE.HPP.

00019                                                                   {
00020      output << c.sq;
00021      return output;                              // Enable cascaded calls
00022    }


Member Data Documentation

double JCube::area_cache [protected]
 

Definition at line 26 of file CUBE.HPP.

JSquare JCube::sq [protected]
 

Definition at line 25 of file CUBE.HPP.

Referenced by operator<<().

double JCube::volume_cache [protected]
 

Definition at line 27 of file CUBE.HPP.


The documentation for this class was generated from the following files:
Generated on Sun Oct 14 18:48:46 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001