Add abstract class GeometricObject
[linpy.git] / pypol / geometry.py
diff --git a/pypol/geometry.py b/pypol/geometry.py
new file mode 100644 (file)
index 0000000..d1d6770
--- /dev/null
@@ -0,0 +1,25 @@
+
+from abc import ABC, abstractmethod, abstractproperty
+
+
+__all__ = [
+    'GeometricObject',
+]
+
+
+class GeometricObject(ABC):
+
+    @abstractproperty
+    def symbols(self):
+        pass
+
+    @property
+    def dimension(self):
+        return len(self.symbols)
+
+    @abstractmethod
+    def aspolyhedron(self):
+        pass
+
+    def asdomain(self):
+        return self.aspolyhedron()