Isis 3 Programmer Reference
AbstractImageItem.cpp
1 #include "IsisDebug.h"
2 
3 #include "AbstractImageItem.h"
4 
5 #include <iostream>
6 
7 #include <QPair>
8 #include <QString>
9 #include <QVariant>
10 
11 #include "ControlNet.h"
12 
13 
14 namespace Isis {
15  AbstractImageItem::AbstractImageItem(QString imageSerial, ControlNet *net,
16  int avgCharWidth, AbstractTreeItem *parent)
17  : AbstractTreeItem(parent) {
18  m_imageAndNet = new QPair<QString, ControlNet *>(imageSerial, net);
19  calcDataWidth(avgCharWidth);
20  }
21 
22 
23  AbstractImageItem::~AbstractImageItem() {
24  if (m_imageAndNet) {
25  delete m_imageAndNet;
26  }
27  m_imageAndNet = NULL;
28  }
29 
30 
31  QVariant AbstractImageItem::getData() const {
32  if (m_imageAndNet) {
33  return QVariant(m_imageAndNet->first);
34  }
35  return QVariant();
36  }
37 
38 
39  QVariant AbstractImageItem::getData(QString columnTitle) const {
40  return QVariant();
41  }
42 
43 
44  void AbstractImageItem::setData(QString const &columnTitle,
45  QString const &newData) {
46  }
47 
48 
49  bool AbstractImageItem::isDataEditable(QString columnTitle) const {
50  return false;
51  }
52 
53 
54  void AbstractImageItem::deleteSource() { }
55 
56 
57  AbstractTreeItem::InternalPointerType AbstractImageItem::getPointerType() const {
58  return AbstractTreeItem::ImageAndNet;
59  }
60 
61 
62  void *AbstractImageItem::getPointer() const {
63  return m_imageAndNet;
64  }
65 
66 
67  bool AbstractImageItem::hasImage(QString imageSerial) const {
68  if(!m_imageAndNet) {
69  return false;
70  }
71  return (QString::compare(m_imageAndNet->first, imageSerial) == 0) ||
72  AbstractTreeItem::hasImage(imageSerial);
73  }
74 
75 
81 }
virtual void sourceDeleted()
This method is required to be implemented by the parent AbstractTreeItem class, but for this it&#39;s a N...
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31