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
16namespace 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
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
This class is designed to serialize QColor in a human-readable form.
Definition Color.h:26
void setValue(int prop, QVariant value)
This is the generic mutator for properties.
void setShowLabel(bool)
Change the visibility of the display name associated with this cube.
void setShowFill(bool)
Change the visibility of the fill area associated with this cube.
void setShowDNs(bool)
Change the visibility of DNs 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)
@ ShowOutline
True if the cube should be outlined (bool)
void setColor(QColor newColor)
Change the color associated with this cube.
void setShowOutline(bool)
Change the visibility of the outline associated with this cube.
ImageDisplayProperties(QString displayName, QObject *parent=NULL)
ImageDisplayProperties constructor.
void setSelected(bool)
Change the selected state associated with this cube.
static QColor randomColor()
Creates and returns a random color for the intial color of the footprint polygon.
Manage a stack of content handlers for reading XML files.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16