#ifndef WIMAPOLYGONCONTAINER_H
#define WIMAPOLYGONCONTAINER_H

#include <QObject>
#include "WimaPolygon.h"

class WimaPolygonContainer : public QObject
{
    Q_OBJECT
public:
    WimaPolygonContainer(QObject *parent = nullptr);


    QList<WimaPolygon*>& returnItems();

    void addItem(WimaPolygon* polygon);
    void removeItem(int itemIndex);
    void removeItem(WimaPolygon* polygon);
    QList<WimaPolygon*>& returnFlatList();
    int count(void);

signals:
    void itemListChanged(void);

private slots:
    void setFlatListDirty(void);

private:
    QList<WimaPolygon*> _itemList;
    QList<WimaPolygon*> _flatList;
    bool                _flatListDirty;
};

#endif // WIMAPOLYGONCONTAINER_H
