pmc/rectangle.cc
changeset 45 7197576fedcf
parent 43 cf8c1b5127b2
child 46 4b9e1ac40246
--- a/pmc/rectangle.cc
+++ b/pmc/rectangle.cc
@@ -6,28 +6,44 @@
 #include <rectangle.h>
 #include <cstdio>
 
+using namespace algebra;
+
 Rectangle::Rectangle (Surface * s)
 {
+    surface = s;
+    name = "Rectangle";
+
+    anker = Vector (0, 0);
+
     P[0] = new Vector (0, 0);
     P[1] = new Vector (0, 100);
     P[2] = new Vector (100, 100);
     P[3] = new Vector (0, 100);
+}
+
+Rectangle::Rectangle (Surface * s, Vector & p1, Vector & p2, Vector & p3, Vector & p4)
+{
+    surface = s;
+    name = "Rectangle";
 
     anker = Vector (0, 0);
 
-    surface = s;
-}
-
-Rectangle::Rectangle (Surface * s, Vector& p1, Vector& p2, Vector& p3, Vector& p4)
-{
     P[0] = new Vector (p1);
     P[1] = new Vector (p2);
     P[2] = new Vector (p3);
     P[3] = new Vector (p4);
+}
+
+Rectangle::Rectangle (Surface * s, Vector p[4])
+{
+    surface = s;
+    name = "Rectangle";
 
     anker = Vector (0, 0);
 
-    surface = s;
+    for (int i = 0; i < 4; i++) {
+        P[i] = new Vector (p[i]);
+    }
 }
 
 Rectangle::~Rectangle ()