1#include "ImageTreeWidgetItem.h"
7#include "DisplayProperties.h"
10#include "IException.h"
13#include "ImageTreeWidget.h"
14#include "SpecialPixel.h"
29 m_imageList = imageList;
33 connect(displayProps, SIGNAL(supportAdded(
int)),
this, SLOT(onDisplayPropertiesChanged()));
34 setText(NameColumn, displayProps->displayName());
36 setColumnValue(ResolutionColumn, m_image->
resolution());
40 setColumnValue(AspectRatioColumn, m_image->
aspectRatio());
45 setFlags(Qt::ItemIsEnabled |
46 Qt::ItemIsUserCheckable |
47 Qt::ItemIsSelectable |
48 Qt::ItemIsDragEnabled |
49 Qt::ItemIsDropEnabled);
55 ImageTreeWidgetItem::~ImageTreeWidgetItem() {
59 Image *ImageTreeWidgetItem::image() {
64 QString ImageTreeWidgetItem::imageListName()
const {
65 return m_imageList->
name();
69 void ImageTreeWidgetItem::forgetImage() {
74 void ImageTreeWidgetItem::update(
bool save) {
80 displayProps->
setShowFill(checkState(FootprintColumn));
83 displayProps->setShowOutline(checkState(OutlineColumn));
86 displayProps->setShowDNs(checkState(ImageColumn));
89 displayProps->setShowLabel(checkState(LabelColumn));
92 displayProps->setSelected(isSelected() || parent()->isSelected());
97 setBackground(NameColumn,
103 setCheckState(FootprintColumn,
107 setCheckState(OutlineColumn,
111 setCheckState(ImageColumn,
115 setCheckState(LabelColumn,
118 bool displaySelected =
122 if (displaySelected && !isSelected() && !parent()->isSelected()) {
125 else if (!displaySelected && (isSelected() || parent()->isSelected())) {
127 parent()->setSelected(
false);
135 Qt::CheckState ImageTreeWidgetItem::toCheck(QVariant var) {
139 return Qt::Unchecked;
143 QString ImageTreeWidgetItem::treeColumnToString(TreeColumn column) {
147 case FootprintColumn:
156 case ResolutionColumn:
158 case EmissionAngleColumn:
159 return "Emission Angle";
160 case IncidenceAngleColumn:
161 return "Incidence Angle";
162 case PhaseAngleColumn:
163 return "Phase Angle";
164 case AspectRatioColumn:
165 return "Aspect Ratio";
166 case SampleResolutionColumn:
167 return "Sample Resolution";
168 case LineResolutionColumn:
169 return "Line Resolution";
170 case NorthAzimuthColumn:
171 return "North Azimuth";
178 "Invalid tree column passed to treeColumnToString", _FILEINFO_);
182 void ImageTreeWidgetItem::onDisplayPropertiesChanged() {
183 ImageTreeWidget *tree = qobject_cast<ImageTreeWidget *>(treeWidget());
186 tree->enqueueReadDisplayProperties(
this);
194 void ImageTreeWidgetItem::setColumnValue(TreeColumn column,
double value) {
196 setText(column, QString::number(value));
201 bool ImageTreeWidgetItem::operator<(
const QTreeWidgetItem &other)
const {
202 int column = treeWidget()->sortColumn();
204 switch((TreeColumn)column) {
205 case FootprintColumn:
210 return text(column) < other.text(column);
212 case EmissionAngleColumn:
213 case IncidenceAngleColumn:
214 case PhaseAngleColumn:
215 case ResolutionColumn:
216 case AspectRatioColumn:
217 case SampleResolutionColumn:
218 case LineResolutionColumn:
219 case NorthAzimuthColumn:
220 return text(column).toDouble() <
221 other.text(column).toDouble();
double degrees() const
Get the angle in units of Degrees.
void addSupport(int property)
Call this with every property you support, otherwise they will not communicate properly between widge...
@ Programmer
This error is for when a programmer made an API call that was illegal.
This is the GUI communication mechanism for cubes.
void setShowFill(bool)
Change the visibility of the fill area associated with this cube.
@ ShowLabel
True if the cube should show its display name (bool)
@ ShowFill
True if the cube should show a fill area if possible (bool)
@ ShowDNs
True if the cube should show DN values if possible (bool)
@ Selected
The selection state of this cube (bool)
@ Color
The color of the cube, default randomized (QColor)
@ ShowOutline
True if the cube should be outlined (bool)
This represents a cube in a project-based GUI interface.
Angle incidenceAngle() const
Get the incidence angle of this image, as calculated and attached by camstats.
Angle phaseAngle() const
Get the phase angle of this image, as calculated and attached by camstats.
Angle emissionAngle() const
Get the emission angle of this image, as calculated and attached by camstats.
double lineResolution() const
Get the line resolution of this image, as calculated and attached by camstats.
double aspectRatio() const
Get the aspect ratio of this image, as calculated and attached by camstats.
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Angle northAzimuth() const
Get the north azimuth of this image, as calculated and attached by camstats.
double resolution() const
Get the resolution of this image, as calculated and attached by camstats.
double sampleResolution() const
Get the sample resolution of this image, as calculated and attached by camstats.
Internalizes a list of images and allows for operations on the entire list.
QString name() const
Get the human-readable name of this image list.
This is free and unencumbered software released into the public domain.
bool IsSpecial(const double d)
Returns if the input pixel is special.