Isis 3 Programmer Reference
ViewportBufferFill.h
1#ifndef VieportBufferFill_h
2#define VieportBufferFill_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include "ViewportBufferAction.h"
13
14class QRect;
15class QPoint;
16
17namespace Isis {
30 public:
31 ViewportBufferFill(const QRect &rect, const int &xCoef,
32 const double &xScale, const int &yCoef,
33 const double &yScale, const QPoint &topLeftPixel);
35
36
45
53 double viewportToSample(int x) {
54 return (x + p_xCoef) / p_xScale;
55 }
56
64 double viewportToLine(int y) {
65 return (y + p_yCoef) / p_yScale;
66 }
67
73 int getRequestPosition() const {
74 return p_requestPosition;
75 }
76
82 int getReadPosition() const {
83 return p_readPosition;
84 }
85
89 }
90
95
101 QRect *getRect() {
102 return p_rect;
103 }
104
107
108 bool doneReading();
109 bool shouldRequestMore();
110 bool shouldPaint(int &linesToPaint);
111
112 void stop();
113
114
115 private:
117 unsigned int p_readPosition;
119 unsigned int p_requestPosition;
121 QRect *p_rect;
127 double p_xScale;
131 double p_yScale;
132
134 const static int STEPSIZE = 20;
135 };
136}
137
138#endif
ActionType
This uniquely identifies which child is instantiated.
int p_yCoef
viewport to sample/line y coef
double viewportToLine(int y)
Converts screen y position to cube line position.
int getRequestPosition() const
Returns the current request position (>= read position)
int getTopmostPixelPosition()
Returns the top of the X/Y bounding rect for this fill.
virtual ViewportBufferAction::ActionType getActionType()
Returns the type of this class.
int getLeftmostPixelPosition()
Returns the left of the X/Y bounding rect for this fill.
unsigned int p_requestPosition
Position of the cube requests.
static const int STEPSIZE
how many cube lines per paint if painting inbetween gets re-enabled
double p_yScale
viewport to sample/line y scalar
QPoint * p_topLeftPixel
Top left of the viewport for this fill.
void incRequestPosition()
Increment request position.
void stop()
Cancels the current operation.
void incReadPosition()
Increment read position.
unsigned int p_readPosition
Position of the cube reads.
int getReadPosition() const
Returns the current read position.
QRect * p_rect
Rect this fill represents.
QRect * getRect()
Returns the rect that this action is filling in screen pixels.
bool shouldPaint(int &linesToPaint)
Returns true if it is recommended to paint the fill area so far.
bool shouldRequestMore()
Returns true if request position is past the end of the fill.
bool doneReading()
Returns true if read position is past the end of the fill.
double viewportToSample(int x)
Converts screen x position to cube sample position.
ViewportBufferFill(const QRect &rect, const int &xCoef, const double &xScale, const int &yCoef, const double &yScale, const QPoint &topLeftPixel)
Constructor.
int p_xCoef
viewport to sample/line x coef
double p_xScale
viewport to sample/line x scalar
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16