|
Isis Developer Reference
|
Go to the documentation of this file.
14 #include <QAbstractScrollArea>
29 class UniversalGroundMap;
256 double &sample,
double &line)
const;
267 int &x,
int &y)
const;
277 double &sample,
double &line)
const;
287 int &x,
int &y)
const;
297 double redPixel(
int sample,
int line);
359 return p_trackingCube;
383 p_comboCount = count;
392 p_comboIndex = index;
432 return p_greenBuffer;
508 void getCubeArea(
double & pdStartSample,
double & pdEndSample,
509 double & pdStartLine,
double & pdEndLine);
552 void center(
int x,
int y);
553 void center(
double sample,
double line);
597 void shiftPixmap(
int dx,
int dy);
599 void updateScrollBars(
int x,
int y);
600 void paintPixmapRects();
631 Cube *p_trackingCube;
634 QTimer *p_progressTimer;
656 bool p_updatingBuffers;
658 QString p_whatsThisText;
659 QString p_cubeWhatsThisText;
660 QString p_viewportWhatsThisText;
661 void updateWhatsThis();
673 bool p_thisOwnsCubeData;
int cubeLines() const
Return the number of lines in the cube.
Definition: CubeViewport.cpp:439
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.
Definition: Brick.h:120
virtual void SetBand(const int band)
Virtual method that sets the band number.
Definition: Camera.cpp:2680
void setCaption()
Change the caption on the viewport title bar.
Definition: CubeViewport.cpp:985
void scaleChanged()
Emitted when zoom factor changed just before the repaint event.
virtual void keyPressEvent(QKeyEvent *e)
Process arrow keystrokes on cube.
Definition: CubeViewport.cpp:1759
void scrollContentsBy(int dx, int dy)
Scroll the viewport contents by dx/dy screen pixels.
Definition: CubeViewport.cpp:909
Reads and stores visible DN values.
Definition: ViewportBuffer.h:63
ViewportBuffer * redBuffer()
Returns the red viewport buffer (Will be NULL if in Gray mode.)
Definition: CubeViewport.h:421
void setAllBandStretches(Stretch stretch)
Sets a stretch for all bands.
Definition: CubeViewport.cpp:1983
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
void SetMinimum(const double value)
Definition: Stretch.h:142
int SampleDimension() const
Returns the number of samples in the shape buffer.
Definition: Buffer.h:70
const std::vector< double > & getLine(int line)
Retrieves a line from the buffer.
Definition: ViewportBuffer.cpp:342
int band
The band.
Definition: CubeViewport.h:168
Universal Ground Map.
Definition: UniversalGroundMap.h:69
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
void viewportUpdated()
Emitted when viewport updated.
void resizedViewport()
Call this when the viewport is resized (not zoomed).
Definition: ViewportBuffer.cpp:901
A single keyword-value pair.
Definition: PvlKeyword.h:82
void cubeContentsChanged(QRect rect)
Calle dhwen the contents of the cube changes.
Definition: CubeViewport.cpp:2312
virtual bool eventFilter(QObject *o, QEvent *e)
Event filter to watch for mouse events on viewport.
Definition: CubeViewport.cpp:1694
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
Definition: Cube.cpp:1991
double fitScale() const
Determine the scale that causes the full cube to fit in the viewport.
Definition: CubeViewport.cpp:2270
void saveChanges(CubeViewport *)
Emitted when changes should be saved.
void getAllWhatsThisInfo(Pvl &pWhatsThisPvl)
Get All WhatsThis info - viewport, cube, area in PVL format.
Definition: CubeViewport.cpp:1372
void SetLis(const double value)
Sets the mapping for LIS pixels.
Definition: Stretch.h:105
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
QVector< Stretch * > * p_knownStretches
Stretches for each previously stretched band.
Definition: CubeViewport.h:613
void setComboCount(int count)
Sets the band bin combo box count.
Definition: CubeViewport.h:382
File name manipulation and expansion.
Definition: FileName.h:100
bool isGray() const
Definition: CubeViewport.h:189
void center(int x, int y)
Bring the cube pixel under viewport x/y to the center.
Definition: CubeViewport.cpp:730
void SetMaximum(const double value)
Definition: Stretch.h:145
Pixel value mapper.
Definition: Stretch.h:58
void setScale(double scale)
Change the scale of the cube to the given parameter value.
Definition: CubeViewport.cpp:588
~BandInfo()
Deconstructor.
Definition: CubeViewport.cpp:2416
bool isColor() const
Definition: CubeViewport.h:184
QPixmap p_pixmap
The qpixmap.
Definition: CubeViewport.h:610
void setCursorPosition(int x, int y)
Set the cursor position to x/y in the viewport.
Definition: CubeViewport.cpp:1874
QPixmap pixmap()
Returns the pixmap.
Definition: CubeViewport.h:401
CubeStretch getStretch() const
Definition: CubeViewport.cpp:2424
virtual int physicalBand(const int &virtualBand) const
This method will return the physical band number given a virtual band number.
Definition: Cube.cpp:1773
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Definition: PvlObject.h:210
void mouseLeave()
Emitted when the mouse leaves the viewport.
double grayPixel(int sample, int line)
Gets the gray pixel.
Definition: CubeViewport.cpp:1654
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Container for cube-like labels.
Definition: Pvl.h:119
void forgetStretches()
Resets all remembered stretches.
Definition: CubeViewport.cpp:1973
void SetHrs(const double value)
Sets the mapping for HRS pixels.
Definition: Stretch.h:138
int Pairs() const
Returns the number of stretch pairs.
Definition: Stretch.h:162
Stores stretch information for a cube.
Definition: CubeStretch.h:27
Isis::Camera * Camera() const
Return the camera associated with the ground map (NULL implies none)
Definition: UniversalGroundMap.h:136
void setBand(int band)
Sets the band to read from, the buffer will be re-read if the band changes.
Definition: ViewportBuffer.cpp:1319
void contentsToCube(int x, int y, double &sample, double &line) const
Turns contents to a cube.
Definition: CubeViewport.cpp:798
CubeStretch greenStretch() const
Return the green band stretch.
Definition: CubeViewport.cpp:1674
int getBand()
Return the band associated with this viewport buffer.
Definition: ViewportBuffer.h:88
BandInfo()
Definition: CubeViewport.cpp:2397
void moveCursor(int x, int y)
Move the cursor by x,y if possible.
Definition: CubeViewport.cpp:1847
void discardChanges(CubeViewport *)
Emitted when changes should be discarded.
virtual void viewRGB(int redBand, int greenBand, int blueBand)
View cube as color.
Definition: CubeViewport.cpp:2002
void cubeToContents(double sample, double line, int &x, int &y) const
Turns a cube into contents.
Definition: CubeViewport.cpp:835
Buffer for containing a three dimensional section of an image.
Definition: Brick.h:45
void SetLrs(const double value)
Sets the mapping for LRS pixels.
Definition: Stretch.h:116
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
UniversalGroundMap * universalGroundMap() const
Definition: CubeViewport.h:353
void getBandFilterName(PvlKeyword &pFilterNameKey)
Get Band Filter name from the Isis cube label.
Definition: CubeViewport.cpp:1474
void SetHis(const double value)
Sets the mapping for HIS pixels.
Definition: Stretch.h:127
Encapsulation of Cube I/O with Change Notifications.
Definition: CubeDataThread.h:59
Camera * camera() const
Definition: CubeViewport.h:348
int FindCubeId(const Cube *) const
Given a Cube pointer, return the cube ID associated with it.
Definition: CubeDataThread.cpp:351
int blueBand() const
Definition: CubeViewport.h:209
CubeStretch redStretch() const
Return the red band stretch.
Definition: CubeViewport.cpp:1668
void AddChangeListener()
You must call this method after connecting to the BrickChanged signal, otherwise you are not guarante...
Definition: CubeDataThread.cpp:230
int comboCount() const
Definition: CubeViewport.h:224
double fitScaleWidth() const
Determine the scale of cube in the width to fit in the viewport.
Definition: CubeViewport.cpp:2285
void stretchKnownGlobal()
List<Tool *> p This stretches to the global stretch.
Definition: CubeViewport.cpp:2153
void mouseEnter()
Emitted when the mouse enters the viewport.
void paintPixmap()
Paint the whole pixmap.
Definition: CubeViewport.cpp:1129
bool enabled()
Returns whether the buffer is enabled (reading data) or not.
Definition: ViewportBuffer.h:105
void mouseDoubleClick(QPoint)
Emitted when double click happens.
CubeStretch blueStretch() const
Return the blue band stretch.
Definition: CubeViewport.cpp:1680
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
Definition: CubeViewport.cpp:852
void mouseButtonPress(QPoint, Qt::MouseButton)
Emitted when mouse button pressed.
double currentProgress()
Returns the viewport buffer's loading progress.
Definition: ViewportBuffer.cpp:633
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...
Definition: CubeDataThread.cpp:125
Definition: CubeViewport.h:147
void setStretch(const Stretch &newStretch)
Definition: CubeViewport.cpp:2431
const BandInfo & operator=(BandInfo other)
The BandInfo for the Cube.
Definition: CubeViewport.cpp:2436
int grayBand() const
Definition: CubeViewport.h:194
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
int lineCount() const
Definition: Cube.cpp:1734
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
virtual void resizeEvent(QResizeEvent *e)
The viewport is being resized.
Definition: CubeViewport.cpp:1023
void enableProgress()
This restarts the progress bar.
Definition: CubeViewport.cpp:972
void screenPixelsChanged()
Emitted when cube pixels that should be on the screen change.
CubeStretch grayStretch() const
Return the gray band stretch.
Definition: CubeViewport.cpp:1662
void CopyPairs(const Stretch &other)
Copies the stretch pairs from another Stretch object, but maintains special pixel values.
Definition: Stretch.cpp:392
bool hasGroup(const QString &group) const
Return if the cube has a specified group in the labels.
Definition: Cube.cpp:2004
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.
Definition: Stretch.cpp:181
double redPixel(int sample, int line)
Gets the red pixel.
Definition: CubeViewport.cpp:1606
double greenPixel(int sample, int line)
Gets the green pixel.
Definition: CubeViewport.cpp:1622
bool confirmClose()
This method should be called during a close event that would cause this viewport to close.
Definition: CubeViewport.cpp:525
void setComboIndex(int index)
Sets the band bin combo box index.
Definition: CubeViewport.h:391
void windowTitleChanged()
Emitted when window title changes.
int LineDimension() const
Returns the number of lines in the shape buffer.
Definition: Buffer.h:79
Cube * trackingCube() const
Definition: CubeViewport.h:358
void mouseMove(QPoint)
Emitted when the mouse moves.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
virtual void restretch(ViewportBuffer *buffer)=0
This is called by internal viewport buffers when a stretch action should be performed.
int sampleCount() const
Definition: Cube.cpp:1807
void getCubeArea(double &pdStartSample, double &pdEndSample, double &pdStartLine, double &pdEndLine)
Get Cube area corresponding to the viewport's dimension.
Definition: CubeViewport.cpp:1495
QSize sizeHint() const
Make viewports show up as 512 by 512.
Definition: CubeViewport.cpp:571
void bufferUpdated(QRect rect)
This method is called by ViewportBuffer upon successful completion of all operations and gives the ap...
Definition: CubeViewport.cpp:1104
bool isOpen() const
Test if a cube file has been opened/created.
Definition: Cube.cpp:183
IO Handler for Isis Cubes.
Definition: Cube.h:167
CubeDataThread * cubeDataThread()
Definition: CubeViewport.h:473
void doneWithData(int, const Isis::Brick *)
Emitted when a brick is no longer needed, should only be sent to cube data thread.
Isis exception class.
Definition: IException.h:91
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
int cubeSamples() const
Return the number of samples in the cube.
Definition: CubeViewport.cpp:433
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition: Cube.cpp:1410
QRect bufferXYRect()
Returns a rect, in screen pixels, of the area this buffer covers.
Definition: ViewportBuffer.cpp:1257
QPoint cursorPosition() const
Return the cursor position in the viewport.
Definition: CubeViewport.cpp:1834
Isis::Projection * Projection() const
Return the projection associated with the ground map (NULL implies none)
Definition: UniversalGroundMap.h:131
void scrollBy(int dx, int dy)
Move the scrollbars by dx/dy screen pixels.
Definition: CubeViewport.cpp:869
void SetNull(const double value)
Sets the mapping for NULL pixels.
Definition: Stretch.h:94
double bluePixel(int sample, int line)
Gets the blue pixel.
Definition: CubeViewport.cpp:1638
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
int cubeID()
Definition: CubeViewport.h:480
void RemoveChangeListener()
You must call this method after disconnecting from the BrickChanged signal, otherwise bricks cannot b...
Definition: CubeDataThread.cpp:238
Namespace for the standard library.
void changeCursor(QCursor cursor)
Allows users to change the cursor type on the viewport.
Definition: CubeViewport.cpp:2392
void stretchGreen(const QString &string)
Apply stretch pairs to green bands.
Definition: CubeViewport.cpp:2131
void mouseMove(QPoint, Qt::MouseButton)
Emitted when the mouse moves.
ViewportBuffer * blueBuffer()
Returns the blue viewport buffer (Will be NULL if in Gray mode.)
Definition: CubeViewport.h:441
void addStretchAction()
When all current operations finish the cube viewport will be asked to do a stretch if you call this.
Definition: ViewportBuffer.cpp:1220
PixelType pixelType() const
Definition: Cube.cpp:1758
void scaleChanged()
Call this when zoomed, re-reads visible area.
Definition: ViewportBuffer.cpp:1281
void viewportClosed(CubeViewport *)
Emitted when viewport is closed.
QVector< Stretch * > * p_globalStretches
Global stretches for each stretched band.
Definition: CubeViewport.h:616
void setTrackingCube()
Finds the Tracking group from p_cube and stores the tracking cube name so that we can grab it in Adva...
Definition: CubeViewport.cpp:2375
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
void enable(bool enabled)
This turns on or off reading from the cube.
Definition: ViewportBuffer.cpp:1302
virtual ~CubeViewport()
Deconstructor for the Cubeviewport.
Definition: CubeViewport.cpp:307
void cubeChanged(bool changed)
This method is called when the cube has changed or changes have been finalized.
Definition: CubeViewport.cpp:561
void pan(int deltaX, int deltaY)
Call this when the viewport is panned.
Definition: ViewportBuffer.cpp:1048
void setCube(Cube *cube)
This method sets the viewports cube.
Definition: CubeViewport.cpp:426
void mouseButtonRelease(QPoint, Qt::MouseButton)
Emitted when mouse button released.
int size() const
Returns the number of values stored in this keyword.
Definition: PvlKeyword.h:125
virtual void viewGray(int band)
View cube as gray.
Definition: CubeViewport.cpp:1918
int comboIndex() const
Definition: CubeViewport.h:229
double fitScaleHeight() const
Determine the scale of cube in heighth to fit in the viewport.
Definition: CubeViewport.cpp:2298
double scale() const
Definition: CubeViewport.h:214
void onProgressTimer()
This updates the progress bar visually.
Definition: CubeViewport.cpp:263
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Definition: CubeViewport.cpp:815
virtual void paintEvent(QPaintEvent *e)
Repaint the viewport.
Definition: CubeViewport.cpp:1089
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Definition: PvlContainer.cpp:62
CubeViewport(Cube *cube, CubeDataThread *cdt=0, QWidget *parent=0)
Constructor for the CubeViewport.
Definition: CubeViewport.cpp:60
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
ViewportBuffer * grayBuffer()
Returns the gray viewport buffer (Will be NULL if in RGB mode.)
Definition: CubeViewport.h:411
void progressChanged(int)
Emitted with current progress (0 to 100) when working.
int Sample(const int index=0) const
Returns the sample position associated with a shape buffer index.
Definition: Buffer.cpp:127
Base class for Map Projections.
Definition: Projection.h:155
void showEvent(QShowEvent *)
This method is called to initially show the viewport.
Definition: CubeViewport.cpp:233
void fillBuffer(QRect rect)
This method will convert the rect to sample/line positions and read from the cube into the buffer.
Definition: ViewportBuffer.cpp:114
Cube * cube() const
Definition: CubeViewport.h:338
bool HasProjection()
Checks to see if the camera object has a projection.
Definition: Camera.cpp:2638
int redBand() const
Definition: CubeViewport.h:199
bool cursorInside() const
Is cursor inside viewport.
Definition: CubeViewport.cpp:1809
Projection * projection()
Definition: Cube.cpp:1794
int Line(const int index=0) const
Returns the line position associated with a shape buffer index.
Definition: Buffer.cpp:145
virtual void cubeDataChanged(int cubeId, const Isis::Brick *)
This method updates the internal viewport buffer based on changes in cube DN values.
Definition: CubeViewport.cpp:457
bool cubeShown() const
Definition: CubeViewport.h:219
int cubeBands() const
Return the number of bands in the cube.
Definition: CubeViewport.cpp:445
void stretchGray(const QString &string)
Apply stretch pairs to gray band.
Definition: CubeViewport.cpp:2107
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
void stretchBlue(const QString &string)
Apply stretch pairs to blue bands.
Definition: CubeViewport.cpp:2143
ViewportBuffer * greenBuffer()
Returns the green viewport buffer (Will be NULL if in Gray mode.)
Definition: CubeViewport.h:431
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
int greenBand() const
Definition: CubeViewport.h:204
void setBackground(QColor color)
Sets the background color.
Definition: CubeViewport.h:373
Projection * projection() const
Definition: CubeViewport.h:343
void progressComplete()
Emitted when the current progress is complete (100)
#define ASSERT_PTR(x)
Definition: IsisDebug.h:111
bool working()
This tests if queued actions exist in the viewport buffer.
Definition: ViewportBuffer.cpp:759
double Map(const double value) const
Maps an input value to an output value based on the stretch pairs and/or special pixel mappings.
Definition: Stretch.cpp:69
void stretchRed(const QString &string)
Apply stretch pairs to red bands.
Definition: CubeViewport.cpp:2119