Loading [MathJax]/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
ImageDisplayProperties.cpp
2 
3 #include <QAction>
4 #include <QBitArray>
5 #include <QBuffer>
6 #include <QColorDialog>
7 #include <QDebug>
8 #include <QInputDialog>
9 #include <QMap>
10 #include <QVariant>
11 
12 #include "FileName.h"
13 #include "Pvl.h"
14 #include "XmlStackedHandlerReader.h"
15 
16 namespace Isis {
27  DisplayProperties(displayName, parent) {
28 
29  // set all of the defaults to prevent unwanted change signals from
30  // being emitted later.
31  setShowFill(true);
32  setShowOutline(true);
33  setShowDNs(false);
34 
35  setValue(Color, QVariant::fromValue(randomColor()));
36  }
37 
38 
40  QObject *parent) : DisplayProperties(xmlReader, parent) {
41  }
42 
43 
46  ImageDisplayProperties::~ImageDisplayProperties() {
47  }
48 
49 
55  // Gives a random number between 0 and 255
56  int red = 0;
57  int green = 0;
58  int blue = 0;
59 
60  // Generate dark
61  while(red + green + blue < 300) {
62  red = rand() % 256;
63  green = rand() % 256;
64  blue = rand() % 256;
65  }
66 
67  return QColor(red, green, blue, 60);
68  }
69 
70 
74  void ImageDisplayProperties::setColor(QColor newColor) {
75  setValue(Color, QVariant::fromValue(newColor));
76  }
77 
78 
83  setValue(Selected, newValue);
84  }
85 
86 
90  void ImageDisplayProperties::setShowDNs(bool newValue) {
91  setValue(ShowDNs, newValue);
92  }
93 
94 
99  setValue(ShowFill, newValue);
100  }
101 
102 
107  setValue(ShowLabel, newValue);
108  }
109 
110 
115  setValue(ShowOutline, newValue);
116  }
117 }
118 
Isis::Color
This class is designed to serialize QColor in a human-readable form.
Definition: Color.h:26
Isis::ImageDisplayProperties::setSelected
void setSelected(bool)
Change the selected state associated with this cube.
Definition: ImageDisplayProperties.cpp:82
Isis::ImageDisplayProperties::ShowOutline
@ ShowOutline
True if the cube should be outlined (bool)
Definition: ImageDisplayProperties.h:105
Isis::ImageDisplayProperties::randomColor
static QColor randomColor()
Creates and returns a random color for the intial color of the footprint polygon.
Definition: ImageDisplayProperties.cpp:54
Isis::ImageDisplayProperties::setColor
void setColor(QColor newColor)
Change the color associated with this cube.
Definition: ImageDisplayProperties.cpp:74
ImageDisplayProperties.h
Isis::DisplayProperties
Definition: DisplayProperties.h:34
Isis::ImageDisplayProperties::Selected
@ Selected
The selection state of this cube (bool)
Definition: ImageDisplayProperties.h:97
Isis::DisplayProperties::setValue
void setValue(int prop, QVariant value)
This is the generic mutator for properties.
Definition: DisplayProperties.cpp:131
Isis::ImageDisplayProperties::ShowLabel
@ ShowLabel
True if the cube should show its display name (bool)
Definition: ImageDisplayProperties.h:103
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::ImageDisplayProperties::setShowDNs
void setShowDNs(bool)
Change the visibility of DNs associated with this cube.
Definition: ImageDisplayProperties.cpp:90
Isis::ImageDisplayProperties::ImageDisplayProperties
ImageDisplayProperties(QString displayName, QObject *parent=NULL)
ImageDisplayProperties constructor.
Definition: ImageDisplayProperties.cpp:26
Isis::ImageDisplayProperties::ShowDNs
@ ShowDNs
True if the cube should show DN values if possible (bool)
Definition: ImageDisplayProperties.h:99
Isis::ImageDisplayProperties::setShowFill
void setShowFill(bool)
Change the visibility of the fill area associated with this cube.
Definition: ImageDisplayProperties.cpp:98
Isis::ImageDisplayProperties::ShowFill
@ ShowFill
True if the cube should show a fill area if possible (bool)
Definition: ImageDisplayProperties.h:101
Isis::ImageDisplayProperties::setShowOutline
void setShowOutline(bool)
Change the visibility of the outline associated with this cube.
Definition: ImageDisplayProperties.cpp:114
Isis::ImageDisplayProperties::setShowLabel
void setShowLabel(bool)
Change the visibility of the display name associated with this cube.
Definition: ImageDisplayProperties.cpp:106
QObject
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:36