00001 #include <iostream> 00002 #include "viewset.h" 00003 00004 00005 void ViewSet::addView( View &view ) { 00006 if ( mMenuGroup ) { 00007 ViewPopupAction *action = new ViewPopupAction( 00008 view.getViewState().mName.c_str(), 00009 view.getViewState().mName.c_str(), 00010 0, 00011 mMenuGroup ); 00012 // action->addTo( mMenuParent ); 00013 connect( action, 00014 SIGNAL( selected( ViewPopupAction* ) ), 00015 this, 00016 SLOT( popupView( ViewPopupAction* ) ) ); 00017 mMenuGroup->removeFrom( mMenuParent ); 00018 mMenuGroup->addTo( mMenuParent ); 00019 } 00020 00021 mViewSet.push_back( &view ); 00022 emit viewSetChanged(); 00023 } 00024 00025 void ViewSet::delView( int iview ) { 00026 if ( iview < 0 || iview >= (int)mViewSet.size() ) 00027 return; 00028 00029 delete mViewSet[iview]; 00030 mViewSet.erase( mViewSet.begin() + iview ); 00031 emit viewSetChanged(); 00032 } 00033 00034 unsigned int ViewSet::size( ) { 00035 return mViewSet.size(); 00036 } 00037 00038 View& ViewSet::getView( int iview ) { 00039 return *mViewSet[iview]; 00040 } 00041 00042 void ViewSet::redrawViews( ) { 00043 for ( unsigned int iview=0; iview < mViewSet.size(); iview++ ) { 00044 mViewSet[iview]->fullRedraw( ); 00045 } 00046 } 00047 00048 void ViewSet::repaintViews( ) { 00049 unsigned int iview = 0 ; 00050 unsigned int viewSetSize = mViewSet.size() ; 00051 for ( iview = 0 ; iview < viewSetSize ; iview++ ) { 00052 mViewSet[iview]->repaint( false ); 00053 } 00054 } 00055 00056 void ViewSet::setSelBox( Rect &selbox ) { 00057 for ( unsigned int iview=0; iview < mViewSet.size(); iview++ ) 00058 mViewSet[iview]->selBoxChanged( selbox ); 00059 } 00060 00061 void ViewSet::resetViews( ) { 00062 unsigned int iview = 0; 00063 for ( iview=0; iview < mViewSet.size(); iview++ ) { 00064 mViewSet[iview]->resetView(); 00065 } 00066 for ( iview=0; iview < mViewSet.size(); iview++ ) { 00067 mViewSet[iview]->fullRedraw(); 00068 } 00069 } 00070 00071 void ViewSet::initViews( ) { 00072 unsigned int iview; 00073 for ( iview=0; iview < mViewSet.size(); iview++ ) 00074 mViewSet[iview]->initView(); 00075 for ( iview=0; iview < mViewSet.size(); iview++ ) 00076 mViewSet[iview]->fullRedraw(); 00077 } 00078 00079 void ViewSet::popupView( ViewPopupAction *act ) { 00080 std::string mtext = (const char*)act->menuText(); 00081 for ( unsigned int iview=0; iview < mViewSet.size(); iview++ ) { 00082 View *v = mViewSet[iview]; 00083 if ( v->getViewState().mName == mtext ) { 00084 v->show(); 00085 v->setFocus(); 00086 } 00087 } 00088 } 00089 00090 void ViewSet::setRSM( ImageFormat::ScaleType st ) { 00091 for ( unsigned int iview=0; iview < mViewSet.size(); iview++ ) { 00092 mViewSet[iview]->setRSM( st ); 00093 } 00094 } 00095
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |