USGS

Isis 3.0 Object Programmers' Reference

Home

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