gcx.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #include "gcx.h"
  2. namespace gcx {
  3. Point::Point() {
  4. this->x = 0;
  5. this->y = 0;
  6. this->z = 0;
  7. this->tag = 'T';
  8. }
  9. Point::Point(const char &tag) {
  10. this->x = 1;
  11. this->y = 1;
  12. this->z = 1;
  13. this->tag = tag;
  14. }
  15. Point::Point(const char &tag, const int &xx, const int &yy, const int &zz) {
  16. this->tag = tag;
  17. this->x = xx;
  18. this->y = yy;
  19. this->z = zz;
  20. }
  21. // Point &Point::operator=(const Point &point) {
  22. // if (this == &point) return *this;
  23. // this->tag = point.tag;
  24. // this->x = point.x;
  25. // this->y = point.y;
  26. // this->z = point.z;
  27. // return *this;
  28. // }
  29. void Point::show() const {
  30. printf("Point[%c](a:%d, b:%d, c:%d)\n", tag, x, y, z);
  31. }
  32. Dataset::Dataset() {
  33. s = Point('S');
  34. e = Point('E', 5, 5, 5);
  35. b = false;
  36. }
  37. Dataset::Dataset(const Point &ss, const Point &ee, const bool &bb) {
  38. s = ss;
  39. e = ee;
  40. b = bb;
  41. }
  42. // Dataset &Dataset::operator=(const Dataset &data) {
  43. // if (this == &data) return *this;
  44. // this->s = data.s;
  45. // this->e = data.e;
  46. // this->b = data.b;
  47. // return *this;
  48. // }
  49. void Dataset::show() const {
  50. printf("Dataset:\n\tb=%d\n", b);
  51. printf("\ts: ");
  52. s.show();
  53. printf("\te: ");
  54. e.show();
  55. }
  56. void Manager::SetNew(const Dataset &onj) {
  57. set.show();
  58. onj.show();
  59. this->set = onj;
  60. set.show();
  61. onj.show();
  62. }
  63. }