|
Isis Developer Reference
|
Go to the documentation of this file. 1 #ifndef ViewportBuffer_h
2 #define ViewportBuffer_h
22 template<
class T >
class QQueue;
29 class ViewportBufferAction;
30 class ViewportBufferFill;
31 class ViewportBufferStretch;
32 class ViewportBufferTransform;
71 const std::vector<double> &
getLine(
int line);
74 void pan(
int deltaX,
int deltaY);
127 void ReadCube(
int cubeId,
int startSample,
int startLine,
128 int endSample,
int endLine,
int band,
void *caller);
134 QRect getXYBoundingRect();
136 void updateBoundingRects();
137 void doQueuedActions();
146 void resizeBuffer(
unsigned int width,
unsigned int height);
147 void shiftBuffer(
int deltaX,
int deltaY);
149 bool actionsPreserveData();
150 bool reinitializeActionExists();
160 std::vector< std::vector<double> > p_buffer;
161 bool p_bufferInitialized;
167 QRect p_XYBoundingRect;
168 QRect p_oldXYBoundingRect;
178 int p_viewportHeight;
179 int p_oldViewportHeight;
180 int p_vertScrollBarPos;
181 int p_oldVertScrollBarPos;
182 bool p_initialStretchDone;
183 double p_requestedFillArea;
188 enum sampLineRectPosition {
202 bool p_bricksOrdered;
Reads and stores visible DN values.
Definition: ViewportBuffer.h:63
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
void resizedViewport()
Call this when the viewport is resized (not zoomed).
Definition: ViewportBuffer.cpp:901
bool doneReading()
Returns true if read position is past the end of the fill.
Definition: ViewportBufferFill.cpp:87
double totalUnfilledArea()
This returns the amount of area in the queue that needs new cube data/will be filled by fill actions.
Definition: ViewportBuffer.cpp:649
virtual void stop()
Cancels the process, used if reinitialize requested for example.
Definition: ViewportBufferAction.h:53
int Index(const int i_samp, const int i_line, const int i_band) const
Given a sample, line, and band position, this returns the appropriate index in the shape buffer.
Definition: Buffer.cpp:197
Definition: ViewportBufferFill.h:29
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 emptyBuffer(bool force=false)
This is meant to clear up ram on non-active viewports.
Definition: ViewportBuffer.cpp:1241
int getBand()
Return the band associated with this viewport buffer.
Definition: ViewportBuffer.h:88
Definition: ViewportBufferStretch.h:22
Buffer for containing a three dimensional section of an image.
Definition: Brick.h:45
Encapsulation of Cube I/O with Change Notifications.
Definition: CubeDataThread.h:59
double viewportToSample(int x)
Converts screen x position to cube sample position.
Definition: ViewportBufferFill.h:53
void ReadCube(int cubeId, int startSample, int startLine, int endSample, int endLine, int band, void *caller)
Ask the cube data thread for data.
bool enabled()
Returns whether the buffer is enabled (reading data) or not.
Definition: ViewportBuffer.h:105
double viewportToLine(int y)
Converts screen y position to cube line position.
Definition: ViewportBufferFill.h:64
double currentProgress()
Returns the viewport buffer's loading progress.
Definition: ViewportBuffer.cpp:633
int getReadPosition() const
Returns the current read position.
Definition: ViewportBufferFill.h:82
int getTopmostPixelPosition()
Returns the top of the X/Y bounding rect for this fill.
Definition: ViewportBufferFill.cpp:67
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Definition: ViewportBufferAction.h:18
bool shouldRequestMore()
Returns true if request position is past the end of the fill.
Definition: ViewportBufferFill.cpp:97
QRect * getRect()
Returns the rect that this action is filling in screen pixels.
Definition: ViewportBufferFill.h:101
int LineDimension() const
Returns the number of lines in the shape buffer.
Definition: Buffer.h:79
double at(const int index) const
Returns the value in the shape buffer at the given index.
Definition: Buffer.cpp:231
int getLeftmostPixelPosition()
Returns the left of the X/Y bounding rect for this fill.
Definition: ViewportBufferFill.cpp:77
Isis exception class.
Definition: IException.h:91
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
QRect bufferXYRect()
Returns a rect, in screen pixels, of the area this buffer covers.
Definition: ViewportBuffer.cpp:1257
#define round(x)
This is free and unencumbered software released into the public domain.
Definition: ViewportBuffer.cpp:29
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
void incRequestPosition()
Increment request position.
Definition: ViewportBufferFill.h:92
int getRequestPosition() const
Returns the current request position (>= read position)
Definition: ViewportBufferFill.h:73
bool started()
Returns true if this is an action that takes time and has begun.
Definition: ViewportBufferAction.h:39
Namespace for the standard library.
virtual ~ViewportBuffer()
Updates total buffer size on destruction.
Definition: ViewportBuffer.cpp:80
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:14
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
void scaleChanged()
Call this when zoomed, re-reads visible area.
Definition: ViewportBuffer.cpp:1281
virtual ActionType getActionType()
Returns the instantiated type.
Definition: ViewportBufferAction.h:34
void enable(bool enabled)
This turns on or off reading from the cube.
Definition: ViewportBuffer.cpp:1302
void pan(int deltaX, int deltaY)
Call this when the viewport is panned.
Definition: ViewportBuffer.cpp:1048
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:97
bool hasEntireCube()
Method to see if the entire cube is in the buffer.
Definition: ViewportBuffer.cpp:423
Adds specific functionality to C++ strings.
Definition: IString.h:165
void incReadPosition()
Increment read position.
Definition: ViewportBufferFill.h:87
int Sample(const int index=0) const
Returns the sample position associated with a shape buffer index.
Definition: Buffer.cpp:127
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
int Line(const int index=0) const
Returns the line position associated with a shape buffer index.
Definition: Buffer.cpp:145
void DataReady(void *requester, int cubeId, const Isis::Brick *brick)
This method is called when requested bricks become available.
Definition: ViewportBuffer.cpp:208
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
void DoneWithData(int, const Isis::Brick *)
Tell cube data thread we're done with a brick.
bool working()
This tests if queued actions exist in the viewport buffer.
Definition: ViewportBuffer.cpp:759
ViewportBuffer(CubeViewport *viewport, CubeDataThread *cubeData, int cubeId)
ViewportBuffer constructor.
Definition: ViewportBuffer.cpp:44