/* Rectangle en 2D */ /* */ /* Auteur: Nicolas JANEY */ /* nicolas.janey@univ-fcomte.fr */ /* Novembre 2011 */ #include #include #include #include "Rectangle2D.h" #include "Position2D.h" #include "Segment2D.h" Rectangle2D::Rectangle2D(void) { ig = new Position2D(); sd = new Position2D(); } Rectangle2D::Rectangle2D(Position2D *p1,Position2D *p2) { ig = new Position2D(p1); sd = new Position2D(p2); } Rectangle2D::Rectangle2D(Rectangle2D *s) { ig = new Position2D(s->ig); sd = new Position2D(s->sd); } Rectangle2D::~Rectangle2D(void) { delete(ig); delete(sd); } void Rectangle2D::print(void) { ig->print(); printf("\n"); sd->print(); printf("\n"); } void Rectangle2D::clip(Segment2D *s) { s->clip(this); }