28 #include <QAbstractScrollArea>
43 class UniversalGroundMap;
141 void setStretch(
const Stretch &newStretch);
209 double &sample,
double &line)
const;
211 int &x,
int &y)
const;
213 double &sample,
double &line)
const;
215 int &x,
int &y)
const;
217 double redPixel(
int sample,
int line);
393 void getCubeArea(
double & pdStartSample,
double & pdEndSample,
394 double & pdStartLine,
double & pdEndLine);
431 void center(
int x,
int y);
432 void center(
double sample,
double line);
void setAllBandStretches(Stretch stretch)
Sets a stretch for all bands.
QTimer * p_progressTimer
Activated to update progress bar.
QVector< Stretch * > * p_knownStretches
Stretches for each previously stretched band.
Stretch redStretch() const
Return the red band stretch.
bool p_updatingBuffers
Changing RGB and need to not repaint pixmap?
void progressChanged(int)
Emitted with current progress (0 to 100) when working.
ViewportBuffer * grayBuffer()
Returns the gray viewport buffer (Will be NULL if in RGB mode.)
void viewportUpdated()
Emitted when viewport updated.
double fitScaleWidth() const
Determine the scale of cube in the width to fit in the viewport.
void shiftPixmap(int dx, int dy)
Shifts the pixels on the pixmap without reading new data.
UniversalGroundMap * universalGroundMap() const
Return the universal ground map associated with the cube (NULL implies none)
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.
Camera * p_camera
The camera from the cube.
Stretch greenStretch() const
Return the green band stretch.
ViewportBuffer * redBuffer()
Returns the red viewport buffer (Will be NULL if in Gray mode.)
BandInfo p_red
Red band info.
void stretchBlue(const QString &string)
Apply stretch pairs to blue bands.
void forgetStretches()
Resets all remembered stretches.
void stretchRed(const QString &string)
Apply stretch pairs to red bands.
bool isGray() const
Is the viewport shown in gray / b&w.
void updateWhatsThis()
Update the What's This text.
BandInfo p_green
Green band info.
bool isColor() const
Is the viewport shown in 3-band color.
QPixmap pixmap()
Returns the pixmap.
void mouseLeave()
Emitted when the mouse leaves the viewport.
void getAllWhatsThisInfo(Pvl &pWhatsThisPvl)
Get All WhatsThis info - viewport, cube, area in PVL format.
void saveChanges(CubeViewport *)
Emitted when changes should be saved.
bool cursorInside() const
Is cursor inside viewport.
int cubeSamples() const
Return the number of samples in the cube.
Buffer for containing a three dimensional section of an image.
void getBandFilterName(PvlKeyword &pFilterNameKey)
Get Band Filter name from the Isis cube label.
int greenBand() const
Return the green band currently viewed.
void center(int x, int y)
Bring the cube pixel under viewport x/y to the center.
void setScale(double scale)
Change the scale of the cube to the given parameter value.
void cubeContentsChanged(QRect rect)
Cube changed, repaint given area.
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.
BandInfo p_blue
Blue band info.
bool p_saveEnabled
Has the cube changed?
void discardChanges(CubeViewport *)
Emitted when changes should be discarded.
int redBand() const
Return the red band currently viewed.
virtual void viewRGB(int redBand, int greenBand, int blueBand)
View cube as color.
QPoint cursorPosition() const
Return the cursor position in the viewport.
Projection * projection() const
Return the projection associated with cube (NULL implies none)
Widget to display Isis cubes for qt apps.
void mouseButtonPress(QPoint, Qt::MouseButton)
Emitted when mouse button pressed.
void setComboCount(int count)
Sets the band bin combo box count.
void updateScrollBars(int x, int y)
Update the scroll bar.
ViewportBuffer * p_blueBuffer
Viewport Buffer to manage blue band.
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
void paintPixmap()
Paint the whole pixmap.
double greenPixel(int sample, int line)
Return the green pixel value at a sample/line.
bool p_color
Is the viewport in color?
double redPixel(int sample, int line)
Return the red pixel value at a sample/line.
void setComboIndex(int index)
Sets the band bin combo box index.
double grayPixel(int sample, int line)
Return the gray pixel value at a sample/line.
Stretch blueStretch() const
Return the blue band stretch.
void windowTitleChanged()
Emitted when window title changes.
int comboCount() const
Return the BandBin combo box count.
QString p_whatsThisText
The text for What's this.
Stretch grayStretch() const
Return the gray band stretch.
Base class for Map Projections.
Cube * cube() const
Return the cube associated with viewport.
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 moveCursor(int x, int y)
Move the cursor by x,y if possible.
int grayBand() const
Return the gray band currently viewed.
bool p_paintPixmap
Paint the pixmap?
int comboIndex() const
Return the BandBin combo box index.
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...
Projection * p_projection
The projection from the cube.
Camera * camera() const
Return the camera associated with the cube (NULL implies none)
void mouseMove(QPoint)
Emitted when the mouse moves.
double fitScaleHeight() const
Determine the scale of cube in heighth to fit in the viewport.
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.
void cubeToContents(double sample, double line, int &x, int &y) const
Convert a cube sample/line to a contents x/y (should not be outside)
void enableProgress()
This restarts the progress bar.
virtual void resizeEvent(QResizeEvent *e)
The viewport is being resized.
double bluePixel(int sample, int line)
Return the blue pixel value at a sample/line.
void mouseEnter()
Emitted when the mouse enters the viewport.
void viewportToCube(int x, int y, double &sample, double &line) const
Convert a viewport x/y to a cube sample/line (may be outside the cube)
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.
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.
ViewportBuffer * blueBuffer()
Returns the blue viewport buffer (Will be NULL if in Gray mode.)
int cubeBands() const
Return the number of bands in the cube.
QVector< Stretch * > * p_globalStretches
Global stretches for each stretched band.
void viewportClosed(CubeViewport *)
Emitted when viewport is closed.
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.
int p_cubeId
Cube ID given from cube data thread for I/O.
virtual void restretch(ViewportBuffer *buffer)=0
This is called by internal viewport buffers when a stretch action should be performed.
void cubeToViewport(double sample, double line, int &x, int &y) const
Convert a cube sample/line to a viewport x/y (may be outside the viewport)
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.
bool cubeShown() const
Return if the cube is visible.
CubeDataThread * cubeDataThread()
void stretchGreen(const QString &string)
Apply stretch pairs to green bands.
ViewportBuffer * p_redBuffer
Viewport Buffer to manage red band.
CubeViewport(Cube *cube, CubeDataThread *cdt=0, QWidget *parent=0)
Construct a cube viewport.
virtual void paintEvent(QPaintEvent *e)
Repaint the viewport.
CubeDataThread * p_cubeData
Does all the cube I/O.
QString p_cubeWhatsThisText
The text for the cube's What's this.
void setBackground(QColor color)
Sets the background color.
Cube * p_cube
The cube associated with the viewport.
virtual ~CubeViewport()
Destructor.
double scale() const
Return the scale.
void contentsToCube(int x, int y, double &sample, double &line) const
Convert a contents x/y to a cube sample/line (may be outside the cube)
QSize sizeHint() const
Make viewports show up as 512 by 512.
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.
int blueBand() const
Return the blue band currently viewed.
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.
int cubeLines() const
Return the number of lines in the cube.
ViewportBuffer * greenBuffer()
Returns the green viewport buffer (Will be NULL if in Gray mode.)
void changeCursor(QCursor cursor)
Allows users to change the cursor type on the viewport.
QColor p_bgColor
The color to paint the background of the viewport.
double p_scale
The scale number.
double fitScale() const
Determine the scale that causes the full cube to fit in the viewport.
void showEvent(QShowEvent *)
This method is called to initially show the viewport.
void mouseButtonRelease(QPoint, Qt::MouseButton)
Emitted when mouse button released.
Brick * p_gryBrick
Bricks for every color.
virtual bool eventFilter(QObject *o, QEvent *e)
Event filter to watch for mouse events on 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.