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

JPrism Class Reference

#include <PRISM.HPP>

List of all members.

Public Methods

 JPrism (double h=0.0, double r=0.0, int x=0, int y=0)
void setHeight (double Height)
double getHeight () const
double area () const
double volume () const

Protected Attributes

JRectangle rc
double height
double area_cache
double volume_cache

Friends

ostream & operator<< (ostream &output, const JPrism &pr)


Constructor & Destructor Documentation

JPrism::JPrism double    h = 0.0,
double    r = 0.0,
int    x = 0,
int    y = 0
 


Member Function Documentation

double JPrism::area   const [inline]
 

Definition at line 50 of file PRISM.CPP.

00050                           { 
00051   if ( area_cache < 0.0 ) {
00052     area_cache = 2 * rc.area()
00053                + 2 * rc.getLength() * height
00054                + 2 * rc.getWidth() * height;
00055   }
00056   return area_cache;
00057 }

double JPrism::getHeight   const
 

Definition at line 45 of file PRISM.CPP.

00045                                {
00046   return height;
00047 }

JPrism & JPrism::setHeight double    Height
 

JPrism specific functions. ////////////////////////////////////////////////////////////////////////////.

Definition at line 39 of file PRISM.CPP.

00039                                           {
00040   height = Height;
00041   return *this;
00042 }

double JPrism::volume   const
 

Definition at line 60 of file PRISM.CPP.

00060                             {
00061    if ( volume_cache < 0.0 ) {
00062      volume_cache = rc.area() * height;
00063    }
00064    return volume_cache;
00065 }


Friends And Related Function Documentation

ostream& operator<< ostream &    output,
const JPrism &    pr
[friend]
 

Definition at line 19 of file PRISM.HPP.

00019                                                                     {
00020      output << pr.rc << "; Height = " << pr.height;
00021      return output;                              // enables cascaded calls
00022    }


Member Data Documentation

double JPrism::area_cache [protected]
 

Definition at line 28 of file PRISM.HPP.

double JPrism::height [protected]
 

Definition at line 26 of file PRISM.HPP.

Referenced by operator<<().

JRectangle JPrism::rc [protected]
 

Definition at line 25 of file PRISM.HPP.

Referenced by operator<<().

double JPrism::volume_cache [protected]
 

Definition at line 29 of file PRISM.HPP.


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