20 #include "IsisDebug.h" 25 #include <QApplication> 27 #include <QCloseEvent> 34 #include <QMessageBox> 35 #include <QMouseEvent> 43 #include "CubeDataThread.h" 75 "Can not view NULL cube pointer",
80 "Can not view unopened cube",
104 p_trackingCube = NULL;
118 setAttribute(Qt::WA_DeleteOnClose);
119 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
120 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
121 viewport()->setObjectName(
"viewport");
122 viewport()->setCursor(QCursor(Qt::CrossCursor));
123 viewport()->installEventFilter(
this);
124 viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
126 setAttribute(Qt::WA_NoSystemBackground);
127 setFrameShadow(QFrame::Plain);
128 setFrameShape(QFrame::NoFrame);
129 setAutoFillBackground(
false);
186 p_whatsThisText = QString(
"<b>Function: </b>Viewport to ") + cubeFileName;
189 "<p><b>Cube Dimensions:</b> \ 190 <blockQuote>Samples = " +
231 p_image =
new QImage(viewport()->size(), QImage::Format_RGB32);
261 QAbstractScrollArea::show();
274 double progress = 0.0;
275 bool completed =
false;
297 int realProgress = (int)(progress * 100.0);
305 else if(realProgress == 100) {
380 delete p_trackingCube;
381 p_trackingCube = NULL;
395 delete(*p_pixmapPaintRects)[rect];
405 delete(*p_knownStretches)[stretch];
406 (*p_knownStretches)[stretch] = NULL;
419 delete(*p_globalStretches)[stretch];
420 (*p_globalStretches)[stretch] = NULL;
469 double ss, sl, es, el;
480 if(es >
cube()->sampleCount() + 0.5){
483 if(el >
cube()->lineCount() + 0.5){
497 if(ex > viewport()->width()){
498 ex = viewport()->width();
500 if(ey > viewport()->height()){
501 ey = viewport()->height();
503 QRect vpRect(sx, sy, ex - sx + 1, ey - sy + 1);
536 bool canClose =
true;
539 switch(QMessageBox::information(
this, tr(
"Confirm Save"),
540 tr(
"The cube [<font color='red'>%1</font>] contains unsaved changes. " 541 "Do you want to save the changes before exiting?").arg(
cube()->fileName()),
542 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel)) {
544 case QMessageBox::Save:
549 case QMessageBox::Discard:
554 case QMessageBox::Cancel:
604 if (viewport()->width() && viewport()->height()) {
606 double maxScale = max(viewport()->width(),viewport()->height());
607 if (
scale > maxScale) {
612 if (
scale < minScale) {
619 contentsToCube(horizontalScrollBar()->value(), verticalScrollBar()->value(),
653 viewport()->repaint();
682 viewport()->setUpdatesEnabled(
false);
684 bool wasEnabled =
false;
727 viewport()->setUpdatesEnabled(
true);
728 viewport()->update();
757 int panX = horizontalScrollBar()->value() - x;
758 int panY = verticalScrollBar()->value() - y;
809 double &sample,
double &line)
const {
826 double &sample,
double &line)
const {
827 x += horizontalScrollBar()->value();
828 x -= viewport()->width() / 2;
829 y += verticalScrollBar()->value();
830 y -= viewport()->height() / 2;
846 int &x,
int &y)
const {
847 x = (int)(sample *
p_scale + 0.5);
848 y = (int)(line *
p_scale + 0.5);
863 int &x,
int &y)
const {
865 x -= horizontalScrollBar()->value();
866 x += viewport()->width() / 2;
867 y -= verticalScrollBar()->value();
868 y += viewport()->height() / 2;
881 int x = horizontalScrollBar()->value() + dx;
883 dx = 1 - horizontalScrollBar()->value();
885 else if(x >= horizontalScrollBar()->maximum()) {
886 dx = horizontalScrollBar()->maximum() - horizontalScrollBar()->value();
890 int y = verticalScrollBar()->value() + dy;
892 dy = 1 - verticalScrollBar()->value();
894 else if(y >= verticalScrollBar()->maximum()) {
895 dy = verticalScrollBar()->maximum() - verticalScrollBar()->value();
899 if((dx == 0) && (dy == 0)){
905 verticalScrollBar()->value() + dy);
922 if(viewport()->signalsBlocked()) {
934 bool panQueued =
false;
973 viewport()->update();
997 QString str = QFileInfo(cubeFileName).fileName();
998 str += QString(
" @ ");
999 str += QString::number(
p_scale * 100.0);
1000 str += QString(
"% ");
1003 str += QString(
"(RGB = ");
1005 str += QString(
",");
1007 str += QString(
",");
1009 str += QString(
")");
1012 str += QString(
"(Gray = ");
1014 str += QString(
")");
1022 parentWidget()->setWindowTitle(str);
1064 p_image =
new QImage(viewport()->size(), QImage::Format_RGB32);
1065 p_pixmap = QPixmap(viewport()->size());
1071 verticalScrollBar()->value());
1074 "<p><b>Viewport Dimensions:</b> \ 1075 <blockQuote>Samples = " +
1076 QString::number(viewport()->width()) +
"<br>" +
1078 QString::number(viewport()->height()) +
"</blockquote></p>";
1084 viewport()->update();
1135 viewport()->repaint(rect);
1178 for(
int y = dataArea.top();
1179 !dataArea.isNull() && y <= dataArea.bottom();
1181 const vector< double > & line =
1184 if(line.size() == 0) {
1192 QRgb *rgb = (QRgb *)
p_image->scanLine(y);
1194 for(
int x = dataArea.left(); x <= dataArea.right(); x++) {
1196 int bufferX = x - bufferLeft;
1198 if(bufferX >= (
int)line.size()){
1210 double bufferVal = line.at(bufferX);
1217 rgb[x] = qRgb(redPix, greenPix, bluePix);
1234 "Buffer rects mismatched",
1243 "Buffer rects mismatched",
1249 for(
int y = dataArea.top();
1250 !dataArea.isNull() && y <= dataArea.bottom();
1258 if((
int)redLine.size() < dataArea.width() ||
1259 (int)greenLine.size() < dataArea.width() ||
1260 (int)blueLine.size() < dataArea.width()) {
1262 "Empty buffer line",
1266 QRgb *rgb = (QRgb *)
p_image->scanLine(y);
1268 for(
int x = dataArea.left(); x <= dataArea.right(); x++) {
1273 rgb[x] = qRgb(redPix, greenPix, bluePix);
1279 if(!dataArea.isNull()){
1280 p.drawImage(dataArea.topLeft(), *
p_image, dataArea);
1300 int drawStartX = dx;
1301 int pixmapStartX = 0;
1302 if(drawStartX < 0) {
1307 int drawStartY = dy;
1308 int pixmapStartY = 0;
1315 int pixmapDrawWidth =
p_pixmap.width() - pixmapStartX + 1;
1316 int pixmapDrawHeight =
p_pixmap.height() - pixmapStartY + 1;
1319 QPixmap pixmapCopy =
p_pixmap.copy();
1322 painter.fillRect(rect, QBrush(
p_bgColor));
1323 painter.drawPixmap(drawStartX, drawStartY,
1325 pixmapStartX, pixmapStartY,
1326 pixmapDrawWidth, pixmapDrawHeight);
1334 xFillRect = QRect(QPoint(0, 0),
1339 xFillRect = QRect(QPoint(
p_pixmap.width() + dx, 0),
1346 yFillRect = QRect(QPoint(0, 0),
1351 yFillRect = QRect(QPoint(0,
p_pixmap.height() + dy),
1364 viewport()->update();
1380 PvlGroup cubeGrp(
"CubeDimensions");
1384 whatsThisObj += cubeGrp;
1387 PvlGroup viewportGrp(
"ViewportDimensions");
1390 whatsThisObj += viewportGrp;
1398 int iFilterSize = filterName.
size();
1402 PvlKeyword virtualKey(
"Virtual"), physicalKey(
"Physical"), filterNameKey;
1410 virtualKey +=
toString(iGreenBand);
1412 bandGrp += virtualKey;
1417 bandGrp += physicalKey;
1420 if(iRedBand <= iFilterSize) {
1421 filterNameKey += filterName[iRedBand-1];
1424 filterNameKey +=
"None";
1427 if(iGreenBand <= iFilterSize) {
1428 filterNameKey += filterName[iGreenBand-1];
1431 filterNameKey +=
"None";
1434 if(iBlueBand <= iFilterSize) {
1435 filterNameKey += filterName[iBlueBand-1];
1438 filterNameKey +=
"None";
1440 bandGrp += filterNameKey;
1451 if(iFilterSize && iGrayBand <= iFilterSize) {
1452 bandGrp +=
PvlKeyword(
"FilterName", filterName[iGrayBand-1]);
1457 double sl, ss, es, el;
1463 cubeAreaPvl += bandGrp;
1464 whatsThisObj += cubeAreaPvl;
1465 pWhatsThisPvl += whatsThisObj;
1484 pFilterNameKey =bandBinGrp.
findKeyword(
"FilterName") ;
1498 double & pdStartLine,
double & pdEndLine)
1501 if(pdStartSample < 1.0){
1502 pdStartSample = 1.0;
1504 if(pdStartLine < 1.0){
1509 viewportToCube(viewport()->width() - 1, viewport()->height() - 1, pdEndSample, pdEndLine);
1524 double sl, ss, es, el;
1530 int iFilterSize = filterNameKey.
size();
1538 sBandInfo =
"Bands(RGB) Virtual = " +
1539 QString::number(iRedBand) +
", ";
1540 sBandInfo += QString::number(iGreenBand) +
", ";
1541 sBandInfo += QString::number(iBlueBand) +
" ";
1543 sBandInfo +=
"Physical = " +
1549 sBandInfo +=
"<br>FilterName = ";
1550 if(iRedBand <= iFilterSize) {
1551 sBandInfo += QString(filterNameKey[iRedBand-1]);
1554 sBandInfo +=
"None";
1558 if(iGreenBand <= iFilterSize) {
1559 sBandInfo += QString(filterNameKey[iGreenBand-1]);
1562 sBandInfo +=
"None";
1566 if(iBlueBand <= iFilterSize) {
1567 sBandInfo += QString(filterNameKey[iBlueBand-1]);
1570 sBandInfo +=
"None";
1577 sBandInfo =
"Band(Gray) Virtual = " + QString::number(iGrayBand) +
" ";
1581 if(iFilterSize && iGrayBand <= iFilterSize) {
1582 sBandInfo +=
"<br>FilterName = " + QString(filterNameKey[iGrayBand-1]);
1587 "<p><b>Visible Cube Area:</b><blockQuote> \ 1588 Samples = " + QString::number(
int(ss + 0.5)) +
"-" +
1589 QString::number(
int(es + 0.5)) +
"<br> \ 1590 Lines = " + QString::number(
int(sl + 0.5)) +
"-" +
1591 QString::number(
int(el + 0.5)) +
"<br> " +
1592 sBandInfo +
"</blockQuote></p>";
1595 setWhatsThis(fullWhatsThis);
1596 viewport()->setWhatsThis(fullWhatsThis);
1698 if(o == viewport()) {
1700 case QEvent::Enter: {
1701 viewport()->setMouseTracking(
true);
1706 case QEvent::MouseMove: {
1707 QMouseEvent *m = (QMouseEvent *) e;
1709 emit
mouseMove(m->pos(), (Qt::MouseButton)(m->button() +
1714 case QEvent::Leave: {
1715 viewport()->setMouseTracking(
false);
1720 case QEvent::MouseButtonPress: {
1721 QMouseEvent *m = (QMouseEvent *) e;
1723 (Qt::MouseButton)(m->button() + m->modifiers()));
1727 case QEvent::MouseButtonRelease: {
1728 QMouseEvent *m = (QMouseEvent *) e;
1730 (Qt::MouseButton)(m->button() + m->modifiers()));
1734 case QEvent::MouseButtonDblClick: {
1735 QMouseEvent *m = (QMouseEvent *) e;
1746 return QAbstractScrollArea::eventFilter(o, e);
1762 if(e->key() == Qt::Key_Plus) {
1767 else if(e->key() == Qt::Key_Minus) {
1772 else if(e->key() == Qt::Key_Up) {
1776 else if(e->key() == Qt::Key_Down) {
1780 else if(e->key() == Qt::Key_Left) {
1784 else if(e->key() == Qt::Key_Right) {
1788 else if ((e->key() == Qt::Key_C) &&
1789 QApplication::keyboardModifiers() &
1790 Qt::ControlModifier) {
1796 QClipboard *clipboard = QApplication::clipboard();
1797 clipboard->setText(fileName.absoluteFilePath());
1800 QAbstractScrollArea::keyPressEvent(e);
1812 QPoint g = QCursor::pos();
1813 QPoint v = viewport()->mapFromGlobal(g);
1820 if(v.x() >= viewport()->width()){
1823 if(v.y() >= viewport()->height()){
1837 QPoint g = QCursor::pos();
1838 return viewport()->mapFromGlobal(g);
1850 QPoint g = QCursor::pos();
1852 QPoint v = viewport()->mapFromGlobal(g);
1859 if(v.x() >= viewport()->width()){
1862 if(v.y() >= viewport()->height()){
1878 QPoint v = viewport()->mapToGlobal(g);
1891 viewport()->blockSignals(
true);
1893 verticalScrollBar()->setValue(1);
1894 verticalScrollBar()->setMinimum(1);
1896 verticalScrollBar()->setPageStep(viewport()->height() / 2);
1898 horizontalScrollBar()->setValue(1);
1899 horizontalScrollBar()->setMinimum(1);
1901 horizontalScrollBar()->setPageStep(viewport()->width() / 2);
1903 if(horizontalScrollBar()->value() != x || verticalScrollBar()->value() != y) {
1904 horizontalScrollBar()->setValue(x);
1905 verticalScrollBar()->setValue(y);
1909 QApplication::sendPostedEvents(viewport(), 0);
1910 viewport()->blockSignals(
false);
1950 delete(*p_knownStretches)[oldBand - 1];
1971 viewport()->repaint();
1978 delete(*p_knownStretches)[stretch];
1979 (*p_knownStretches)[stretch] = NULL;
1988 delete(*p_knownStretches)[index];
1991 (*p_knownStretches)[index] =
new Stretch(stretch);
2029 delete(*p_knownStretches)[oldBand - 1];
2052 delete(*p_knownStretches)[oldBand - 1];
2075 delete(*p_knownStretches)[oldBand - 1];
2111 stretch.
Parse(
string);
2123 stretch.
Parse(
string);
2135 stretch.
Parse(
string);
2147 stretch.
Parse(
string);
2207 viewport()->update();
2225 viewport()->update();
2243 viewport()->update();
2261 viewport()->update();
2273 double sampScale = (double) viewport()->width() / (double)
cubeSamples();
2274 double lineScale = (double) viewport()->height() / (double)
cubeLines();
2275 double scale = sampScale < lineScale ? sampScale : lineScale;
2301 double scale = (double) viewport()->height() / (double)
cubeLines();
2316 double ss, sl, es, el;
2317 ss = (double)(rect.left()) - 1.;
2318 sl = (double)(rect.top()) - 1.;
2319 es = (double)(rect.right()) + 1.;
2320 el = (double)(rect.bottom()) + 1.;
2330 if(el >
cube()->lineCount()){
2345 if(ex > viewport()->width()){
2346 ex = viewport()->width();
2348 if(ey > viewport()->height()){
2349 ey = viewport()->height();
2351 QRect vpRect(sx, sy, ex - sx + 1, ey - sy + 1);
2381 QString trackingCubeName = trackingGroup.
findKeyword(
"Filename")[0];
2382 FileName trackingCubeFileName(cubeName.path() +
"/" + trackingCubeName);
2395 viewport()->setCursor(cursor);
2399 CubeViewport::BandInfo::BandInfo() : band(1), stretch(NULL) {
2402 stretch->SetLis(0.0);
2403 stretch->SetLrs(0.0);
2404 stretch->SetHis(255.0);
2405 stretch->SetHrs(255.0);
2406 stretch->SetMinimum(0.0);
2407 stretch->SetMaximum(255.0);
2427 ASSERT_PTR(stretch);
2434 *stretch = newStretch;
void setAllBandStretches(Stretch stretch)
Sets a stretch for all bands.
QTimer * p_progressTimer
Activated to update progress bar.
Stretch getStretch() const
QVector< Stretch *> * p_knownStretches
Stretches for each previously stretched band.
bool p_updatingBuffers
Changing RGB and need to not repaint pixmap?
Stretch redStretch() const
Return the red band stretch.
void progressComplete()
Emitted when the current progress is complete (100)
void progressChanged(int)
Emitted with current progress (0 to 100) when working.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
void shiftPixmap(int dx, int dy)
Shifts the pixels on the pixmap without reading new data.
int cubeLines() const
Return the number of lines in the cube.
Reads and stores visible DN values.
QPixmap p_pixmap
The qpixmap.
ViewportBuffer * p_grayBuffer
Viewport Buffer to manage gray band.
void scaleChanged()
Emitted when zoom factor changed just before the repaint event.
Brick * p_redBrick
Bricks for every color.
ViewportBuffer * p_greenBuffer
Viewport Buffer to manage green band.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Camera * p_camera
The camera from the cube.
int FindCubeId(const Cube *) const
Given a Cube pointer, return the cube ID associated with it.
File name manipulation and expansion.
BandInfo p_red
Red band info.
int cubeBands() const
Return the number of bands in the cube.
void stretchBlue(const QString &string)
Apply stretch pairs to blue bands.
Stretch greenStretch() const
Return the green band stretch.
void forgetStretches()
Resets all remembered stretches.
void stretchRed(const QString &string)
Apply stretch pairs to red bands.
double Map(const double value) const
Maps an input value to an output value based on the stretch pairs and/or special pixel mappings...
void updateWhatsThis()
Update the What's This text.
BandInfo p_green
Green band info.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
void mouseLeave()
Emitted when the mouse leaves the viewport.
bool HasProjection()
Checks to see if the camera object has a projection.
void getAllWhatsThisInfo(Pvl &pWhatsThisPvl)
Get All WhatsThis info - viewport, cube, area in PVL format.
void saveChanges(CubeViewport *)
Emitted when changes should be saved.
const std::vector< double > & getLine(int line)
Retrieves a line from the buffer.
void cubeToContents(double sample, double line, int &x, int &y) const
Turns a cube into contents.
Buffer for containing a three dimensional section of an image.
void getBandFilterName(PvlKeyword &pFilterNameKey)
Get Band Filter name from the Isis cube label.
void center(int x, int y)
Bring the cube pixel under viewport x/y to the center.
double currentProgress()
Returns the viewport buffer's loading progress.
Namespace for the standard library.
void SetBasePosition(const int start_sample, const int start_line, const int start_band)
This method is used to set the base position of the shape buffer.
void setScale(double scale)
Change the scale of the cube to the given parameter value.
void cubeContentsChanged(QRect rect)
Calle dhwen the contents of the cube changes.
void setCursorPosition(int x, int y)
Set the cursor position to x/y in the viewport.
bool isOpen() const
Test if a cube file has been opened/created.
QList< QRect *> * p_pixmapPaintRects
A list of rects that the viewport buffers have requested painted.
BandInfo p_blue
Blue band info.
double fitScale() const
Determine the scale that causes the full cube to fit in the viewport.
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
bool p_saveEnabled
Has the cube changed?
void discardChanges(CubeViewport *)
Emitted when changes should be discarded.
virtual void viewRGB(int redBand, int greenBand, int blueBand)
View cube as color.
int getBand()
Return the band associated with this viewport buffer.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
Projection * projection()
void mouseButtonPress(QPoint, Qt::MouseButton)
Emitted when mouse button pressed.
int LineDimension() const
Returns the number of lines in the shape buffer.
void updateScrollBars(int x, int y)
Update the scroll bar.
This error is for when a programmer made an API call that was illegal.
ViewportBuffer * p_blueBuffer
Viewport Buffer to manage blue band.
QRect bufferXYRect()
Returns a rect, in screen pixels, of the area this buffer covers.
int Pairs() const
Returns the number of stretch pairs.
void screenPixelsChanged()
Emitted when cube pixels that should be on the screen change.
Brick * p_bluBrick
Bricks for every color.
bool p_thisOwnsCubeData
if true then this owns the CubeDataThread, and should thus delete it
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
void resizedViewport()
Call this when the viewport is resized (not zoomed).
void paintPixmap()
Paint the whole pixmap.
Stretch grayStretch() const
Return the gray band stretch.
double greenPixel(int sample, int line)
Gets the green pixel.
bool p_color
Is the viewport in color?
double redPixel(int sample, int line)
Gets the red pixel.
bool enabled()
Returns whether the buffer is enabled (reading data) or not.
double grayPixel(int sample, int line)
Gets the gray pixel.
void windowTitleChanged()
Emitted when window title changes.
QString p_whatsThisText
The text for What's this.
void enable(bool enabled)
This turns on or off reading from the cube.
int Sample(const int index=0) const
Returns the sample position associated with a shape buffer index.
int size() const
Returns the number of values stored in this keyword.
double fitScaleWidth() const
Determine the scale of cube in the width to fit in the viewport.
void contentsToCube(int x, int y, double &sample, double &line) const
Turns contents to a cube.
void stretchKnownGlobal()
List<Tool *> p This stretches to the global stretch.
void doneWithData(int, const Isis::Brick *)
Emitted when a brick is no longer needed, should only be sent to cube data thread.
void CopyPairs(const Stretch &other)
Copies the stretch pairs from another Stretch object, but maintains special pixel values...
void moveCursor(int x, int y)
Move the cursor by x,y if possible.
bool hasGroup(const QString &group) const
Return if the cube has a specified group in the labels.
bool p_paintPixmap
Paint the pixmap?
void mouseDoubleClick(QPoint)
Emitted when double click happens.
bool confirmClose()
This method should be called during a close event that would cause this viewport to close...
Contains multiple PvlContainers.
Projection * p_projection
The projection from the cube.
void scaleChanged()
Call this when zoomed, re-reads visible area.
#define _FILEINFO_
Macro for the filename and line number.
void mouseMove(QPoint)
Emitted when the mouse moves.
int AddCube(const FileName &fileName, bool mustOpenReadWrite=false)
This method is designed to be callable from any thread before data is requested, though no known side...
A single keyword-value pair.
void bufferUpdated(QRect rect)
This method is called by ViewportBuffer upon successful completion of all operations and gives the ap...
BandInfo p_gray
Gray band info.
QSize sizeHint() const
Make viewports show up as 512 by 512.
Isis::Projection * Projection() const
Return the projection associated with the ground map (NULL implies none)
Stretch * stretch
The Stretch.
void enableProgress()
This restarts the progress bar.
int Line(const int index=0) const
Returns the line position associated with a shape buffer index.
virtual void resizeEvent(QResizeEvent *e)
The viewport is being resized.
void read(Blob &blob) const
This method will read data from the specified Blob object.
double bluePixel(int sample, int line)
Gets the blue pixel.
void mouseEnter()
Emitted when the mouse enters the viewport.
int p_comboCount
Number of elements in band bin combo box.
QString p_viewportWhatsThisText
The text for the viewport's what's this.
Encapsulation of Cube I/O with Change Notifications.
Container for cube-like labels.
void AddChangeListener()
You must call this method after connecting to the BrickChanged signal, otherwise you are not guarante...
bool working()
This tests if queued actions exist in the viewport buffer.
QPoint cursorPosition() const
Return the cursor position in the viewport.
PixelType pixelType() const
void fillBuffer(QRect rect)
This method will convert the rect to sample/line positions and read from the cube into the buffer...
virtual void viewGray(int band)
View cube as gray.
void getCubeArea(double &pdStartSample, double &pdEndSample, double &pdStartLine, double &pdEndLine)
Get Cube area corresponding to the viewport's dimension.
void scrollBy(int dx, int dy)
Move the scrollbars by dx/dy screen pixels.
Brick * p_grnBrick
Bricks for every color.
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
~BandInfo()
Deconstructor.
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...
int cubeSamples() const
Return the number of samples in the cube.
int SampleDimension() const
Returns the number of samples in the shape buffer.
QVector< Stretch *> * p_globalStretches
Global stretches for each stretched band.
void cubeChanged(bool changed)
This method is called when the cube has changed or changes have been finalized.
int p_comboIndex
Current element chosen from combo box.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Cube * trackingCube() const
int p_cubeId
Cube ID given from cube data thread for I/O.
void setBand(int band)
Sets the band to read from, the buffer will be re-read if the band changes.
virtual QString fileName() const
Returns the opened cube's filename.
void setStretch(const Stretch &newStretch)
UniversalGroundMap * p_groundMap
The universal ground map from the cube.
bool p_cubeShown
Is the cube visible?
virtual void cubeDataChanged(int cubeId, const Isis::Brick *)
This method updates the internal viewport buffer based on changes in cube DN values.
void stretchGreen(const QString &string)
Apply stretch pairs to green bands.
ViewportBuffer * p_redBuffer
Viewport Buffer to manage red band.
Namespace for ISIS/Bullet specific routines.
Isis::Camera * Camera() const
Return the camera associated with the ground map (NULL implies none)
virtual void paintEvent(QPaintEvent *e)
Repaint the viewport.
virtual int bandCount() const
Returns the number of virtual bands for the cube.
CubeDataThread * p_cubeData
Does all the cube I/O.
QString p_cubeWhatsThisText
The text for the cube's What's this.
void RemoveChangeListener()
You must call this method after disconnecting from the BrickChanged signal, otherwise bricks cannot b...
Cube * p_cube
The cube associated with the viewport.
virtual ~CubeViewport()
Deconstructor for the Cubeviewport.
const BandInfo & operator=(BandInfo other)
The BandInfo for the Cube.
void setCube(Cube *cube)
This method sets the viewports cube.
void setCaption()
Change the caption on the viewport title bar.
virtual void keyPressEvent(QKeyEvent *e)
Process arrow keystrokes on cube.
double fitScaleHeight() const
Determine the scale of cube in heighth to fit in the viewport.
void scrollContentsBy(int dx, int dy)
Scroll the viewport contents by dx/dy screen pixels.
Brick * p_pntBrick
Bricks for every color.
void onProgressTimer()
This updates the progress bar visually.
void stretchGray(const QString &string)
Apply stretch pairs to gray band.
Contains Pvl Groups and Pvl Objects.
void SetNull(const double value)
Sets the mapping for NULL pixels.
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
void changeCursor(QCursor cursor)
Allows users to change the cursor type on the viewport.
void pan(int deltaX, int deltaY)
Call this when the viewport is panned.
void addStretchAction()
When all current operations finish the cube viewport will be asked to do a stretch if you call this...
QColor p_bgColor
The color to paint the background of the viewport.
void setTrackingCube()
Finds the Tracking group from p_cube and stores the tracking cube name so that we can grab it in Adva...
virtual void SetBand(const int band)
Virtual method that sets the band number.
double p_scale
The scale number.
void showEvent(QShowEvent *)
This method is called to initially show the viewport.
void mouseButtonRelease(QPoint, Qt::MouseButton)
Emitted when mouse button released.
virtual int physicalBand(const int &virtualBand) const
This method will return the physical band number given a virtual band number.
Brick * p_gryBrick
Bricks for every color.
Stretch blueStretch() const
Return the blue band stretch.
virtual bool eventFilter(QObject *o, QEvent *e)
Event filter to watch for mouse events on viewport.
bool cursorInside() const
Is cursor inside viewport.
IO Handler for Isis Cubes.
void paintPixmapRects()
Goes through the list of requested paints, from the viewport buffer, and paints them.
QImage * p_image
The qimage.