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
15namespace Isis {
26 DisplayProperties(displayName, parent) {
27
28 // set all of the defaults to prevent unwanted change signals from
29 // being emitted later.
30 setShowFill(true);
31 setShowOutline(true);
32 setShowDNs(false);
33
34 setValue(Color, QVariant::fromValue(randomColor()));
35 }
36
37
40 ImageDisplayProperties::~ImageDisplayProperties() {
41 }
42
43
49 // Gives a random number between 0 and 255
50 int red = 0;
51 int green = 0;
52 int blue = 0;
53
54 // Generate dark
55 while(red + green + blue < 300) {
56 red = rand() % 256;
57 green = rand() % 256;
58 blue = rand() % 256;
59 }
60
61 return QColor(red, green, blue, 60);
62 }
63
64
68 void ImageDisplayProperties::setColor(QColor newColor) {
69 setValue(Color, QVariant::fromValue(newColor));
70 }
71
72
77 setValue(Selected, newValue);
78 }
79
80
85 setValue(ShowDNs, newValue);
86 }
87
88
93 setValue(ShowFill, newValue);
94 }
95
96
101 setValue(ShowLabel, newValue);
102 }
103
104
109 setValue(ShowOutline, newValue);
110 }
111}
112
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.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16