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. 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...
 

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 21 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 19 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 23 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 43 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 80 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 34 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 70 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 74 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 93 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 65 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 60 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 79 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 84 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 111 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 90 of file ViewportBufferFill.cpp.

References p_rect, and p_requestPosition.

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

◆ started() [1/2]

bool Isis::ViewportBufferAction::started ( )
inlineinherited

◆ started() [2/2]

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

Sets started.

Parameters
startedTrue if starting

Definition at line 41 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 98 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 56 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 45 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 109 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 113 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 111 of file ViewportBufferFill.h.

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

◆ p_topLeftPixel

QPoint* Isis::ViewportBufferFill::p_topLeftPixel
private

Top left of the viewport for this fill.

Definition at line 115 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 117 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 119 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 121 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 123 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 126 of file ViewportBufferFill.h.

Referenced by shouldPaint().


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