From 3c58c2d64d74c50f305de7375fc099cf5b29c691 Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Mon, 3 Apr 2023 17:24:53 +0200
Subject: [PATCH] geometry: Rename point XY to AC.

---
 src/Model/Geometry/PointXY.py  | 36 +++++++++++++++++-----------------
 src/Model/Geometry/PointXYZ.py | 20 ++++++++++++++++++-
 2 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/src/Model/Geometry/PointXY.py b/src/Model/Geometry/PointXY.py
index 66bbfc68..2cd6907f 100644
--- a/src/Model/Geometry/PointXY.py
+++ b/src/Model/Geometry/PointXY.py
@@ -4,42 +4,42 @@ from math import dist
 
 from Model.Geometry.Point import Point
 
-class PointXY(Point):
-    def __init__(self, x:float = 0.0, y:float = 0.0,
+class PointAC(Point):
+    def __init__(self, a:float = 0.0, c:float = 0.0,
                  name: str = ""):
         super(PointXY, self).__init__(name = name)
 
-        self._x = float(x)
-        self._y = float(y)
+        self._a = float(a)
+        self._c = float(c)
 
     def __repr__(self):
-        return f"[{self._x}, {self._y}, {self._name}]"
+        return f"[{self._a}, {self._c}, {self._name}]"
 
     @property
-    def x(self):
-        return self._x
+    def a(self):
+        return self._a
 
-    @x.setter
-    def x(self, value):
-        self._x = float(value)
+    @a.setter
+    def a(self, value):
+        self._a = float(value)
 
     @property
-    def y(self):
-        return self._y
+    def c(self):
+        return self._c
 
-    @y.setter
-    def y(self, value):
-        self._y = float(value)
+    @c.setter
+    def c(self, value):
+        self._c = float(value)
 
     @staticmethod
     def distance(p1, p2):
         """Euclidean distance between p1 and p2.
 
         Args:
-            p1: A XY Point
-            p2: A XY Point
+            p1: A AC Point
+            p2: A AC Point
 
         Returns:
             Euclidean distance between the two points
         """
-        return dist((p1.x(), p1.y()), (p2.x(), p2.y()))
+        return dist((p1.a(), p1.c()), (p2.a(), p2.c()))
diff --git a/src/Model/Geometry/PointXYZ.py b/src/Model/Geometry/PointXYZ.py
index a1b6f361..dada32b6 100644
--- a/src/Model/Geometry/PointXYZ.py
+++ b/src/Model/Geometry/PointXYZ.py
@@ -5,16 +5,34 @@ from pandas import isna as pd_is_na
 
 from Model.Geometry.PointXY import PointXY
 
-class PointXYZ(PointXY):
+class PointXYZ(Point):
     def __init__(self, x:float = 0.0, y:float = 0.0, z:float = 0.0,
                  name:str = ""):
         super(PointXYZ, self).__init__(x=x, y=y, name=name)
 
+        self._x = float(x)
+        self._y = float(y)
         self._z = float(z)
 
     def __repr__(self):
         return f"({self._x}, {self._y}, {self._z}, {self._name})"
 
+    @property
+    def x(self):
+        return self._x
+
+    @x.setter
+    def x(self, value):
+        self._x = float(value)
+
+    @property
+    def y(self):
+        return self._y
+
+    @y.setter
+    def y(self, value):
+        self._y = float(value)
+
     @property
     def z(self):
         return self._z
-- 
GitLab