Isis 3 Programmer Reference
Isis::ViewportBufferFill Class Reference

#include <ViewportBufferFill.h>

Inheritance diagram for Isis::ViewportBufferFill:
Inheritance graph
Collaboration diagram for Isis::ViewportBufferFill:
Collaboration graph

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.
 
 ~ViewportBufferFill ()
 Destructor.
 
virtual ViewportBufferAction::ActionType getActionType ()
 Returns the type of this class.
 
double viewportToSample (int x)
 Converts screen x position to cube sample position.
 
double viewportToLine (int y)
 Converts screen y position to cube line position.
 
int getRequestPosition () const
 Returns the current request position (>= read position)
 
int getReadPosition () const
 Returns the current read position.
 
void incReadPosition ()
 Increment read position.
 
void incRequestPosition ()
 Increment request position.
 
QRect * getRect ()
 Returns the rect that this action is filling in screen pixels.
 
int getTopmostPixelPosition ()
 Returns the top of the X/Y bounding rect for this fill.
 
int getLeftmostPixelPosition ()
 Returns the left of the X/Y bounding rect for this fill.
 
bool doneReading ()
 Returns true if read position is past the end of the fill.
 
bool shouldRequestMore ()
 Returns true if request position is past the end of the fill.
 
bool shouldPaint (int &linesToPaint)
 Returns true if it is recommended to paint the fill area so far.
 
void stop ()
 Cancels the current operation.
 
bool started ()
 Returns true if this is an action that takes time and has begun.
 
void started (bool started)
 Sets started.
 

Private Attributes

unsigned int p_readPosition
 Position of the cube reads.
 
unsigned int p_requestPosition
 Position of the cube requests.
 
QRect * p_rect
 Rect this fill represents.
 
QPoint * p_topLeftPixel
 Top left of the viewport for this fill.
 
int p_xCoef
 viewport to sample/line x coef
 
double p_xScale
 viewport to sample/line x scalar
 
int p_yCoef
 viewport to sample/line y coef
 
double p_yScale
 viewport to sample/line y scalar
 
bool p_started
 True if this action has begun.
 

Static Private Attributes

static const int STEPSIZE = 20
 how many cube lines per paint if painting inbetween gets re-enabled
 

Detailed Description

Author
????-??-?? Unknown
History

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 29 of file ViewportBufferFill.h.

Member Enumeration Documentation

◆ ActionType

This uniquely identifies which child is instantiated.

Enumerator
none 

Parent was instantiated.

transform 

ViewportBufferTransform.

fill 

ViewportBufferFill.

stretch 

ViewportBufferStretch.

Definition at line 26 of file ViewportBufferAction.h.

Constructor & Destructor Documentation

◆ ViewportBufferFill()

Isis::ViewportBufferFill::ViewportBufferFill ( const QRect & rect,
const int & xCoef,
const double & xScale,
const int & yCoef,
const double & yScale,
const QPoint & topLeftPixel )

Constructor.

Parameters
rect
xCoef
xScale
yCoef
yScale
topLeftPixel

Definition at line 30 of file ViewportBufferFill.cpp.

References p_readPosition, p_rect, p_requestPosition, p_topLeftPixel, p_xCoef, p_xScale, p_yCoef, and p_yScale.

◆ ~ViewportBufferFill()

Isis::ViewportBufferFill::~ViewportBufferFill ( )

Destructor.

Definition at line 50 of file ViewportBufferFill.cpp.

References p_rect, and p_topLeftPixel.

Member Function Documentation

◆ doneReading()

bool Isis::ViewportBufferFill::doneReading ( )

Returns true if read position is past the end of the fill.

Returns
bool

Definition at line 87 of file ViewportBufferFill.cpp.

References p_readPosition, and p_rect.

Referenced by Isis::ViewportBuffer::DataReady(), and shouldPaint().

◆ getActionType()

virtual ViewportBufferAction::ActionType Isis::ViewportBufferFill::getActionType ( )
inlinevirtual

Returns the type of this class.

Returns
ViewportBufferAction::ActionType

Reimplemented from Isis::ViewportBufferAction.

Definition at line 42 of file ViewportBufferFill.h.

References Isis::ViewportBufferAction::fill.

◆ getLeftmostPixelPosition()

int Isis::ViewportBufferFill::getLeftmostPixelPosition ( )

Returns the left of the X/Y bounding rect for this fill.

Returns
int

Definition at line 77 of file ViewportBufferFill.cpp.

References p_topLeftPixel.

Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::fillBuffer().

◆ getReadPosition()

int Isis::ViewportBufferFill::getReadPosition ( ) const
inline

Returns the current read position.

Returns
int

Definition at line 82 of file ViewportBufferFill.h.

References p_readPosition.

Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::totalUnfilledArea().

◆ getRect()

QRect * Isis::ViewportBufferFill::getRect ( )
inline

Returns the rect that this action is filling in screen pixels.

Returns
QRect*

Definition at line 101 of file ViewportBufferFill.h.

References p_rect.

Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::reinitialize(), Isis::ViewportBuffer::requestCubeLine(), and Isis::ViewportBuffer::totalUnfilledArea().

◆ getRequestPosition()

int Isis::ViewportBufferFill::getRequestPosition ( ) const
inline

Returns the current request position (>= read position)

Returns
int

Definition at line 73 of file ViewportBufferFill.h.

References p_requestPosition.

Referenced by Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().

◆ getTopmostPixelPosition()

int Isis::ViewportBufferFill::getTopmostPixelPosition ( )

Returns the top of the X/Y bounding rect for this fill.

Returns
int

Definition at line 67 of file ViewportBufferFill.cpp.

References p_topLeftPixel.

Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::fillBuffer().

◆ incReadPosition()

void Isis::ViewportBufferFill::incReadPosition ( )
inline

Increment read position.

Definition at line 87 of file ViewportBufferFill.h.

References p_readPosition.

Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::fillBuffer().

◆ incRequestPosition()

void Isis::ViewportBufferFill::incRequestPosition ( )
inline

Increment request position.

Definition at line 92 of file ViewportBufferFill.h.

References p_requestPosition.

Referenced by Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().

◆ shouldPaint()

bool Isis::ViewportBufferFill::shouldPaint ( int & linesToPaint)

Returns true if it is recommended to paint the fill area so far.

Parameters
linesToPaint
Returns
bool

Definition at line 118 of file ViewportBufferFill.cpp.

References doneReading(), p_readPosition, p_rect, and STEPSIZE.

◆ shouldRequestMore()

bool Isis::ViewportBufferFill::shouldRequestMore ( )

Returns true if request position is past the end of the fill.

Returns
bool

Definition at line 97 of file ViewportBufferFill.cpp.

References p_rect, and p_requestPosition.

Referenced by Isis::ViewportBuffer::DataReady(), and Isis::ViewportBuffer::fillBuffer().

◆ started() [1/2]

bool Isis::ViewportBufferAction::started ( )
inlineinherited

Returns true if this is an action that takes time and has begun.

Definition at line 39 of file ViewportBufferAction.h.

References Isis::ViewportBufferAction::p_started.

Referenced by Isis::ViewportBufferAction::started().

◆ started() [2/2]

void Isis::ViewportBufferAction::started ( bool started)
inlineinherited

Sets started.

Parameters
startedTrue if starting

Definition at line 48 of file ViewportBufferAction.h.

References Isis::ViewportBufferAction::p_started, and Isis::ViewportBufferAction::started().

◆ stop()

void Isis::ViewportBufferFill::stop ( )
virtual

Cancels the current operation.

Stops filling ASAP.

Reimplemented from Isis::ViewportBufferAction.

Definition at line 105 of file ViewportBufferFill.cpp.

References p_rect, and p_requestPosition.

Referenced by Isis::ViewportBuffer::reinitialize().

◆ viewportToLine()

double Isis::ViewportBufferFill::viewportToLine ( int y)
inline

Converts screen y position to cube line position.

Parameters
y
Returns
double

Definition at line 64 of file ViewportBufferFill.h.

References p_yCoef, and p_yScale.

Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().

◆ viewportToSample()

double Isis::ViewportBufferFill::viewportToSample ( int x)
inline

Converts screen x position to cube sample position.

Parameters
x
Returns
double

Definition at line 53 of file ViewportBufferFill.h.

References p_xCoef, and p_xScale.

Referenced by Isis::ViewportBuffer::DataReady(), Isis::ViewportBuffer::fillBuffer(), and Isis::ViewportBuffer::requestCubeLine().

Member Data Documentation

◆ p_readPosition

unsigned int Isis::ViewportBufferFill::p_readPosition
private

Position of the cube reads.

Definition at line 117 of file ViewportBufferFill.h.

Referenced by doneReading(), getReadPosition(), incReadPosition(), shouldPaint(), and ViewportBufferFill().

◆ p_rect

QRect* Isis::ViewportBufferFill::p_rect
private

Rect this fill represents.

Definition at line 121 of file ViewportBufferFill.h.

Referenced by doneReading(), getRect(), shouldPaint(), shouldRequestMore(), stop(), ViewportBufferFill(), and ~ViewportBufferFill().

◆ p_requestPosition

unsigned int Isis::ViewportBufferFill::p_requestPosition
private

Position of the cube requests.

Definition at line 119 of file ViewportBufferFill.h.

Referenced by getRequestPosition(), incRequestPosition(), shouldRequestMore(), stop(), and ViewportBufferFill().

◆ p_started

bool Isis::ViewportBufferAction::p_started
privateinherited

◆ p_topLeftPixel

QPoint* Isis::ViewportBufferFill::p_topLeftPixel
private

Top left of the viewport for this fill.

Definition at line 123 of file ViewportBufferFill.h.

Referenced by getLeftmostPixelPosition(), getTopmostPixelPosition(), ViewportBufferFill(), and ~ViewportBufferFill().

◆ p_xCoef

int Isis::ViewportBufferFill::p_xCoef
private

viewport to sample/line x coef

Definition at line 125 of file ViewportBufferFill.h.

Referenced by ViewportBufferFill(), and viewportToSample().

◆ p_xScale

double Isis::ViewportBufferFill::p_xScale
private

viewport to sample/line x scalar

Definition at line 127 of file ViewportBufferFill.h.

Referenced by ViewportBufferFill(), and viewportToSample().

◆ p_yCoef

int Isis::ViewportBufferFill::p_yCoef
private

viewport to sample/line y coef

Definition at line 129 of file ViewportBufferFill.h.

Referenced by ViewportBufferFill(), and viewportToLine().

◆ p_yScale

double Isis::ViewportBufferFill::p_yScale
private

viewport to sample/line y scalar

Definition at line 131 of file ViewportBufferFill.h.

Referenced by ViewportBufferFill(), and viewportToLine().

◆ STEPSIZE

const int Isis::ViewportBufferFill::STEPSIZE = 20
staticprivate

how many cube lines per paint if painting inbetween gets re-enabled

Definition at line 134 of file ViewportBufferFill.h.

Referenced by shouldPaint().


The documentation for this class was generated from the following files: