ref #97 Create a class for control position of group objects.

This commit is contained in:
IgorekLoschinin 2021-09-04 17:10:25 +03:00
parent 329beb162d
commit ec8d499b9f
2 changed files with 92 additions and 0 deletions

View File

@ -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();
}
}
}

View File

@ -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