#include <Rectangle.hpp>
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 | |
Point & | p |
double | length |
double | width |
double | area_cache |
Friends | |
ostream & | operator<< (ostream &output, const JRectangle &rec) |
|
Definition at line 9 of file Rectangle.cpp. 00010 : p( 0.0, 0.0 ), length( 0.0 ), width( 0.0 ), area_cache( 0.0 ) { } |
|
Definition at line 15 of file Rectangle.cpp. 00016 : p( X, Y ), length( 0.0 ), width( 0.0 ), area_cache( 0.0 ) { } |
|
Definition at line 18 of file Rectangle.cpp. 00019 : p( X, Y ), length( Length ), width( 0.0 ), area_cache( -1.0 ) { } |
|
Definition at line 21 of file Rectangle.cpp. 00023 : p( X, Y ), length( Length ), width( Width ), area_cache( -1.0 ) { } |
|
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 } |
|
Referenced by operator<<().
|
|
Referenced by JPrism::area().
|
|
Referenced by operator<<().
|
|
Referenced by JPrism::area().
|
|
Referenced by operator<<().
|
|
Referenced by operator<<().
|
|
Definition at line 102 of file Rectangle.cpp. Referenced by operator<<().
00102 { 00103 p.setAngle( Theta ); 00104 return *this; 00105 } |
|
Definition at line 60 of file Rectangle.cpp. 00062 { 00063 p.setPoint( X, Y ); 00064 length = Length; 00065 width = Width; 00066 return *this; 00067 } |
|
Definition at line 53 of file Rectangle.cpp. 00055 { 00056 p.setPoint( X, Y ); 00057 length = Length; 00058 return *this; 00059 } |
|
JRectangle related functions. ////////////////////////////////////////////////////////////////////////////.
Definition at line 35 of file Rectangle.cpp. 00035 { 00036 length = Length; 00037 return *this; 00038 } |
|
Definition at line 26 of file Rectangle.cpp. 00026 { 00027 p.setPoint( X, Y ); 00028 return *this; 00029 } |
|
Point related functions. ////////////////////////////////////////////////////////////////////////////.
Definition at line 82 of file Rectangle.cpp. Referenced by operator<<().
00082 { 00083 p.setPolar( R, Theta ); 00084 return *this; 00085 } |
|
Definition at line 97 of file Rectangle.cpp. Referenced by operator<<().
00097 { 00098 p.setR( R ); 00099 return *this; 00100 } |
|
Definition at line 40 of file Rectangle.cpp. 00040 { 00041 width = Width; 00042 return *this; 00043 } |
|
Definition at line 87 of file Rectangle.cpp. Referenced by operator<<().
00087 { 00088 p.setX( X ); 00089 return *this; 00090 } |
|
Definition at line 92 of file Rectangle.cpp. Referenced by operator<<().
00092 { 00093 p.setY( Y ); 00094 return *this; 00095 } |
|
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 } |
|
Definition at line 67 of file Rectangle.hpp. |
|
Definition at line 65 of file Rectangle.hpp. Referenced by operator<<().
|
|
Definition at line 64 of file Rectangle.hpp. Referenced by operator<<().
|
|
Definition at line 66 of file Rectangle.hpp. Referenced by operator<<().
|