Isis 3 Programmer Reference
ViewportBufferFill.h
1 #ifndef VieportBufferFill_h
2 #define VieportBufferFill_h
3 
4 #include "ViewportBufferAction.h"
5 
6 class QRect;
7 class QPoint;
8 
9 namespace Isis {
22  public:
23  ViewportBufferFill(const QRect &rect, const int &xCoef,
24  const double &xScale, const int &yCoef,
25  const double &yScale, const QPoint &topLeftPixel);
27 
28 
36  };
37 
45  double viewportToSample(int x) {
46  return (x + p_xCoef) / p_xScale;
47  }
48 
56  double viewportToLine(int y) {
57  return (y + p_yCoef) / p_yScale;
58  }
59 
65  int getRequestPosition() const {
66  return p_requestPosition;
67  }
68 
74  int getReadPosition() const {
75  return p_readPosition;
76  }
77 
79  void incReadPosition() {
81  }
82 
86  }
87 
93  QRect *getRect() {
94  return p_rect;
95  }
96 
99 
100  bool doneReading();
101  bool shouldRequestMore();
102  bool shouldPaint(int &linesToPaint);
103 
104  void stop();
105 
106 
107  private:
109  unsigned int p_readPosition;
111  unsigned int p_requestPosition;
113  QRect *p_rect;
115  QPoint *p_topLeftPixel;
117  int p_xCoef;
119  double p_xScale;
121  int p_yCoef;
123  double p_yScale;
124 
126  const static int STEPSIZE = 20;
127  };
128 }
129 
130 #endif
int getLeftmostPixelPosition()
Returns the left of the X/Y bounding rect for this fill.
int getRequestPosition() const
Returns the current request position (>= read position)
QPoint * p_topLeftPixel
Top left of the viewport for this 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.
unsigned int p_readPosition
Position of the cube reads.
QRect * getRect()
Returns the rect that this action is filling in screen pixels.
ViewportBufferFill(const QRect &rect, const int &xCoef, const double &xScale, const int &yCoef, const double &yScale, const QPoint &topLeftPixel)
Constructor.
void incRequestPosition()
Increment request position.
virtual ViewportBufferAction::ActionType getActionType()
Returns the type of this class.
ActionType
This uniquely identifies which child is instantiated.
void stop()
Cancels the current operation.
double viewportToSample(int x)
Converts screen x position to cube sample position.
double p_xScale
viewport to sample/line x scalar
bool doneReading()
Returns true if read position is past the end of the fill.
unsigned int p_requestPosition
Position of the cube requests.
int p_xCoef
viewport to sample/line x coef
void incReadPosition()
Increment read position.
QRect * p_rect
Rect this fill represents.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
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
double viewportToLine(int y)
Converts screen y position to cube line position.
int getReadPosition() const
Returns the current read position.
int p_yCoef
viewport to sample/line y coef
int getTopmostPixelPosition()
Returns the top of the X/Y bounding rect for this fill.