OGS
ModelTreeItem.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include "GeoLib/Station.h"
7
8#include "BaseItem.h"
9#include "Base/TreeItem.h"
10
16class ModelTreeItem : public TreeItem
17{
18public:
25 ModelTreeItem(const QList<QVariant>& data, TreeItem* parent,
26 BaseItem* item = nullptr);
27 ~ModelTreeItem() override { delete _item; }
30
32 BaseItem* getItem() const;
33
35 void setStation(GeoLib::Station* stn) { _stn = stn; }
36
38 void setItem( BaseItem* item ) { _item = item; }
39
40private:
43};
A BaseItem contains additional Information about a subtree in the StationTreeModel.
Definition BaseItem.h:22
A Station (observation site) is basically a Point with some additional information.
Definition Station.h:26
void setItem(BaseItem *item)
Associates a BaseItem with this item.
BaseItem * getItem() const
Returns the BaseItem associated with this item.
BaseItem * _item
GeoLib::Station * _stn
void setStation(GeoLib::Station *stn)
Associates a station object with this item.
~ModelTreeItem() override
ModelTreeItem(const QList< QVariant > &data, TreeItem *parent, BaseItem *item=nullptr)
GeoLib::Station * getStation()
Returns the station object from which this item has been constructed.
TreeItem(QList< QVariant > data, TreeItem *parent)
Definition TreeItem.cpp:12
virtual QVariant data(int column) const
Definition TreeItem.cpp:83