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 
True if the cube should show a fill area if possible (bool)
This class is designed to serialize QColor in a human-readable form.
Definition: Color.h:20
void setShowDNs(bool)
Change the visibility of DNs associated with this cube.
ImageDisplayProperties(QString displayName, QObject *parent=NULL)
ImageDisplayProperties constructor.
True if the cube should be outlined (bool)
void setSelected(bool)
Change the selected state associated with this cube.
True if the cube should show DN values if possible (bool)
True if the cube should show its display name (bool)
void setShowLabel(bool)
Change the visibility of the display name associated with this cube.
void setColor(QColor newColor)
Change the color associated with this cube.
void setValue(int prop, QVariant value)
This is the generic mutator for properties.
void setShowOutline(bool)
Change the visibility of the outline associated with this cube.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
The selection state of this cube (bool)
Manage a stack of content handlers for reading XML files.
static QColor randomColor()
Creates and returns a random color for the intial color of the footprint polygon. ...
void setShowFill(bool)
Change the visibility of the fill area associated with this cube.