Isis 3 Programmer Reference
|
#include <ViewportBufferFill.h>
Public Types | |
enum | ActionType { none, transform, fill, stretch } |
This uniquely identifies which child is instantiated. More... | |
Public Member Functions | |
ViewportBufferFill (const QRect &rect, const int &xCoef, const double &xScale, const int &yCoef, const double &yScale, const QPoint &topLeftPixel) | |
Constructor. More... | |
~ViewportBufferFill () | |
Destructor. More... | |
virtual ViewportBufferAction::ActionType | getActionType () |
Returns the type of this class. More... | |
double | viewportToSample (int x) |
Converts screen x position to cube sample position. More... | |
double | viewportToLine (int y) |
Converts screen y position to cube line position. More... | |
int | getRequestPosition () const |
Returns the current request position (>= read position) More... | |
int | getReadPosition () const |
Returns the current read position. More... | |
void | incReadPosition () |
Increment read position. More... | |
void | incRequestPosition () |
Increment request position. More... | |
QRect * | getRect () |
Returns the rect that this action is filling in screen pixels. More... | |
int | getTopmostPixelPosition () |
Returns the top of the X/Y bounding rect for this fill. More... | |
int | getLeftmostPixelPosition () |
Returns the left of the X/Y bounding rect for this fill. More... | |
bool | doneReading () |
Returns true if read position is past the end of the fill. More... | |
bool | shouldRequestMore () |
Returns true if request position is past the end of the fill. More... | |
bool | shouldPaint (int &linesToPaint) |
Returns true if it is recommended to paint the fill area so far. More... | |
void | stop () |
Cancels the current operation. More... | |
bool | started () |
Returns true if this is an action that takes time and has begun. More... | |
void | started (bool started) |
Sets started. More... | |
Private Attributes | |
unsigned int | p_readPosition |
Position of the cube reads. More... | |
unsigned int | p_requestPosition |
Position of the cube requests. More... | |
QRect * | p_rect |
Rect this fill represents. More... | |
QPoint * | p_topLeftPixel |
Top left of the viewport for this fill. More... | |
int | p_xCoef |
viewport to sample/line x coef More... | |
double | p_xScale |
viewport to sample/line x scalar More... | |
int | p_yCoef |
viewport to sample/line y coef More... | |
double | p_yScale |
viewport to sample/line y scalar More... | |
Static Private Attributes | |
static const int | STEPSIZE = 20 |
how many cube lines per paint if painting inbetween gets re-enabled More... | |
2011-04-25 Steven Lambright - Fixed a problem where 1 too few lines were being read
2015-06-30 Makayla Shepherd and Ian Humphrey - Modified stop() to keep the viewport buffer object from reading an extra line at the bottom of the viewport rectangle. This could potentially cause a crash from reading outside of the bounds. Fixes #2171.
Definition at line 21 of file ViewportBufferFill.h.
|
inherited |
This uniquely identifies which child is instantiated.
Enumerator | |
---|---|
none | Parent was instantiated. |
transform | |
fill | |
stretch |
Definition at line 19 of file ViewportBufferAction.h.
Isis::ViewportBufferFill::ViewportBufferFill | ( | const QRect & | rect, |
const int & | xCoef, | ||
const double & | xScale, | ||
const int & | yCoef, | ||
const double & | yScale, | ||
const QPoint & | topLeftPixel | ||
) |
Constructor.
rect | |
xCoef | |
xScale | |
yCoef | |
yScale | |
topLeftPixel |
Definition at line 23 of file ViewportBufferFill.cpp.
References p_readPosition, p_rect, p_requestPosition, p_topLeftPixel, p_xCoef, p_xScale, p_yCoef, and p_yScale.
Isis::ViewportBufferFill::~ViewportBufferFill | ( | ) |
Destructor.
Definition at line 43 of file ViewportBufferFill.cpp.
References p_rect, and p_topLeftPixel.
bool Isis::ViewportBufferFill::doneReading | ( | ) |
Returns true if read position is past the end of the fill.
Definition at line 80 of file ViewportBufferFill.cpp.
References p_readPosition, and p_rect.
Referenced by Isis::ViewportBuffer::DataReady(), and shouldPaint().
|
inlinevirtual |
Returns the type of this class.
Reimplemented from Isis::ViewportBufferAction.
Definition at line 34 of file ViewportBufferFill.h.
References Isis::ViewportBufferAction::fill.
int Isis::ViewportBufferFill::getLeftmostPixelPosition | ( | ) |
Returns the left of the X/Y bounding rect for this fill.
Definition at line 70 of file ViewportBufferFill.cpp.
References p_topLeftPixel.
Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::fillBuffer().
|
inline |
Returns the current read position.
Definition at line 74 of file ViewportBufferFill.h.
References p_readPosition.
Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::totalUnfilledArea().
|
inline |
Returns the rect that this action is filling in screen pixels.
Definition at line 93 of file ViewportBufferFill.h.
References p_rect.
Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::reinitialize(), Isis::ViewportBuffer::requestCubeLine(), and Isis::ViewportBuffer::totalUnfilledArea().
|
inline |
Returns the current request position (>= read position)
Definition at line 65 of file ViewportBufferFill.h.
References p_requestPosition.
Referenced by Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().
int Isis::ViewportBufferFill::getTopmostPixelPosition | ( | ) |
Returns the top of the X/Y bounding rect for this fill.
Definition at line 60 of file ViewportBufferFill.cpp.
References p_topLeftPixel.
Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::fillBuffer().
|
inline |
Increment read position.
Definition at line 79 of file ViewportBufferFill.h.
References p_readPosition.
Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::fillBuffer().
|
inline |
Increment request position.
Definition at line 84 of file ViewportBufferFill.h.
References p_requestPosition.
Referenced by Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().
bool Isis::ViewportBufferFill::shouldPaint | ( | int & | linesToPaint | ) |
Returns true if it is recommended to paint the fill area so far.
linesToPaint |
Definition at line 111 of file ViewportBufferFill.cpp.
References doneReading(), p_readPosition, p_rect, and STEPSIZE.
bool Isis::ViewportBufferFill::shouldRequestMore | ( | ) |
Returns true if request position is past the end of the fill.
Definition at line 90 of file ViewportBufferFill.cpp.
References p_rect, and p_requestPosition.
Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::startFillAction().
|
inlineinherited |
Returns true if this is an action that takes time and has begun.
Definition at line 32 of file ViewportBufferAction.h.
References Isis::ViewportBufferAction::p_started.
Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::doQueuedActions(), Isis::ViewportBuffer::reinitialize(), Isis::ViewportBufferAction::started(), and Isis::ViewportBuffer::startFillAction().
|
inlineinherited |
Sets started.
started | True if starting |
Definition at line 41 of file ViewportBufferAction.h.
References Isis::ViewportBufferAction::p_started, and Isis::ViewportBufferAction::started().
|
virtual |
Cancels the current operation.
Stops filling ASAP.
Reimplemented from Isis::ViewportBufferAction.
Definition at line 98 of file ViewportBufferFill.cpp.
References p_rect, and p_requestPosition.
Referenced by Isis::ViewportBuffer::reinitialize().
|
inline |
Converts screen y position to cube line position.
y |
Definition at line 56 of file ViewportBufferFill.h.
References p_yCoef, and p_yScale.
Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().
|
inline |
Converts screen x position to cube sample position.
x |
Definition at line 45 of file ViewportBufferFill.h.
References p_xCoef, and p_xScale.
Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().
|
private |
Position of the cube reads.
Definition at line 109 of file ViewportBufferFill.h.
Referenced by doneReading(), getReadPosition(), incReadPosition(), shouldPaint(), and ViewportBufferFill().
|
private |
Rect this fill represents.
Definition at line 113 of file ViewportBufferFill.h.
Referenced by doneReading(), getRect(), shouldPaint(), shouldRequestMore(), stop(), ViewportBufferFill(), and ~ViewportBufferFill().
|
private |
Position of the cube requests.
Definition at line 111 of file ViewportBufferFill.h.
Referenced by getRequestPosition(), incRequestPosition(), shouldRequestMore(), stop(), and ViewportBufferFill().
|
private |
Top left of the viewport for this fill.
Definition at line 115 of file ViewportBufferFill.h.
Referenced by getLeftmostPixelPosition(), getTopmostPixelPosition(), ViewportBufferFill(), and ~ViewportBufferFill().
|
private |
viewport to sample/line x coef
Definition at line 117 of file ViewportBufferFill.h.
Referenced by ViewportBufferFill(), and viewportToSample().
|
private |
viewport to sample/line x scalar
Definition at line 119 of file ViewportBufferFill.h.
Referenced by ViewportBufferFill(), and viewportToSample().
|
private |
viewport to sample/line y coef
Definition at line 121 of file ViewportBufferFill.h.
Referenced by ViewportBufferFill(), and viewportToLine().
|
private |
viewport to sample/line y scalar
Definition at line 123 of file ViewportBufferFill.h.
Referenced by ViewportBufferFill(), and viewportToLine().
|
staticprivate |
how many cube lines per paint if painting inbetween gets re-enabled
Definition at line 126 of file ViewportBufferFill.h.
Referenced by shouldPaint().