9#include "CubeViewport.h"
13#include <QApplication>
31#include "CubeDataThread.h"
32#include "IException.h"
38#include "PvlKeyword.h"
41#include "CubeStretch.h"
42#include "StretchTool.h"
44#include "UniversalGroundMap.h"
45#include "ViewportBuffer.h"
64 "Can not view NULL cube pointer",
67 else if(!
cube->isOpen()) {
68 throw IException(IException::Programmer,
69 "Can not view unopened cube",
89 if(
p_cube->hasGroup(
"Tracking")) {
93 p_trackingCube = NULL;
107 setAttribute(Qt::WA_DeleteOnClose);
108 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
109 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
110 viewport()->setObjectName(
"viewport");
111 viewport()->setCursor(QCursor(Qt::CrossCursor));
112 viewport()->installEventFilter(
this);
113 viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
115 setAttribute(Qt::WA_NoSystemBackground);
116 setFrameShadow(QFrame::Plain);
117 setFrameShape(QFrame::NoFrame);
118 setAutoFillBackground(
false);
174 QString cubeFileName =
p_cube->fileName();
175 p_whatsThisText = QString(
"<b>Function: </b>Viewport to ") + cubeFileName;
178 "<p><b>Cube Dimensions:</b> \
179 <blockQuote>Samples = " +
180 QString::number(
cube->sampleCount()) +
"<br>" +
182 QString::number(
cube->lineCount()) +
"<br>" +
184 QString::number(
cube->bandCount()) +
"</blockquote></p>";
220 p_image =
new QImage(viewport()->size(), QImage::Format_RGB32);
250 QAbstractScrollArea::show();
263 double progress = 0.0;
264 bool completed =
false;
286 int realProgress = (int)(progress * 100.0);
294 else if(realProgress == 100) {
369 delete p_trackingCube;
370 p_trackingCube = NULL;
384 delete(*p_pixmapPaintRects)[rect];
394 delete(*p_knownStretches)[stretch];
395 (*p_knownStretches)[stretch] = NULL;
408 delete(*p_globalStretches)[stretch];
409 (*p_globalStretches)[stretch] = NULL;
433 return p_cube->sampleCount();
439 return p_cube->lineCount();
445 return p_cube->bandCount();
458 double ss, sl, es, el;
469 if(es >
cube()->sampleCount() + 0.5){
472 if(el >
cube()->lineCount() + 0.5){
486 if(ex > viewport()->width()){
487 ex = viewport()->width();
489 if(ey > viewport()->height()){
490 ey = viewport()->height();
492 QRect vpRect(sx, sy, ex - sx + 1, ey - sy + 1);
525 bool canClose =
true;
528 switch(QMessageBox::information(
this, tr(
"Confirm Save"),
529 tr(
"The cube [<font color='red'>%1</font>] contains unsaved changes. "
530 "Do you want to save the changes before exiting?").arg(
cube()->fileName()),
531 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel)) {
533 case QMessageBox::Save:
538 case QMessageBox::Discard:
543 case QMessageBox::Cancel:
593 if (viewport()->width() && viewport()->height()) {
595 double maxScale = max(viewport()->width(),viewport()->height());
596 if (
scale > maxScale) {
601 if (
scale < minScale) {
608 contentsToCube(horizontalScrollBar()->value(), verticalScrollBar()->value(),
642 viewport()->repaint();
671 viewport()->setUpdatesEnabled(
false);
673 bool wasEnabled =
false;
716 viewport()->setUpdatesEnabled(
true);
717 viewport()->update();
746 int panX = horizontalScrollBar()->value() - x;
747 int panY = verticalScrollBar()->value() - y;
798 double &sample,
double &line)
const {
815 double &sample,
double &line)
const {
816 x += horizontalScrollBar()->value();
817 x -= viewport()->width() / 2;
818 y += verticalScrollBar()->value();
819 y -= viewport()->height() / 2;
835 int &x,
int &y)
const {
836 x = (int)(sample *
p_scale + 0.5);
837 y = (int)(line *
p_scale + 0.5);
852 int &x,
int &y)
const {
854 x -= horizontalScrollBar()->value();
855 x += viewport()->width() / 2;
856 y -= verticalScrollBar()->value();
857 y += viewport()->height() / 2;
870 int x = horizontalScrollBar()->value() + dx;
872 dx = 1 - horizontalScrollBar()->value();
874 else if(x >= horizontalScrollBar()->maximum()) {
875 dx = horizontalScrollBar()->maximum() - horizontalScrollBar()->value();
879 int y = verticalScrollBar()->value() + dy;
881 dy = 1 - verticalScrollBar()->value();
883 else if(y >= verticalScrollBar()->maximum()) {
884 dy = verticalScrollBar()->maximum() - verticalScrollBar()->value();
888 if((dx == 0) && (dy == 0)){
894 verticalScrollBar()->value() + dy);
911 if(viewport()->signalsBlocked()) {
923 bool panQueued =
false;
962 viewport()->update();
985 QString cubeFileName =
p_cube->fileName();
986 QString str = QFileInfo(cubeFileName).fileName();
987 str += QString(
" @ ");
988 str += QString::number(
p_scale * 100.0);
989 str += QString(
"% ");
992 str += QString(
"(RGB = ");
993 str += QString::number(
p_red.band);
995 str += QString::number(
p_green.band);
997 str += QString::number(
p_blue.band);
1001 str += QString(
"(Gray = ");
1002 str += QString::number(
p_gray.band);
1003 str += QString(
")");
1011 parentWidget()->setWindowTitle(str);
1053 p_image =
new QImage(viewport()->size(), QImage::Format_RGB32);
1054 p_pixmap = QPixmap(viewport()->size());
1060 verticalScrollBar()->value());
1063 "<p><b>Viewport Dimensions:</b> \
1064 <blockQuote>Samples = " +
1065 QString::number(viewport()->width()) +
"<br>" +
1067 QString::number(viewport()->height()) +
"</blockquote></p>";
1073 viewport()->update();
1124 viewport()->repaint(rect);
1165 dataArea = QRect(
p_grayBuffer->bufferXYRect().intersected(rect));
1167 for(
int y = dataArea.top();
1168 !dataArea.isNull() && y <= dataArea.bottom();
1170 const vector< double > & line =
1173 if(line.size() == 0) {
1181 QRgb *rgb = (QRgb *)
p_image->scanLine(y);
1187 for(
int x = dataArea.left(); x <= dataArea.right(); x++) {
1189 int bufferX = x - bufferLeft;
1191 if(bufferX >= (
int)line.size()){
1203 double bufferVal = line.at(bufferX);
1207 int redPix = (int)(
redStretch.Map(bufferVal) + 0.5);
1208 int greenPix = (int)(
greenStretch.Map(bufferVal) + 0.5);
1209 int bluePix = (int)(
blueStretch.Map(bufferVal) + 0.5);
1210 rgb[x] = qRgb(redPix, greenPix, bluePix);
1227 "Buffer rects mismatched",
1236 "Buffer rects mismatched",
1240 dataArea = QRect(
p_redBuffer->bufferXYRect().intersected(rect));
1242 for(
int y = dataArea.top();
1243 !dataArea.isNull() && y <= dataArea.bottom();
1245 int bufferLine = y -
p_redBuffer->bufferXYRect().top();
1247 const vector<double> &redLine =
p_redBuffer->getLine(bufferLine);
1248 const vector<double> &greenLine =
p_greenBuffer->getLine(bufferLine);
1249 const vector<double> &blueLine =
p_blueBuffer->getLine(bufferLine);
1251 if((
int)redLine.size() < dataArea.width() ||
1252 (
int)greenLine.size() < dataArea.width() ||
1253 (
int)blueLine.size() < dataArea.width()) {
1255 "Empty buffer line",
1259 QRgb *rgb = (QRgb *)
p_image->scanLine(y);
1265 for(
int x = dataArea.left(); x <= dataArea.right(); x++) {
1270 rgb[x] = qRgb(redPix, greenPix, bluePix);
1276 if(!dataArea.isNull()){
1277 p.drawImage(dataArea.topLeft(), *
p_image, dataArea);
1297 int drawStartX = dx;
1298 int pixmapStartX = 0;
1299 if(drawStartX < 0) {
1304 int drawStartY = dy;
1305 int pixmapStartY = 0;
1312 int pixmapDrawWidth =
p_pixmap.width() - pixmapStartX + 1;
1313 int pixmapDrawHeight =
p_pixmap.height() - pixmapStartY + 1;
1316 QPixmap pixmapCopy =
p_pixmap.copy();
1319 painter.fillRect(rect, QBrush(
p_bgColor));
1320 painter.drawPixmap(drawStartX, drawStartY,
1322 pixmapStartX, pixmapStartY,
1323 pixmapDrawWidth, pixmapDrawHeight);
1331 xFillRect = QRect(QPoint(0, 0),
1336 xFillRect = QRect(QPoint(
p_pixmap.width() + dx, 0),
1343 yFillRect = QRect(QPoint(0, 0),
1348 yFillRect = QRect(QPoint(0,
p_pixmap.height() + dy),
1361 viewport()->update();
1377 PvlGroup cubeGrp(
"CubeDimensions");
1381 whatsThisObj += cubeGrp;
1384 PvlGroup viewportGrp(
"ViewportDimensions");
1387 whatsThisObj += viewportGrp;
1395 int iFilterSize = filterName.
size();
1399 PvlKeyword virtualKey(
"Virtual"), physicalKey(
"Physical"), filterNameKey;
1407 virtualKey +=
toString(iGreenBand);
1409 bandGrp += virtualKey;
1414 bandGrp += physicalKey;
1417 if(iRedBand <= iFilterSize) {
1418 filterNameKey += filterName[iRedBand-1];
1421 filterNameKey +=
"None";
1424 if(iGreenBand <= iFilterSize) {
1425 filterNameKey += filterName[iGreenBand-1];
1428 filterNameKey +=
"None";
1431 if(iBlueBand <= iFilterSize) {
1432 filterNameKey += filterName[iBlueBand-1];
1435 filterNameKey +=
"None";
1437 bandGrp += filterNameKey;
1448 if(iFilterSize && iGrayBand <= iFilterSize) {
1449 bandGrp +=
PvlKeyword(
"FilterName", filterName[iGrayBand-1]);
1454 double sl, ss, es, el;
1460 cubeAreaPvl += bandGrp;
1461 whatsThisObj += cubeAreaPvl;
1462 pWhatsThisPvl += whatsThisObj;
1481 pFilterNameKey =bandBinGrp.
findKeyword(
"FilterName") ;
1495 double & pdStartLine,
double & pdEndLine)
1498 if(pdStartSample < 1.0){
1499 pdStartSample = 1.0;
1501 if(pdStartLine < 1.0){
1506 viewportToCube(viewport()->width() - 1, viewport()->height() - 1, pdEndSample, pdEndLine);
1521 double sl, ss, es, el;
1527 int iFilterSize = filterNameKey.
size();
1535 sBandInfo =
"Bands(RGB) Virtual = " +
1536 QString::number(iRedBand) +
", ";
1537 sBandInfo += QString::number(iGreenBand) +
", ";
1538 sBandInfo += QString::number(iBlueBand) +
" ";
1540 sBandInfo +=
"Physical = " +
1541 QString::number(
p_cube->physicalBand(iRedBand)) +
", ";
1542 sBandInfo += QString::number(
p_cube->physicalBand(iGreenBand)) +
", ";
1543 sBandInfo += QString::number(
p_cube->physicalBand(iBlueBand));
1546 sBandInfo +=
"<br>FilterName = ";
1547 if(iRedBand <= iFilterSize) {
1548 sBandInfo += QString(filterNameKey[iRedBand-1]);
1551 sBandInfo +=
"None";
1555 if(iGreenBand <= iFilterSize) {
1556 sBandInfo += QString(filterNameKey[iGreenBand-1]);
1559 sBandInfo +=
"None";
1563 if(iBlueBand <= iFilterSize) {
1564 sBandInfo += QString(filterNameKey[iBlueBand-1]);
1567 sBandInfo +=
"None";
1574 sBandInfo =
"Band(Gray) Virtual = " + QString::number(iGrayBand) +
" ";
1576 sBandInfo +=
"Physical = " + QString::number(
p_cube->physicalBand(iGrayBand));
1578 if(iFilterSize && iGrayBand <= iFilterSize) {
1579 sBandInfo +=
"<br>FilterName = " + QString(filterNameKey[iGrayBand-1]);
1584 "<p><b>Visible Cube Area:</b><blockQuote> \
1585 Samples = " + QString::number(
int(ss + 0.5)) +
"-" +
1586 QString::number(
int(es + 0.5)) +
"<br> \
1587 Lines = " + QString::number(
int(sl + 0.5)) +
"-" +
1588 QString::number(
int(el + 0.5)) +
"<br> " +
1589 sBandInfo +
"</blockQuote></p>";
1592 setWhatsThis(fullWhatsThis);
1593 viewport()->setWhatsThis(fullWhatsThis);
1662 return p_gray.getStretch();
1668 return p_red.getStretch();
1680 return p_blue.getStretch();
1695 if(o == viewport()) {
1697 case QEvent::Enter: {
1698 viewport()->setMouseTracking(
true);
1703 case QEvent::MouseMove: {
1704 QMouseEvent *m = (QMouseEvent *) e;
1706 emit
mouseMove(m->pos(), (Qt::MouseButton)(m->button() +
1711 case QEvent::Leave: {
1712 viewport()->setMouseTracking(
false);
1717 case QEvent::MouseButtonPress: {
1718 QMouseEvent *m = (QMouseEvent *) e;
1720 (Qt::MouseButton)(m->button() + m->modifiers()));
1724 case QEvent::MouseButtonRelease: {
1725 QMouseEvent *m = (QMouseEvent *) e;
1727 (Qt::MouseButton)(m->button() + m->modifiers()));
1731 case QEvent::MouseButtonDblClick: {
1732 QMouseEvent *m = (QMouseEvent *) e;
1743 return QAbstractScrollArea::eventFilter(o, e);
1759 if(e->key() == Qt::Key_Plus) {
1764 else if(e->key() == Qt::Key_Minus) {
1769 else if(e->key() == Qt::Key_Up) {
1773 else if(e->key() == Qt::Key_Down) {
1777 else if(e->key() == Qt::Key_Left) {
1781 else if(e->key() == Qt::Key_Right) {
1785 else if ((e->key() == Qt::Key_C) &&
1786 QApplication::keyboardModifiers() &
1787 Qt::ControlModifier) {
1790 QFileInfo fileName =
p_cube->fileName();
1793 QClipboard *clipboard = QApplication::clipboard();
1794 clipboard->setText(fileName.absoluteFilePath());
1797 QAbstractScrollArea::keyPressEvent(e);
1809 QPoint g = QCursor::pos();
1810 QPoint v = viewport()->mapFromGlobal(g);
1817 if(v.x() >= viewport()->width()){
1820 if(v.y() >= viewport()->height()){
1834 QPoint g = QCursor::pos();
1835 return viewport()->mapFromGlobal(g);
1847 QPoint g = QCursor::pos();
1849 QPoint v = viewport()->mapFromGlobal(g);
1856 if(v.x() >= viewport()->width()){
1859 if(v.y() >= viewport()->height()){
1875 QPoint v = viewport()->mapToGlobal(g);
1888 viewport()->blockSignals(
true);
1890 verticalScrollBar()->setValue(1);
1891 verticalScrollBar()->setMinimum(1);
1893 verticalScrollBar()->setPageStep(viewport()->height() / 2);
1895 horizontalScrollBar()->setValue(1);
1896 horizontalScrollBar()->setMinimum(1);
1898 horizontalScrollBar()->setPageStep(viewport()->width() / 2);
1900 if(horizontalScrollBar()->value() != x || verticalScrollBar()->value() != y) {
1901 horizontalScrollBar()->setValue(x);
1902 verticalScrollBar()->setValue(y);
1906 QApplication::sendPostedEvents(viewport(), 0);
1907 viewport()->blockSignals(
false);
1947 delete(*p_knownStretches)[oldBand - 1];
1950 (*p_knownStretches)[oldBand - 1] =
new Stretch(
p_gray.getStretch());
1968 viewport()->repaint();
1975 delete(*p_knownStretches)[stretch];
1976 (*p_knownStretches)[stretch] = NULL;
1985 delete(*p_knownStretches)[index];
1988 (*p_knownStretches)[index] =
new Stretch(stretch);
2026 delete(*p_knownStretches)[oldBand - 1];
2029 (*p_knownStretches)[oldBand - 1] =
new Stretch(
p_red.getStretch());
2049 delete(*p_knownStretches)[oldBand - 1];
2052 (*p_knownStretches)[oldBand - 1] =
new Stretch(
p_green.getStretch());
2072 delete(*p_knownStretches)[oldBand - 1];
2075 (*p_knownStretches)[oldBand - 1] =
new Stretch(
p_blue.getStretch());
2108 stretch.
Parse(
string);
2120 stretch.
Parse(
string);
2132 stretch.
Parse(
string);
2144 stretch.
Parse(
string);
2189 p_gray.setStretch(stretch);
2193 p_red.setStretch(newRed);
2201 p_blue.setStretch(newBlue);
2204 viewport()->update();
2214 p_red.setStretch(stretch);
2222 viewport()->update();
2240 viewport()->update();
2250 p_blue.setStretch(stretch);
2258 viewport()->update();
2270 double sampScale = (double) viewport()->width() / (double)
cubeSamples();
2271 double lineScale = (double) viewport()->height() / (double)
cubeLines();
2272 double scale = sampScale < lineScale ? sampScale : lineScale;
2298 double scale = (double) viewport()->height() / (double)
cubeLines();
2313 double ss, sl, es, el;
2314 ss = (double)(rect.left()) - 1.;
2315 sl = (double)(rect.top()) - 1.;
2316 es = (double)(rect.right()) + 1.;
2317 el = (double)(rect.bottom()) + 1.;
2324 if(es >
cube()->sampleCount()){
2327 if(el >
cube()->lineCount()){
2342 if(ex > viewport()->width()){
2343 ex = viewport()->width();
2345 if(ey > viewport()->height()){
2346 ey = viewport()->height();
2348 QRect vpRect(sx, sy, ex - sx + 1, ey - sy + 1);
2378 QString trackingCubeName = trackingGroup.
findKeyword(
"Filename")[0];
2379 FileName trackingCubeFileName(cubeName.
path() +
"/" + trackingCubeName);
2392 viewport()->setCursor(cursor);
2396 CubeViewport::BandInfo::BandInfo() : band(1), stretch(NULL) {
2399 stretch->SetLis(0.0);
2400 stretch->SetLrs(0.0);
2401 stretch->SetHis(255.0);
2402 stretch->SetHrs(255.0);
2403 stretch->SetMinimum(0.0);
2404 stretch->SetMaximum(255.0);
Buffer for containing a three dimensional section of an image.
int Line(const int index=0) const
Returns the line position associated with a shape buffer index.
int LineDimension() const
Returns the number of lines in the shape buffer.
int SampleDimension() const
Returns the number of samples in the shape buffer.
int Sample(const int index=0) const
Returns the sample position associated with a shape buffer index.
Encapsulation of Cube I/O with Change Notifications.
IO Handler for Isis Cubes.
Stores stretch information for a cube.
const BandInfo & operator=(BandInfo other)
The BandInfo for the Cube.
~BandInfo()
Deconstructor.
CubeStretch getStretch() const
void setStretch(const Stretch &newStretch)
CubeStretch * stretch
The Stretch.
bool p_cubeShown
Is the cube visible?
void stretchGray(const QString &string)
Apply stretch pairs to gray band.
void getCubeArea(double &pdStartSample, double &pdEndSample, double &pdStartLine, double &pdEndLine)
Get Cube area corresponding to the viewport's dimension.
double bluePixel(int sample, int line)
Gets the blue pixel.
void updateScrollBars(int x, int y)
Update the scroll bar.
CubeViewport(Cube *cube, CubeDataThread *cdt=0, QWidget *parent=0)
Constructor for the CubeViewport.
Brick * p_pntBrick
Bricks for every color.
void stretchBlue(const QString &string)
Apply stretch pairs to blue bands.
Cube * p_cube
The cube associated with the viewport.
CubeStretch grayStretch() const
Return the gray band stretch.
void doneWithData(int, const Isis::Brick *)
Emitted when a brick is no longer needed, should only be sent to cube data thread.
void showEvent(QShowEvent *)
This method is called to initially show the viewport.
void getBandFilterName(PvlKeyword &pFilterNameKey)
Get Band Filter name from the Isis cube label.
Brick * p_redBrick
Bricks for every color.
int cubeLines() const
Return the number of lines in the cube.
void discardChanges(CubeViewport *)
Emitted when changes should be discarded.
double greenPixel(int sample, int line)
Gets the green pixel.
ViewportBuffer * p_grayBuffer
Viewport Buffer to manage gray band.
int cubeBands() const
Return the number of bands in the cube.
QString p_whatsThisText
The text for What's this.
ViewportBuffer * p_redBuffer
Viewport Buffer to manage red band.
bool p_color
Is the viewport in color?
bool p_updatingBuffers
Changing RGB and need to not repaint pixmap?
void setCursorPosition(int x, int y)
Set the cursor position to x/y in the viewport.
QList< QRect * > * p_pixmapPaintRects
A list of rects that the viewport buffers have requested painted.
CubeStretch redStretch() const
Return the red band stretch.
void scaleChanged()
Emitted when zoom factor changed just before the repaint event.
bool p_thisOwnsCubeData
if true then this owns the CubeDataThread, and should thus delete it
void setCube(Cube *cube)
This method sets the viewports cube.
virtual void resizeEvent(QResizeEvent *e)
The viewport is being resized.
virtual void paintEvent(QPaintEvent *e)
Repaint the viewport.
void contentsToCube(int x, int y, double &sample, double &line) const
Turns contents to a cube.
QSize sizeHint() const
Make viewports show up as 512 by 512.
void changeCursor(QCursor cursor)
Allows users to change the cursor type on the viewport.
Projection * p_projection
The projection from the cube.
void updateWhatsThis()
Update the What's This text.
virtual bool eventFilter(QObject *o, QEvent *e)
Event filter to watch for mouse events on viewport.
bool cursorInside() const
Is cursor inside viewport.
QPoint cursorPosition() const
Return the cursor position in the viewport.
virtual ~CubeViewport()
Deconstructor for the Cubeviewport.
virtual void viewRGB(int redBand, int greenBand, int blueBand)
View cube as color.
int p_comboIndex
Current element chosen from combo box.
double fitScaleHeight() const
Determine the scale of cube in heighth to fit in the viewport.
void paintPixmapRects()
Goes through the list of requested paints, from the viewport buffer, and paints them.
int cubeSamples() const
Return the number of samples in the cube.
void mouseDoubleClick(QPoint)
Emitted when double click happens.
void progressComplete()
Emitted when the current progress is complete (100)
void stretchKnownGlobal()
List<Tool *> p This stretches to the global stretch.
QPixmap p_pixmap
The qpixmap.
void stretchGreen(const QString &string)
Apply stretch pairs to green bands.
void scrollContentsBy(int dx, int dy)
Scroll the viewport contents by dx/dy screen pixels.
Brick * p_grnBrick
Bricks for every color.
QString p_viewportWhatsThisText
The text for the viewport's what's this.
double grayPixel(int sample, int line)
Gets the gray pixel.
Cube * trackingCube() const
void setTrackingCube()
Finds the Tracking group from p_cube and stores the tracking cube name so that we can grab it in Adva...
void cubeChanged(bool changed)
This method is called when the cube has changed or changes have been finalized.
void cubeToContents(double sample, double line, int &x, int &y) const
Turns a cube into contents.
bool p_saveEnabled
Has the cube changed?
QString p_cubeWhatsThisText
The text for the cube's What's this.
virtual void keyPressEvent(QKeyEvent *e)
Process arrow keystrokes on cube.
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
QColor p_bgColor
The color to paint the background of the viewport.
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
void mouseButtonRelease(QPoint, Qt::MouseButton)
Emitted when mouse button released.
BandInfo p_blue
Blue band info.
void mouseButtonPress(QPoint, Qt::MouseButton)
Emitted when mouse button pressed.
void mouseLeave()
Emitted when the mouse leaves the viewport.
double fitScale() const
Determine the scale that causes the full cube to fit in the viewport.
CubeDataThread * p_cubeData
Does all the cube I/O.
void stretchRed(const QString &string)
Apply stretch pairs to red bands.
bool confirmClose()
This method should be called during a close event that would cause this viewport to close.
Brick * p_bluBrick
Bricks for every color.
CubeStretch greenStretch() const
Return the green band stretch.
BandInfo p_green
Green band info.
void saveChanges(CubeViewport *)
Emitted when changes should be saved.
void setScale(double scale)
Change the scale of the cube to the given parameter value.
void forgetStretches()
Resets all remembered stretches.
Camera * p_camera
The camera from the cube.
ViewportBuffer * p_greenBuffer
Viewport Buffer to manage green band.
QTimer * p_progressTimer
Activated to update progress bar.
QImage * p_image
The qimage.
void paintPixmap()
Paint the whole pixmap.
void getAllWhatsThisInfo(Pvl &pWhatsThisPvl)
Get All WhatsThis info - viewport, cube, area in PVL format.
BandInfo p_gray
Gray band info.
void mouseEnter()
Emitted when the mouse enters the viewport.
int p_comboCount
Number of elements in band bin combo box.
double redPixel(int sample, int line)
Gets the red pixel.
void enableProgress()
This restarts the progress bar.
virtual void viewGray(int band)
View cube as gray.
BandInfo p_red
Red band info.
void windowTitleChanged()
Emitted when window title changes.
UniversalGroundMap * p_groundMap
The universal ground map from the cube.
void scrollBy(int dx, int dy)
Move the scrollbars by dx/dy screen pixels.
QVector< Stretch * > * p_globalStretches
Global stretches for each stretched band.
void shiftPixmap(int dx, int dy)
Shifts the pixels on the pixmap without reading new data.
void progressChanged(int)
Emitted with current progress (0 to 100) when working.
QVector< Stretch * > * p_knownStretches
Stretches for each previously stretched band.
void onProgressTimer()
This updates the progress bar visually.
void screenPixelsChanged()
Emitted when cube pixels that should be on the screen change.
Brick * p_gryBrick
Bricks for every color.
void setAllBandStretches(Stretch stretch)
Sets a stretch for all bands.
void moveCursor(int x, int y)
Move the cursor by x,y if possible.
int p_cubeId
Cube ID given from cube data thread for I/O.
void cubeContentsChanged(QRect rect)
Calle dhwen the contents of the cube changes.
bool p_paintPixmap
Paint the pixmap?
void setCaption()
Change the caption on the viewport title bar.
double p_scale
The scale number.
virtual void cubeDataChanged(int cubeId, const Isis::Brick *)
This method updates the internal viewport buffer based on changes in cube DN values.
void mouseMove(QPoint)
Emitted when the mouse moves.
double fitScaleWidth() const
Determine the scale of cube in the width to fit in the viewport.
CubeStretch blueStretch() const
Return the blue band stretch.
void center(int x, int y)
Bring the cube pixel under viewport x/y to the center.
ViewportBuffer * p_blueBuffer
Viewport Buffer to manage blue band.
void bufferUpdated(QRect rect)
This method is called by ViewportBuffer upon successful completion of all operations and gives the ap...
File name manipulation and expansion.
QString path() const
Returns the path of the file name.
@ Programmer
This error is for when a programmer made an API call that was illegal.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
int size() const
Returns the number of values stored in this keyword.
Contains Pvl Groups and Pvl Objects.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
void CopyPairs(const Stretch &other)
Copies the stretch pairs from another Stretch object, but maintains special pixel values.
void Parse(const QString &pairs)
Parses a string of the form "i1:o1 i2:o2...iN:oN" where each i:o represents an input:output pair.
void SetNull(const double value)
Sets the mapping for NULL pixels.
int Pairs() const
Returns the number of stretch pairs.
Reads and stores visible DN values.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Namespace for the standard library.