9#include "MdiCubeViewport.h"
19#include "RubberBandTool.h"
20#include "StretchTool.h"
28 MdiCubeViewport::MdiCubeViewport(Cube *cube, CubeDataThread * cdt,
29 QWidget *parent) : CubeViewport(cube, cdt, parent) {
32 QString unlinkedIcon = FileName(
"$ISISROOT/appdata/images/icons/unlinked.png").expanded();
33 static QIcon unlinked(unlinkedIcon);
34 parentWidget()->setWindowIcon(unlinked);
38 MdiCubeViewport::~MdiCubeViewport() {
47 void MdiCubeViewport::registerTool(
Tool *tool) {
48 p_toolList.push_back(tool);
58 void MdiCubeViewport::setLinked(
bool b) {
59 if(!parentWidget() || !parentWidget()->parentWidget())
62 QString unlinkedIcon =
FileName(
"$ISISROOT/appdata/images/icons/unlinked.png").
expanded();
63 static QIcon unlinked(unlinkedIcon);
64 QString linkedIcon =
FileName(
"$ISISROOT/appdata/images/icons/linked.png").
expanded();
65 static QIcon linked(linkedIcon);
73 parentWidget()->parentWidget()->setWindowIcon(linked);
76 parentWidget()->parentWidget()->setWindowIcon(unlinked);
94 void MdiCubeViewport::paintEvent(QPaintEvent *e) {
95 CubeViewport::paintEvent(e);
97 QPainter painter(viewport());
98 painter.drawPixmap(0, 0, p_pixmap);
99 emit viewportUpdated();
102 for(
int i = 0; i < p_toolList.size(); i++) {
103 p_toolList[i]->paintViewport(
this, &painter);
110 void MdiCubeViewport::viewGray(
int band) {
111 CubeViewport::viewGray(band);
113 for(
int i = 0; i < p_toolList.size(); i++)
114 p_toolList[i]->updateTool();
118 void MdiCubeViewport::viewRGB(
int rband,
int gband,
int bband) {
119 CubeViewport::viewRGB(rband, gband, bband);
121 for(
int i = 0; i < p_toolList.size(); i++)
122 p_toolList[i]->updateTool();
127 if(buffer == grayBuffer()) {
128 emit requestRestretch(
this, (
int)StretchTool::Gray);
130 else if(buffer == redBuffer()) {
131 emit requestRestretch(
this, (
int)StretchTool::Red);
133 else if(buffer == greenBuffer()) {
134 emit requestRestretch(
this, (
int)StretchTool::Green);
136 else if(buffer == blueBuffer()) {
137 emit requestRestretch(
this, (
int)StretchTool::Blue);
File name manipulation and expansion.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Reads and stores visible DN values.
This is free and unencumbered software released into the public domain.
Namespace for the standard library.