1 #include "ImageTreeWidgetItem.h" 7 #include "DisplayProperties.h" 12 #include "ImageList.h" 13 #include "ImageTreeWidget.h" 29 m_imageList = imageList;
33 connect(displayProps, SIGNAL(supportAdded(
int)),
this, SLOT(onDisplayPropertiesChanged()));
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();
True if the cube should show a fill area if possible (bool)
QString name() const
Get the human-readable name of this image list.
Internalizes a list of images and allows for operations on the entire list.
QString displayName() const
Returns the display name.
True if the cube should be outlined (bool)
Angle emissionAngle() const
Get the emission angle of this image, as calculated and attached by camstats.
This error is for when a programmer made an API call that was illegal.
double degrees() const
Get the angle in units of Degrees.
True if the cube should show DN values if possible (bool)
True if the cube should show its display name (bool)
Angle phaseAngle() const
Get the phase angle of this image, as calculated and attached by camstats.
This is the GUI communication mechanism for cubes.
double sampleResolution() const
Get the sample resolution 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.
#define _FILEINFO_
Macro for the filename and line number.
bool IsSpecial(const double d)
Returns if the input pixel is special.
This represents a cube in a project-based GUI interface.
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.
void addSupport(int property)
Call this with every property you support, otherwise they will not communicate properly between widge...
double resolution() const
Get the resolution of this image, as calculated and attached by camstats.
Namespace for ISIS/Bullet specific routines.
The selection state of this cube (bool)
The color of the cube, default randomized (QColor)
double aspectRatio() const
Get the aspect ratio of this image, as calculated and attached by camstats.
Angle incidenceAngle() const
Get the incidence angle of this image, as calculated and attached by camstats.
void setShowFill(bool)
Change the visibility of the fill area associated with this cube.