USGS

Isis 3.0 Developer's Reference (API)

Home

ViewportBufferFill.h

Go to the documentation of this file.
00001 #ifndef VieportBufferFill_h
00002 #define VieportBufferFill_h
00003 
00004 #include "ViewportBufferAction.h"
00005 
00006 class QRect;
00007 class QPoint;
00008 
00009 namespace Isis {
00017   class ViewportBufferFill : public ViewportBufferAction {
00018     public:
00019       ViewportBufferFill(const QRect &rect, const int &xCoef,
00020                          const double &xScale, const int &yCoef,
00021                          const double &yScale, const QPoint &topLeftPixel);
00022       ~ViewportBufferFill();
00023 
00024 
00030       virtual ViewportBufferAction::ActionType getActionType() {
00031         return ViewportBufferAction::fill;
00032       };
00033 
00041       double viewportToSample(int x) {
00042         return (x + p_xCoef) / p_xScale;
00043       }
00044 
00052       double viewportToLine(int y) {
00053         return (y + p_yCoef) / p_yScale;
00054       }
00055 
00061       int getRequestPosition() const {
00062         return p_requestPosition;
00063       }
00064 
00070       int getReadPosition() const {
00071         return p_readPosition;
00072       }
00073 
00075       void incReadPosition() {
00076         p_readPosition++;
00077       }
00078 
00080       void incRequestPosition() {
00081         p_requestPosition++;
00082       }
00083 
00089       QRect *getRect() {
00090         return p_rect;
00091       }
00092 
00093       int getTopmostPixelPosition();
00094       int getLeftmostPixelPosition();
00095 
00096       bool doneReading();
00097       bool shouldRequestMore();
00098       bool shouldPaint(int &linesToPaint);
00099 
00100       void stop();
00101 
00102 
00103     private:
00105       unsigned int p_readPosition;
00107       unsigned int p_requestPosition;
00109       QRect *p_rect;
00111       QPoint *p_topLeftPixel;
00113       int p_xCoef;
00115       double p_xScale;
00117       int p_yCoef;
00119       double p_yScale;
00120 
00122       const static int STEPSIZE = 20;
00123   };
00124 }
00125 
00126 #endif