-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayerGroup.cpp
More file actions
42 lines (37 loc) · 973 Bytes
/
layerGroup.cpp
File metadata and controls
42 lines (37 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//LayerGroup.cpp
#include "LayerGroup.h"
CLayerGroup::CLayerGroup(int layerGroupId, std::string layerGroupName, int layerGroupSelected, int layerGroupIsBase)
{
m_layerGroupId= layerGroupId;
m_name = QString::fromStdString( layerGroupName );
m_isSelected = layerGroupSelected;
m_isBase = layerGroupIsBase;
}
CLayerGroup::~CLayerGroup()
{
//Delete all layers
for (CLayer* layer : m_layers)
delete layer;
m_layers.clear();
}
void CLayerGroup::addLayer(CLayer* pLayer)
{
m_layers.push_back(pLayer);
}
bool CLayerGroup::isBaseLayerGroup() const
{
return m_isBase;
}
void CLayerGroup::getLayers(QVector<LayerData>& layers)
{
//Iterate through the layers to fill up layer data instances
for (CLayer* layer : m_layers)
{
LayerData ld;
ld.groupId = m_layerGroupId;
ld.groupName = m_name;
ld.isBaseGroup = m_isBase;
layer->getLayerData(ld);
layers.append(ld);
}
}