#include <j2k/Fred/Standard.hpp>#include <iostream.h>#include <iomanip.h>#include <j2k/Fred/Geometry/Macro/MC_JCylinder.hpp>Go to the source code of this file.
Defines | |
| #define | __J2K__Need_JCylinder_double_double |
| #define | JPoint JPoint_double_double |
| #define | JCircle JCircle_double_double |
| #define | JCylinder JCylinder_double_double |
Functions | |
| int | main () |
|
|
Definition at line 12 of file CylTest.cpp. |
|
|
Definition at line 13 of file CylTest.cpp. |
|
|
Definition at line 11 of file CylTest.cpp. |
|
|
Definition at line 7 of file CylTest.cpp. |
|
|
Definition at line 15 of file CylTest.cpp. 00016 {
00017 // create JCylinder object
00018 JCylinder cyl( 5.7, 2.5, 12, 23 );
00019
00020 // use get functions to display the JCylinder
00021 cout << "X coordinate is " << cyl.getX()
00022 << "\nY coordinate is " << cyl.getY()
00023 << "\nRadius is " << cyl.getRadius()
00024 << "\nHeight is " << cyl.getHeight()
00025 << "\n\n";
00026
00027 // use set functions to change the JCylinder's attributes
00028 cyl.setPoint( 2, 2 ).setRadius( 4.25 ).setHeight( 10 );
00029 cout << "The new location, radius, and height of cyl are:\n"
00030 << cyl << '\n';
00031
00032 // display the JCylinder as a Point
00033 JPoint& pRef = cyl; // pRef "thinks" it is a Point
00034
00035 cout << "\nJCylinder printed as a Point is: "
00036 << pRef << "\n\n";
00037
00038 // display the JCylinder as a JCircle
00039 JCircle& JCircleRef = cyl; // JCircleRef thinks it is a JCircle
00040
00041 cout << "JCylinder printed as a JCircle is:\n" << JCircleRef
00042 << "\nArea: " << JCircleRef.area() << endl;
00043
00044 return 0;
00045 }
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001