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

JRectangle Class Reference

#include <Rectangle.hpp>

List of all members.

Public Methods

 JRectangle () JRectangle(double X)
 JRectangle (double X, double Y)
 JRectangle (double X, double Y, double Length)
 JRectangle (double X, double Y, double Length, double Width)
double getLength () const
double getWidth () const
double area () const
JRectangle & setJSquare (double X, double Y, double Length)
JRectangle & setJRectangle (double X, double Y, double Length, double Width)
JRectangle & setLength (double Length)
JRectangle & setWidth (double Width)
JRectangle & setPoint (double X, double Y)
JRectangle & setPolar (double X, double Y)
JRectangle & setX (double X)
JRectangle & setY (double Y)
JRectangle & setR (double R)
JRectangle & setAngle (double Theta)
double getX () const
double getY () const
double getR () const
double getAngle () const

Protected Attributes

Pointp
double length
double width
double area_cache

Friends

ostream & operator<< (ostream &output, const JRectangle &rec)


Constructor & Destructor Documentation

JRectangle::JRectangle  
 

Definition at line 9 of file Rectangle.cpp.

00010   :  p( 0.0, 0.0 ), length( 0.0 ), width( 0.0 ), area_cache( 0.0 ) { }

JRectangle::JRectangle double    X,
double    Y
 

Definition at line 15 of file Rectangle.cpp.

00016   :  p( X, Y ), length( 0.0 ), width( 0.0 ), area_cache( 0.0 ) { }

JRectangle::JRectangle double    X,
double    Y,
double    Length
 

Definition at line 18 of file Rectangle.cpp.

00019   :  p( X, Y ), length( Length ), width( 0.0 ), area_cache( -1.0 ) { }

JRectangle::JRectangle double    X,
double    Y,
double    Length,
double    Width
 

Definition at line 21 of file Rectangle.cpp.

00023   :  p( X, Y ), length( Length ), width( Width ), area_cache( -1.0 ) { }


Member Function Documentation

double JRectangle::area   const [inline]
 

Definition at line 70 of file Rectangle.cpp.

Referenced by JPrism::area(), and JPrism::volume().

00070                                      {
00071   if ( area_cache < 0.0 ) {
00072     area_cache = Length * Width;
00073   }
00074   return area_cache;
00075 }

double JRectangle::getAngle   const [inline]
 

Referenced by operator<<().

double JRectangle::getLength   const
 

Referenced by JPrism::area().

double JRectangle::getR   const [inline]
 

Referenced by operator<<().

double JRectangle::getWidth   const
 

Referenced by JPrism::area().

double JRectangle::getX   const [inline]
 

Referenced by operator<<().

double JRectangle::getY   const [inline]
 

Referenced by operator<<().

JRectangle & JRectangle::setAngle double    Theta [inline]
 

Definition at line 102 of file Rectangle.cpp.

Referenced by operator<<().

00102                                                        {
00103    p.setAngle( Theta );
00104    return *this;
00105 }

JRectangle & JRectangle::setJRectangle double    X,
double    Y,
double    Length,
double    Width
[inline]
 

Definition at line 60 of file Rectangle.cpp.

00062 {
00063    p.setPoint( X, Y );
00064    length = Length;
00065    width  = Width;
00066    return *this;
00067 }

JRectangle & JRectangle::setJSquare double    X,
double    Y,
double    Length
[inline]
 

Definition at line 53 of file Rectangle.cpp.

00055 {
00056    p.setPoint( X, Y );
00057    length = Length;
00058    return *this;
00059 }

JRectangle & JRectangle::setLength double    Length [inline]
 

JRectangle related functions. ////////////////////////////////////////////////////////////////////////////.

Definition at line 35 of file Rectangle.cpp.

00035                                                          {
00036   length = Length;
00037   return *this;
00038 }

JRectangle & JRectangle::setPoint double    X,
double    Y
[inline]
 

Definition at line 26 of file Rectangle.cpp.

00026                                                              {
00027    p.setPoint( X, Y );
00028    return *this;
00029 }

JRectangle & JRectangle::setPolar double    R,
double    Theta
[inline]
 

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

Definition at line 82 of file Rectangle.cpp.

Referenced by operator<<().

00082                                                                  {
00083    p.setPolar( R, Theta );
00084    return *this;
00085 }

JRectangle & JRectangle::setR double    R [inline]
 

Definition at line 97 of file Rectangle.cpp.

Referenced by operator<<().

00097                                                {
00098    p.setR( R );
00099    return *this;
00100 }

JRectangle & JRectangle::setWidth double    Width [inline]
 

Definition at line 40 of file Rectangle.cpp.

00040                                                        {
00041   width = Width;
00042   return *this;
00043 }

JRectangle & JRectangle::setX double    X [inline]
 

Definition at line 87 of file Rectangle.cpp.

Referenced by operator<<().

00087                                                {
00088    p.setX( X );
00089    return *this;
00090 }

JRectangle & JRectangle::setY double    Y [inline]
 

Definition at line 92 of file Rectangle.cpp.

Referenced by operator<<().

00092                                                {
00093    p.setY( Y );
00094    return *this;
00095 }


Friends And Related Function Documentation

ostream& operator<< ostream &    output,
const JRectangle &    rec
[friend]
 

Definition at line 37 of file Rectangle.hpp.

00038    {
00039      output << "Position = " << rec.p
00040             << "; Length = " 
00041             << setiosflags( ios::fixed | ios::showpoint )
00042             << setprecision( 2 ) << rec.length;
00043             << "; Width = " 
00044             << setiosflags( ios::fixed | ios::showpoint )
00045             << setprecision( 2 ) << rec.width;
00046      return output;                              //  enables cascaded calls
00047    }


Member Data Documentation

double JRectangle::area_cache [protected]
 

Definition at line 67 of file Rectangle.hpp.

double JRectangle::length [protected]
 

Definition at line 65 of file Rectangle.hpp.

Referenced by operator<<().

Point& JRectangle::p [protected]
 

Definition at line 64 of file Rectangle.hpp.

Referenced by operator<<().

double JRectangle::width [protected]
 

Definition at line 66 of file Rectangle.hpp.

Referenced by operator<<().


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