#include "Rectangle.hpp" Rectangle::Rectangle(int w, int h, Point p) { width = w; height = h; origin = new (nothrow) Point( p.getX(), p.getY() ); if(origin == NULL) { cerr << "Memory allocation failure!\n"; exit(-1); } cout << "Calling 2 args constructor" << endl; } Rectangle::Rectangle(int s, Point p) : Rectangle(s,s,p) { cout << "Calling 1 args constructor" << endl; } Rectangle::Rectangle() : Rectangle(0,Point()) { cout << "Calling 0 args constructor" << endl; } Rectangle::~Rectangle() { delete origin; } void Rectangle::setWidth(int w) { width = w; } void Rectangle::setHeight(int h) { height = h; } int Rectangle::getWidth() { return width; } int Rectangle::getHeight() { return height; } void Rectangle::setOrigin(Point *p) { origin = p; } Point *Rectangle::getOrigin() const { return origin; }