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

JCylinder Class Reference

#include <JCylinder.hpp>

Inheritance diagram for JCylinder::

JCircle JPoint List of all members.

Public Methods

 JCylinder ()
 JCylinder (Type X)
 JCylinder (Type X, Type Y)
 JCylinder (Type X, Type Y, FType radius)
 JCylinder (Type X, Type Y, FType Radius, FType Height)
 JCylinder (const JCylinder &src)
const JCircleoperator= (const JCircle &src)
const JCylinder & setHeight (FType Height)
FType getHeight () const
FType area () const
FType volume () const
const JCylinder & setRadius (FType r)
const JCylinder & setPoint (Type X, Type Y)
const JCylinder & setPolar (FType R, FType Theta)
const JCylinder & setCircle (Type X, Type Y, FType Radius)
const JCylinder & setX (Type X)
const JCylinder & setY (Type Y)
const JCylinder & setR (FType R)
const JCylinder & setAngle (FType Theta)

Protected Attributes

JCylinder_t cyl

Friends

ostream & operator<< (ostream &os, const JCylinder &Cyl)

Constructor & Destructor Documentation

JCylinder::JCylinder   [inline]
 

Definition at line 42 of file JCylinder.hpp.

00042                       : JCircle( 0, 0, 0 )
00043    {
00044       memset( &cyl, 0, sizeof( JCylinder_t ) );
00045    }

JCylinder::JCylinder Type    X [inline]
 

Definition at line 47 of file JCylinder.hpp.

00047                               : JCircle( X, 0, 0 )
00048    {
00049      memset( &cyl, 0, sizeof( JCylinder_t ) );
00050    }

JCylinder::JCylinder Type    X,
Type    Y
[inline]
 

Definition at line 52 of file JCylinder.hpp.

00052                                       : JCircle( X, Y, 0 )
00053    {
00054      memset( &cyl, 0, sizeof( JCylinder_t ) );
00055    }

JCylinder::JCylinder Type    X,
Type    Y,
FType    radius
[inline]
 

Definition at line 57 of file JCylinder.hpp.

00058      : JCircle( X, Y, radius )
00059    {
00060      memset( &cyl, 0, sizeof( JCylinder_t ) );
00061      cyl.area_cache   = -1;
00062      cyl.volume_cache = -1;
00063    }

JCylinder::JCylinder Type    X,
Type    Y,
FType    Radius,
FType    Height
[inline]
 

Definition at line 65 of file JCylinder.hpp.

00066      : JCircle( X, Y, Radius )
00067    {
00068       memset( &cyl, 0, sizeof( JCylinder_t ) );
00069       cyl.height       = Height;
00070       cyl.area_cache   = -1;
00071       cyl.volume_cache = -1;
00072    }

JCylinder::JCylinder const JCylinder &    src [inline]
 

Definition at line 74 of file JCylinder.hpp.

00075      : JCircle( (const JCircle&) src )
00076    {
00077      memcpy( &cyl, &src.cyl, sizeof( JCylinder_t ) );
00078    }


Member Function Documentation

FType JCylinder::area   const [inline]
 

Definition at line 105 of file JCylinder.hpp.

00106    {
00107      if ( cyl.area_cache < 0 ) {
00108        FType a = JCircle::area();
00109        FType r = JCircle::getRadius();
00110 
00111        cyl.area_cache = ( 2 * a ) + \
00112                         ( 2 * Math_PI * r * cyl.height );
00113      }
00114      return area_cache;
00115    }

FType JCylinder::getHeight   const [inline]
 

Definition at line 100 of file JCylinder.hpp.

Referenced by main().

00100                                   {
00101      return cyl.height;
00102    }

const JCircle& JCylinder::operator= const JCircle   src [inline]
 

Reimplemented from JCircle.

Definition at line 80 of file JCylinder.hpp.

00081    {
00082      memcpy( &pt,  &src.pt,  sizeof( JPoint_t    ) );
00083      memcpy( &c,   &src.c,   sizeof( JCircle_t   ) );
00084      memcpy( &cyl, &src.cyl, sizeof( JCylinder_t ) );
00085      return *this;
00086    }

const JCylinder& JCylinder::setAngle FType    Theta [inline]
 

Reimplemented from JCircle.

Definition at line 181 of file JCylinder.hpp.

00182    {
00183       JCircle::setAngle( Theta );
00184       return *this;
00185    }

const JCylinder& JCylinder::setCircle Type    X,
Type    Y,
FType    Radius
[inline]
 

Reimplemented from JCircle.

Definition at line 157 of file JCylinder.hpp.

00158    {
00159       JCircle::setCircle( X, Y, Radius );
00160       return *this;
00161    }

const JCylinder& JCylinder::setHeight FType    Height [inline]
 

JCylinder specific functions. /////////////////////////////////////////////////////////////////////////.

Definition at line 93 of file JCylinder.hpp.

00094    {
00095      cyl.height = Height;
00096      return *this;
00097    }

const JCylinder& JCylinder::setPoint Type    X,
Type    Y
[inline]
 

Point related functions. ////////////////////////////////////////////////////////////////////////////.

Reimplemented from JCircle.

Definition at line 143 of file JCylinder.hpp.

Referenced by main().

00144    {
00145       JCircle::setPoint( X, Y );
00146       return *this;
00147    }

const JCylinder& JCylinder::setPolar FType    R,
FType    Theta
[inline]
 

JPoint related functions. ////////////////////////////////////////////////////////////////////.

Reimplemented from JCircle.

Definition at line 150 of file JCylinder.hpp.

00151    {
00152       JCircle::setPolar( R, Theta );
00153       return *this;
00154    }

const JCylinder& JCylinder::setR FType    R [inline]
 

Reimplemented from JCircle.

Definition at line 175 of file JCylinder.hpp.

00176    {
00177       JCircle::setR( R );
00178       return *this;
00179    }

const JCylinder& JCylinder::setRadius FType    r [inline]
 

JCircle related functions. ////////////////////////////////////////////////////////////////////////////.

Reimplemented from JCircle.

Definition at line 132 of file JCylinder.hpp.

Referenced by main().

00133    {
00134      JCircle::setRadius( r );
00135      return *this;
00136    }

const JCylinder& JCylinder::setX Type    X [inline]
 

Reimplemented from JCircle.

Definition at line 163 of file JCylinder.hpp.

00164    {
00165       JCircle::setX( X );
00166       return *this;
00167    }

const JCylinder& JCylinder::setY Type    Y [inline]
 

Reimplemented from JCircle.

Definition at line 169 of file JCylinder.hpp.

00170    {
00171       JCircle::setY( Y );
00172       return *this;
00173    }

FType JCylinder::volume   const [inline]
 

Definition at line 118 of file JCylinder.hpp.

00119    {
00120       if ( cyl.volume_cache < 0 ) {
00121         FType a = JCircle::area();
00122         cyl.volume_cache = a * cyl.height;
00123       }
00124       return cyl.volume_cache;
00125    }


Friends And Related Function Documentation

ostream& operator<< ostream &    os,
const JCylinder &    Cyl
[friend]
 

Definition at line 188 of file JCylinder.hpp.

00189    {
00190      os << (const JCircle&)Cyl << "; Height = " << Cyl.cyl.height;
00191      return os;
00192    }


Member Data Documentation

struct JCylinder_t JCylinder::cyl [protected]
 

Definition at line 195 of file JCylinder.hpp.

Referenced by operator<<().


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