Advertisement
hitlerdidnothingwron

Untitled

Nov 11th, 2016
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Circle::Circle() {
  2. radius = 0;
  3. }
  4. Circle::Circle(Point pt, int r, Color c) {
  5. setCenter(pt);
  6. setRadius(r);
  7. setColor(c);
  8. }
  9.  
  10. void Circle::setCenter(Point new_pt) {
  11. center = new_pt;
  12. }
  13.  
  14. void Circle::setColor(Color new_col) {
  15. color = new_col;
  16. }
  17.  
  18. void Circle::setRadius(int new_r) {
  19. radius = new_r;
  20. }
  21.  
  22. Point Circle::getCenter() {
  23. return center;
  24. }
  25.  
  26. int Circle::getRadius() {
  27. return radius;
  28. }
  29.  
  30. Color Circle::getColor() {
  31. return color;
  32. }
  33.  
  34. void Circle::read(istream& ins) {
  35.  
  36. Point centRead;
  37. int radRead;
  38. Color colorRead;
  39.  
  40. ins >> centRead >> radRead >> colorRead;
  41.  
  42. center = centRead;
  43. radius = radRead;
  44. color = colorRead;
  45. }
  46.  
  47. void Circle::write(ostream& outs) {
  48.  
  49. Point w_cent = getCenter();
  50. int w_rad = getRadius();
  51. Color w_col = getColor();
  52.  
  53. outs << " " << w_cent << " " << w_rad << " " << w_col << endl;
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement