Isis Developer Reference
ViewportBufferFill.h
Go to the documentation of this file.
1#ifndef VieportBufferFill_h
2#define VieportBufferFill_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
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
88 p_readPosition++;
89 }
90
93 p_requestPosition++;
94 }
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;
123 QPoint *p_topLeftPixel;
125 int p_xCoef;
127 double p_xScale;
129 int p_yCoef;
131 double p_yScale;
132
134 const static int STEPSIZE = 20;
135 };
136}
137
138#endif
Definition ViewportBufferAction.h:18
ActionType
This uniquely identifies which child is instantiated.
Definition ViewportBufferAction.h:26
@ fill
ViewportBufferFill.
Definition ViewportBufferAction.h:29
Definition ViewportBufferFill.h:29
double viewportToLine(int y)
Converts screen y position to cube line position.
Definition ViewportBufferFill.h:64
int getRequestPosition() const
Returns the current request position (>= read position)
Definition ViewportBufferFill.h:73
int getTopmostPixelPosition()
Returns the top of the X/Y bounding rect for this fill.
Definition ViewportBufferFill.cpp:67
virtual ViewportBufferAction::ActionType getActionType()
Returns the type of this class.
Definition ViewportBufferFill.h:42
int getLeftmostPixelPosition()
Returns the left of the X/Y bounding rect for this fill.
Definition ViewportBufferFill.cpp:77
void incRequestPosition()
Increment request position.
Definition ViewportBufferFill.h:92
void stop()
Cancels the current operation.
Definition ViewportBufferFill.cpp:105
void incReadPosition()
Increment read position.
Definition ViewportBufferFill.h:87
int getReadPosition() const
Returns the current read position.
Definition ViewportBufferFill.h:82
QRect * getRect()
Returns the rect that this action is filling in screen pixels.
Definition ViewportBufferFill.h:101
bool shouldPaint(int &linesToPaint)
Returns true if it is recommended to paint the fill area so far.
Definition ViewportBufferFill.cpp:118
bool shouldRequestMore()
Returns true if request position is past the end of the fill.
Definition ViewportBufferFill.cpp:97
bool doneReading()
Returns true if read position is past the end of the fill.
Definition ViewportBufferFill.cpp:87
double viewportToSample(int x)
Converts screen x position to cube sample position.
Definition ViewportBufferFill.h:53
ViewportBufferFill(const QRect &rect, const int &xCoef, const double &xScale, const int &yCoef, const double &yScale, const QPoint &topLeftPixel)
Constructor.
Definition ViewportBufferFill.cpp:30
~ViewportBufferFill()
Destructor.
Definition ViewportBufferFill.cpp:50
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16