Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Circle::Circle() {
- radius = 0;
- }
- Circle::Circle(Point pt, int r, Color c) {
- setCenter(pt);
- setRadius(r);
- setColor(c);
- }
- void Circle::setCenter(Point new_pt) {
- center = new_pt;
- }
- void Circle::setColor(Color new_col) {
- color = new_col;
- }
- void Circle::setRadius(int new_r) {
- radius = new_r;
- }
- Point Circle::getCenter() {
- return center;
- }
- int Circle::getRadius() {
- return radius;
- }
- Color Circle::getColor() {
- return color;
- }
- void Circle::read(istream& ins) {
- Point centRead;
- int radRead;
- Color colorRead;
- ins >> centRead >> radRead >> colorRead;
- center = centRead;
- radius = radRead;
- color = colorRead;
- }
- void Circle::write(ostream& outs) {
- Point w_cent = getCenter();
- int w_rad = getRadius();
- Color w_col = getColor();
- outs << " " << w_cent << " " << w_rad << " " << w_col << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement