GLIMSView Source Code Documentation

View Class Reference

#include <view.h>

Inheritance diagram for View:

Inheritance graph
[legend]

List of all members.


Detailed Description

This presents the user with a empty widget that draws onto itself the image specified by the project and all layers that are visible in the layer set.

This captures user events and emits signals for each allowing classes such as VectorEditor to handle user input.

Definition at line 28 of file view.h.


Public Types

enum  Tool {
  NO_TOOL, PAN_HAND, ZOOMIN_BOX, ZOOMOUT_BOX,
  ZOOMIN_INC, ZOOMOUT_INC, LINE, GLACIER_ID,
  POINTER, SELECTION
}

Public Slots

void timerDone ()
void setLinkLimits (Rect)
void setVirDims (Rect)
void setLinkBoxDims (Rect)
void selBoxChanged (Rect &)
void ctableChanged ()

Signals

void parentVirDimsChanged (Rect)
void parentLinkBoxChanged (Rect)
void childVirDimsChanged (Rect)
void mousePosChanged (View::MousePos, View::MousePos)
void viewMouseMove (QMouseEvent *, View::MouseState &)
void viewMousePress (QMouseEvent *, View::MouseState &)
void viewMouseRelease (QMouseEvent *, View::MouseState &)
void viewKeyPress (QKeyEvent *)
void viewKeyRelease (QKeyEvent *)

Public Member Functions

 View (QWidget *parent)
 View (QWidget *parent, Image *img, VectorLayerSet *)
virtual ~View ()
void init ()
void setImage (Image *img)
void setVectorLayerSet (VectorLayerSet *lyrset)
void setLinkChild (View *linkview)
void setLinkParent (View *linkview)
void setZoomAttr (ZoomAttr attr)
ZoomAttrgetZoomAttr () const
void captureImage ()
void calcDims ()
void fullRedraw ()
const RectgetVirDims () const
void dspToVir (double &x, double &y)
void virToDsp (double &x, double &y)
void dspToVir (int &x, int &y)
void virToDsp (int &x, int &y)
Rect virDimToDsp (const Rect &dim)
void initView ()
void resetView ()
void loadCaption ()
void setViewName (std::string name)
ViewStategetViewState ()
void centerOn (double x, double y)
void setEditable (bool b)
MouseStategetMouseState ()
void setRSM (ImageFormat::ScaleType st)
ImageFormat::ScaleType getRSM ()
void paintEvent (QPaintEvent *)
void mouseMoveEvent (QMouseEvent *)
void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void keyPressEvent (QKeyEvent *)
void keyReleaseEvent (QKeyEvent *)
void resizeEvent (QResizeEvent *)
virtual char * getHistName () const
virtual HistogramSet getHistSet () const
virtual void setHistogramDlg (HistogramDlg *hdlg)

Static Public Attributes

static Tool mTool = NO_TOOL
static HistogramUser mGlbHistUser

Protected Attributes

ViewState mState
MouseState mMouse
Rect mVirDims
Rect mDspDims
Rect mLnkDims
Rect mLinkLimits
Box mLinkBox
bool mChildLinked
bool mParentLinked
Rect mSelBox
ImagemImage
VectorLayerSetmLyrSet
bool mDspImg
bool mDspVec
QPixmap * mCurScreen
QImage * mCurImg
bool mFullRedraw
QTimer * mTimer
bool mCTableNew
bool mPaning
ImageFormat::ScaleType mSclType
HistogramDlgmHistDlg

Classes

struct  Box
 Structure to hold box information. More...
struct  MousePos
 Structure to hold mouse position information. More...
struct  MouseState
 Structure to hold mouse state information. More...

Member Enumeration Documentation

enum View::Tool

Enumerator:
NO_TOOL 
PAN_HAND 
ZOOMIN_BOX 
ZOOMOUT_BOX 
ZOOMIN_INC 
ZOOMOUT_INC 
LINE 
GLACIER_ID 
POINTER 
SELECTION 

Definition at line 31 of file view.h.


Constructor & Destructor Documentation

View::View ( QWidget parent  ) 

Definition at line 7 of file view.cpp.

References init().

Here is the call graph for this function:

View::View ( QWidget parent,
Image img,
VectorLayerSet vls 
)

Definition at line 13 of file view.cpp.

References init(), mImage, and mLyrSet.

Here is the call graph for this function:

View::~View (  )  [virtual]

Definition at line 21 of file view.cpp.

References mTimer.


Member Function Documentation

void View::init (  ) 

void View::setImage ( Image img  ) 

Definition at line 100 of file view.cpp.

References calcDims(), and mImage.

Referenced by MainToolbar::setupProj().

Here is the call graph for this function:

void View::setVectorLayerSet ( VectorLayerSet lyrset  )  [inline]

Definition at line 110 of file view.h.

References mLyrSet.

Referenced by MainToolbar::setupProj().

void View::setLinkChild ( View linkview  ) 

void View::setLinkParent ( View linkview  ) 

Definition at line 127 of file view.cpp.

References childVirDimsChanged(), View::Box::dim, getViewState(), getVirDims(), mChildLinked, ViewState::mChildName, mLinkBox, ViewState::mName, mState, and setLinkBoxDims().

Referenced by MainToolbar::buildDefaultViews().

Here is the call graph for this function:

void View::setZoomAttr ( ZoomAttr  attr  ) 

Definition at line 161 of file view.cpp.

References calcDims(), ZoomAttr::FIXED, Rect::h, mDspDims, mFullRedraw, mState, mVirDims, ViewState::mZoom, ZoomAttr::SCALE, ZoomAttr::type, Rect::w, Rect::x, and Rect::y.

Referenced by MainToolbar::buildDefaultViews().

Here is the call graph for this function:

ZoomAttr * View::getZoomAttr (  )  const

Definition at line 183 of file view.cpp.

References mState, and ViewState::mZoom.

void View::captureImage (  ) 

void View::calcDims (  ) 

void View::fullRedraw (  ) 

Definition at line 330 of file view.cpp.

References mFullRedraw.

Referenced by setRSM().

const Rect & View::getVirDims (  )  const

Definition at line 712 of file view.cpp.

References mVirDims.

Referenced by setLinkChild(), and setLinkParent().

void View::dspToVir ( double &  x,
double &  y 
)

void View::virToDsp ( double &  x,
double &  y 
)

Definition at line 723 of file view.cpp.

References ZoomAttr::factor, mState, mVirDims, ViewState::mZoom, Rect::x, and Rect::y.

Referenced by virDimToDsp(), and virToDsp().

void View::dspToVir ( int &  x,
int &  y 
)

Definition at line 730 of file view.cpp.

References dspToVir().

Here is the call graph for this function:

void View::virToDsp ( int &  x,
int &  y 
)

Definition at line 739 of file view.cpp.

References virToDsp().

Here is the call graph for this function:

Rect View::virDimToDsp ( const Rect dim  ) 

Definition at line 748 of file view.cpp.

References Rect::h, virToDsp(), Rect::w, Rect::x, and Rect::y.

Referenced by paintEvent().

Here is the call graph for this function:

void View::initView (  ) 

Definition at line 66 of file view.cpp.

References mImage, resetView(), viewKeyPress(), viewKeyRelease(), viewMouseMove(), viewMousePress(), and viewMouseRelease().

Here is the call graph for this function:

void View::resetView (  ) 

Definition at line 80 of file view.cpp.

References View::Box::dim, Rect::h, mCurImg, mFullRedraw, mLinkBox, View::Box::moving, mVirDims, Rect::w, Rect::x, and Rect::y.

Referenced by initView().

void View::loadCaption (  )  [inline]

Definition at line 129 of file view.h.

References ZoomAttr::factor, ViewState::mName, mState, and ViewState::mZoom.

Referenced by mousePressEvent(), resizeEvent(), setViewName(), and timerDone().

void View::setViewName ( std::string  name  )  [inline]

Definition at line 137 of file view.h.

References loadCaption(), ViewState::mName, and mState.

Referenced by MainToolbar::buildDefaultViews().

Here is the call graph for this function:

ViewState& View::getViewState (  )  [inline]

Definition at line 142 of file view.h.

References mState.

Referenced by ViewSet::addView(), MainToolbar::fromXML(), ViewSet::popupView(), setLinkChild(), and setLinkParent().

void View::centerOn ( double  x,
double  y 
)

void View::setEditable ( bool  b  )  [inline]

Definition at line 148 of file view.h.

References ViewState::mEditable, and mState.

Referenced by MainToolbar::buildDefaultViews().

MouseState& View::getMouseState (  )  [inline]

Definition at line 152 of file view.h.

References mMouse.

void View::setRSM ( ImageFormat::ScaleType  st  )  [inline]

Definition at line 156 of file view.h.

References fullRedraw(), and mSclType.

Here is the call graph for this function:

ImageFormat::ScaleType View::getRSM (  )  [inline]

Definition at line 159 of file view.h.

References mSclType.

void View::paintEvent ( QPaintEvent *   ) 

void View::mouseMoveEvent ( QMouseEvent *  me  ) 

void View::mousePressEvent ( QMouseEvent *  me  ) 

void View::mouseReleaseEvent ( QMouseEvent *  me  ) 

void View::keyPressEvent ( QKeyEvent *  ke  ) 

Definition at line 644 of file view.cpp.

References centerOn(), dspToVir(), View::MouseState::mCurPos, ViewState::mEditable, mMouse, mState, viewKeyPress(), View::MousePos::x, and View::MousePos::y.

Here is the call graph for this function:

void View::keyReleaseEvent ( QKeyEvent *  ke  ) 

Definition at line 654 of file view.cpp.

References ViewState::mEditable, mState, and viewKeyRelease().

void View::resizeEvent ( QResizeEvent *   ) 

Definition at line 634 of file view.cpp.

References calcDims(), loadCaption(), and mTimer.

Here is the call graph for this function:

char * View::getHistName (  )  const [virtual]

Implements HistogramDataSource.

Definition at line 659 of file view.cpp.

References ViewState::mName, and mState.

HistogramSet View::getHistSet (  )  const [virtual]

Implements HistogramDataSource.

Definition at line 663 of file view.cpp.

References Image::getImageState(), ImageState::mBlue, mCurImg, ImageState::mGreen, mImage, ImageState::mRed, and HistogramSet::setData().

Here is the call graph for this function:

void View::timerDone (  )  [slot]

Definition at line 706 of file view.cpp.

References loadCaption(), and mFullRedraw.

Referenced by init().

void View::setLinkLimits ( Rect  d  )  [slot]

Definition at line 141 of file view.cpp.

References mLinkLimits.

Referenced by setLinkChild().

void View::setVirDims ( Rect  d  )  [slot]

Definition at line 145 of file view.cpp.

References View::Box::dim, mChildLinked, mFullRedraw, mLinkBox, mVirDims, parentLinkBoxChanged(), Rect::x, and Rect::y.

Referenced by setLinkChild().

void View::setLinkBoxDims ( Rect  d  )  [slot]

Definition at line 156 of file view.cpp.

References View::Box::dim, and mLinkBox.

Referenced by setLinkParent().

void View::selBoxChanged ( Rect dim  )  [slot]

Definition at line 768 of file view.cpp.

References mSelBox.

void View::ctableChanged (  )  [slot]

Definition at line 772 of file view.cpp.

References mCTableNew.

void View::parentVirDimsChanged ( Rect   )  [signal]

Referenced by centerOn(), paintEvent(), and setLinkChild().

void View::parentLinkBoxChanged ( Rect   )  [signal]

void View::childVirDimsChanged ( Rect   )  [signal]

Referenced by centerOn(), paintEvent(), and setLinkParent().

void View::mousePosChanged ( View::MousePos  ,
View::MousePos   
) [signal]

Referenced by mouseMoveEvent().

void View::viewMouseMove ( QMouseEvent *  ,
View::MouseState  
) [signal]

Referenced by initView(), and mouseMoveEvent().

void View::viewMousePress ( QMouseEvent *  ,
View::MouseState  
) [signal]

Referenced by initView(), and mousePressEvent().

void View::viewMouseRelease ( QMouseEvent *  ,
View::MouseState  
) [signal]

Referenced by initView(), and mouseReleaseEvent().

void View::viewKeyPress ( QKeyEvent *   )  [signal]

Referenced by initView(), and keyPressEvent().

void View::viewKeyRelease ( QKeyEvent *   )  [signal]

Referenced by initView(), and keyReleaseEvent().

virtual void HistogramDataSource::setHistogramDlg ( HistogramDlg hdlg  )  [inline, virtual, inherited]

Definition at line 59 of file histogramdatasource.h.

References HistogramDataSource::mHistDlg.

Referenced by HistogramDlg::addHDS().


Member Data Documentation

View::Tool View::mTool = NO_TOOL [static]

Definition at line 76 of file view.h.

Referenced by MainToolbar::buildViews(), MainToolbar::MainToolbar(), and paintEvent().

ViewState View::mState [protected]

MouseState View::mMouse [protected]

Rect View::mVirDims [protected]

Rect View::mDspDims [protected]

Definition at line 82 of file view.h.

Referenced by calcDims(), mouseMoveEvent(), paintEvent(), and setZoomAttr().

Rect View::mLnkDims [protected]

Definition at line 83 of file view.h.

Rect View::mLinkLimits [protected]

Definition at line 84 of file view.h.

Referenced by mouseReleaseEvent(), setLinkChild(), and setLinkLimits().

Box View::mLinkBox [protected]

bool View::mChildLinked [protected]

Definition at line 86 of file view.h.

Referenced by init(), mouseReleaseEvent(), paintEvent(), setLinkParent(), and setVirDims().

bool View::mParentLinked [protected]

Definition at line 87 of file view.h.

Referenced by init(), and setLinkChild().

Rect View::mSelBox [protected]

Definition at line 88 of file view.h.

Referenced by init(), paintEvent(), and selBoxChanged().

Image* View::mImage [protected]

Definition at line 89 of file view.h.

Referenced by calcDims(), getHistSet(), init(), initView(), mouseMoveEvent(), paintEvent(), setImage(), and View().

Definition at line 90 of file view.h.

Referenced by paintEvent(), setVectorLayerSet(), and View().

bool View::mDspImg [protected]

Definition at line 91 of file view.h.

Referenced by init().

bool View::mDspVec [protected]

Definition at line 92 of file view.h.

Referenced by init().

QPixmap* View::mCurScreen [protected]

Definition at line 93 of file view.h.

Referenced by init(), and paintEvent().

QImage* View::mCurImg [protected]

Definition at line 94 of file view.h.

Referenced by getHistSet(), init(), paintEvent(), and resetView().

bool View::mFullRedraw [protected]

QTimer* View::mTimer [protected]

Definition at line 96 of file view.h.

Referenced by init(), resizeEvent(), and ~View().

bool View::mCTableNew [protected]

Definition at line 97 of file view.h.

Referenced by ctableChanged(), init(), and paintEvent().

bool View::mPaning [protected]

Definition at line 98 of file view.h.

Referenced by init(), mousePressEvent(), mouseReleaseEvent(), and paintEvent().

Definition at line 100 of file view.h.

Referenced by getRSM(), init(), paintEvent(), and setRSM().

Definition at line 47 of file histogramdatasource.h.

Referenced by paintEvent(), and HistogramDataSource::setHistogramDlg().


The documentation for this class was generated from the following files:

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov