From ec8d499b9f7d2a80cf4dca2a8084dc7a775e9015 Mon Sep 17 00:00:00 2001
From: IgorekLoschinin <igor.loschinin2014@yandex.ru>
Date: Sat, 4 Sep 2021 17:10:25 +0300
Subject: [PATCH] ref #97 Create a class for control position of group objects.

---
 src/Core/Crawl/controlpos.cpp | 44 ++++++++++++++++++++++++++++++++
 src/Core/Crawl/controlpos.h   | 48 +++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 src/Core/Crawl/controlpos.cpp
 create mode 100644 src/Core/Crawl/controlpos.h

diff --git a/src/Core/Crawl/controlpos.cpp b/src/Core/Crawl/controlpos.cpp
new file mode 100644
index 0000000..191e63b
--- /dev/null
+++ b/src/Core/Crawl/controlpos.cpp
@@ -0,0 +1,44 @@
+//#
+//# Copyright (C) 2021-2021 QuasarApp.
+//# Distributed under the GPLv3 software license, see the accompanying
+//# Everyone is permitted to copy and distribute verbatim copies
+//# of this license document, but changing it is not allowed.
+//#
+
+#include "controlpos.h"
+
+namespace CRAWL {
+
+ControlPos::ControlPos() {
+
+}
+
+void ControlPos::add(ClasterItem *object) {
+
+    GroupObject::updatePosition();
+
+}
+
+void ControlPos::remove(ClasterItem *object) {
+
+    GroupObject::updatePosition();
+
+}
+
+void ControlPos::changeLayout(const _Figure &fig) {
+
+    if (fig == CIRCLE) {
+        GroupObject::updatePosition();
+    }
+
+    if (fig == SQUARE) {
+        GroupObject::updatePosition();
+    }
+
+    if (fig == LINE) {
+        GroupObject::updatePosition();
+    }
+
+}
+
+}
diff --git a/src/Core/Crawl/controlpos.h b/src/Core/Crawl/controlpos.h
new file mode 100644
index 0000000..1b87a74
--- /dev/null
+++ b/src/Core/Crawl/controlpos.h
@@ -0,0 +1,48 @@
+//#
+//# Copyright (C) 2021-2021 QuasarApp.
+//# Distributed under the GPLv3 software license, see the accompanying
+//# Everyone is permitted to copy and distribute verbatim copies
+//# of this license document, but changing it is not allowed.
+//#
+
+#ifndef CONTROLPOS_H
+#define CONTROLPOS_H
+
+#include <Crawl/groupobject.h>
+
+
+namespace CRAWL {
+
+/**
+ * @brief The ControlPos class
+ */
+class ControlPos: public GroupObject {
+public:
+    ControlPos();
+
+// Claster interface
+public:
+    void add(ClasterItem *object);
+    void remove(ClasterItem *object);
+
+private:
+
+    /**
+     * @brief The _Figure enum
+     */
+    enum _Figure {
+        CIRCLE,
+        SQUARE,
+        LINE
+    };
+
+    /**
+     * @brief changeLayout
+     * @param fig
+     */
+    void changeLayout(const _Figure &fig);
+
+};
+
+}
+#endif // CONTROLPOS_H