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 
14 class QRect;
15 class QPoint;
16 
17 namespace 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 
44  };
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 
87  void incReadPosition() {
89  }
90 
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
Isis::ViewportBufferFill::doneReading
bool doneReading()
Returns true if read position is past the end of the fill.
Definition: ViewportBufferFill.cpp:87
Isis::ViewportBufferAction::ActionType
ActionType
This uniquely identifies which child is instantiated.
Definition: ViewportBufferAction.h:26
Isis::ViewportBufferFill::p_rect
QRect * p_rect
Rect this fill represents.
Definition: ViewportBufferFill.h:121
Isis::ViewportBufferFill
Definition: ViewportBufferFill.h:29
Isis::ViewportBufferAction::fill
@ fill
ViewportBufferFill.
Definition: ViewportBufferAction.h:29
Isis::ViewportBufferFill::p_yCoef
int p_yCoef
viewport to sample/line y coef
Definition: ViewportBufferFill.h:129
Isis::ViewportBufferFill::viewportToSample
double viewportToSample(int x)
Converts screen x position to cube sample position.
Definition: ViewportBufferFill.h:53
Isis::ViewportBufferFill::STEPSIZE
static const int STEPSIZE
how many cube lines per paint if painting inbetween gets re-enabled
Definition: ViewportBufferFill.h:134
Isis::ViewportBufferFill::viewportToLine
double viewportToLine(int y)
Converts screen y position to cube line position.
Definition: ViewportBufferFill.h:64
Isis::ViewportBufferFill::getReadPosition
int getReadPosition() const
Returns the current read position.
Definition: ViewportBufferFill.h:82
Isis::ViewportBufferFill::shouldPaint
bool shouldPaint(int &linesToPaint)
Returns true if it is recommended to paint the fill area so far.
Definition: ViewportBufferFill.cpp:118
Isis::ViewportBufferFill::getTopmostPixelPosition
int getTopmostPixelPosition()
Returns the top of the X/Y bounding rect for this fill.
Definition: ViewportBufferFill.cpp:67
Isis::ViewportBufferAction
Definition: ViewportBufferAction.h:18
Isis::ViewportBufferFill::shouldRequestMore
bool shouldRequestMore()
Returns true if request position is past the end of the fill.
Definition: ViewportBufferFill.cpp:97
Isis::ViewportBufferFill::getRect
QRect * getRect()
Returns the rect that this action is filling in screen pixels.
Definition: ViewportBufferFill.h:101
Isis::ViewportBufferFill::p_xCoef
int p_xCoef
viewport to sample/line x coef
Definition: ViewportBufferFill.h:125
Isis::ViewportBufferFill::getLeftmostPixelPosition
int getLeftmostPixelPosition()
Returns the left of the X/Y bounding rect for this fill.
Definition: ViewportBufferFill.cpp:77
Isis::ViewportBufferFill::p_xScale
double p_xScale
viewport to sample/line x scalar
Definition: ViewportBufferFill.h:127
Isis::ViewportBufferFill::incRequestPosition
void incRequestPosition()
Increment request position.
Definition: ViewportBufferFill.h:92
Isis::ViewportBufferFill::getRequestPosition
int getRequestPosition() const
Returns the current request position (>= read position)
Definition: ViewportBufferFill.h:73
Isis::ViewportBufferFill::p_requestPosition
unsigned int p_requestPosition
Position of the cube requests.
Definition: ViewportBufferFill.h:119
Isis::ViewportBufferFill::p_readPosition
unsigned int p_readPosition
Position of the cube reads.
Definition: ViewportBufferFill.h:117
Isis::ViewportBufferFill::getActionType
virtual ViewportBufferAction::ActionType getActionType()
Returns the type of this class.
Definition: ViewportBufferFill.h:42
Isis::ViewportBufferFill::stop
void stop()
Cancels the current operation.
Definition: ViewportBufferFill.cpp:105
Isis::ViewportBufferFill::incReadPosition
void incReadPosition()
Increment read position.
Definition: ViewportBufferFill.h:87
Isis::ViewportBufferFill::p_topLeftPixel
QPoint * p_topLeftPixel
Top left of the viewport for this fill.
Definition: ViewportBufferFill.h:123
Isis::ViewportBufferFill::p_yScale
double p_yScale
viewport to sample/line y scalar
Definition: ViewportBufferFill.h:131
Isis::ViewportBufferFill::ViewportBufferFill
ViewportBufferFill(const QRect &rect, const int &xCoef, const double &xScale, const int &yCoef, const double &yScale, const QPoint &topLeftPixel)
Constructor.
Definition: ViewportBufferFill.cpp:30
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ViewportBufferFill::~ViewportBufferFill
~ViewportBufferFill()
Destructor.
Definition: ViewportBufferFill.cpp:50