Vespucci  1.0.0
treeitem.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2015 Wright State University - All Rights Reserved
3  Daniel P. Foose - Maintainer/Lead Developer
4 
5  This file is part of Vespucci.
6 
7  Vespucci is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Vespucci is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Vespucci. If not, see <http://www.gnu.org/licenses/>.
19 *******************************************************************************/
20 #ifndef TREEITEM_H
21 #define TREEITEM_H
22 
23 #include <QList>
24 #include <QVariant>
26 class MapData;
27 class VespucciDataset;
28 class TreeItem
29 {
30 public:
31  enum ItemType{
33  };
34  TreeItem(TreeItem::ItemType type, QStringList &keys, QList<QVariant> &data, TreeItem *parent = 0);
35  ~TreeItem();
36  void appendChild(TreeItem *child);
37  void removeChild(TreeItem *child);
38  TreeItem *child(int row);
39  int childCount() const;
40  int columnCount() const;
41  QVariant data(int column) const;
42  int row() const;
44  QList<TreeItem*> child_items();
45  void ClearChildren();
46 
47  TreeItem::ItemType type() const;
48  QStringList keys() const;
49  const QString DatasetKey() const;
50  QStringList ChildNames() const;
51 
52  bool HasChild(const QString &name);
53 
54  void UpdateType(QString new_type);
55 
56 
57 
58 private:
59  QList<TreeItem*> child_items_;
60  QList<QVariant> item_data_;
61  TreeItem *parent_item_;
62 
68  QStringList keys_;
69 
73  TreeItem::ItemType type_;
74 
75 };
76 #endif //TREEITEM_H
void ClearChildren()
Definition: treeitem.cpp:88
TreeItem * child(int row)
Definition: treeitem.cpp:45
QStringList keys() const
Definition: treeitem.cpp:98
~TreeItem()
Definition: treeitem.cpp:30
The MapData class Class for processed map data. Images are created from this data.
Definition: mapdata.h:44
void removeChild(TreeItem *child)
Definition: treeitem.cpp:40
int row() const
Definition: treeitem.cpp:65
TreeItem::ItemType type() const
Definition: treeitem.cpp:93
The VespucciDataset class This is the main class for dealing with hyperspectral data. This handles the import and export of spectra, and the creation of maps. Images are handled by the MapData class. This class is intended to be allocated on the heap inside of a smart pointer, there is no copy constructor.
void UpdateType(QString new_type)
Definition: treeitem.cpp:82
int childCount() const
Definition: treeitem.cpp:50
TreeItem * parentItem()
Definition: treeitem.cpp:72
void appendChild(TreeItem *child)
Definition: treeitem.cpp:35
QStringList ChildNames() const
Definition: treeitem.cpp:108
const QString DatasetKey() const
Definition: treeitem.cpp:103
bool HasChild(const QString &name)
Definition: treeitem.cpp:116
QVariant data(int column) const
Definition: treeitem.cpp:60
QList< TreeItem * > child_items()
Definition: treeitem.cpp:77
int columnCount() const
Definition: treeitem.cpp:55
TreeItem(TreeItem::ItemType type, QStringList &keys, QList< QVariant > &data, TreeItem *parent=0)
Definition: treeitem.cpp:22