home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
IOC
/
GRAPH
/
CIRCLE.H
< prev
next >
Wrap
Text File
|
1995-03-15
|
2KB
|
66 lines
/*************************************************************************
IBM C/C++ Tools Version 3.00 - Collection Class Library
(C) Copyright IBM Corporation 1992 ,1995, Licensed Program-Property of
IBM. All Rights Reserved. US Government Users Restricted Rights - Use,
duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
*************************************************************************/
#if defined (_SUN)
#include <istring.h>
#else
#include <istring.hpp>
#endif
class Circle : public Graphics
{
public:
float ivXCenter;
float ivYCenter;
float ivRadius;
Circle(int graphicsKey, IString id ,
double xCenter, double yCenter,
double radius)
: Graphics(graphicsKey, id),
ivXCenter(xCenter),
ivYCenter(yCenter),
ivRadius(radius)
{ }
IBoolean operator== (Circle const& circle) const
{
return (this->ivXCenter == circle.ivXCenter &&
this->ivYCenter == circle.ivYCenter &&
this->ivRadius == circle.ivRadius);
}
void draw() const
{
cout << "drawing "
<< Graphics::id()
<< endl
<< "with center: "
<< "(" << this->ivXCenter << "|"
<< this->ivYCenter << ")"
<< " and with radius: "
<< this->ivRadius
<< endl;
}
void circumference() const
{
cout << "The circumference of "
<< Graphics::id()
<< " is: "
<< ((this->ivRadius)*2*3.14)
<< endl;
}
};