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