1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #include "gcx.h"
- namespace gcx {
- Point::Point() {
- this->x = 0;
- this->y = 0;
- this->z = 0;
- this->tag = 'T';
- }
- Point::Point(const char &tag) {
- this->x = 1;
- this->y = 1;
- this->z = 1;
- this->tag = tag;
- }
- Point::Point(const char &tag, const int &xx, const int &yy, const int &zz) {
- this->tag = tag;
- this->x = xx;
- this->y = yy;
- this->z = zz;
- }
- // Point &Point::operator=(const Point &point) {
- // if (this == &point) return *this;
- // this->tag = point.tag;
- // this->x = point.x;
- // this->y = point.y;
- // this->z = point.z;
- // return *this;
- // }
- void Point::show() const {
- printf("Point[%c](a:%d, b:%d, c:%d)\n", tag, x, y, z);
- }
- Dataset::Dataset() {
- s = Point('S');
- e = Point('E', 5, 5, 5);
- b = false;
- }
- Dataset::Dataset(const Point &ss, const Point &ee, const bool &bb) {
- s = ss;
- e = ee;
- b = bb;
- }
- // Dataset &Dataset::operator=(const Dataset &data) {
- // if (this == &data) return *this;
- // this->s = data.s;
- // this->e = data.e;
- // this->b = data.b;
- // return *this;
- // }
- void Dataset::show() const {
- printf("Dataset:\n\tb=%d\n", b);
- printf("\ts: ");
- s.show();
- printf("\te: ");
- e.show();
- }
- void Manager::SetNew(const Dataset &onj) {
- set.show();
- onj.show();
- this->set = onj;
- set.show();
- onj.show();
- }
- }
|