00001 #include "vectorlayerset.h" 00002 #include <iostream> 00003 00004 VectorLayerSet::VectorLayerSet( ) : 00005 mActiveLayer( -1 ) { 00006 } 00007 00008 VectorLayerSet::~VectorLayerSet( ) { 00009 for ( int ilyr=0; ilyr < (int)mLayerSet.size(); ilyr++ ) 00010 delete mLayerSet[ilyr]; 00011 } 00012 00013 void VectorLayerSet::setActiveLayer( int ilyr ) { 00014 if ( ilyr < 0 && ilyr >= (int)mLayerSet.size() ) 00015 return; 00016 mActiveLayer = ilyr; 00017 emit activeLayerChanged( mActiveLayer ); 00018 } 00019 00020 int VectorLayerSet::getActiveLayer( ) const { 00021 return mActiveLayer; 00022 } 00023 00024 unsigned int VectorLayerSet::numLayers( ) const { 00025 return mLayerSet.size(); 00026 } 00027 00028 void VectorLayerSet::addLayer( VectorLayer *lyr ) { 00029 mLayerSet.push_back( lyr ); 00030 } 00031 00032 void VectorLayerSet::delLayer( int ) { 00033 00034 } 00035 00036 VectorLayer* VectorLayerSet::getLayer( int ilyr ) { 00037 if ( ilyr < 0 || ilyr >= (int)mLayerSet.size() ) 00038 return NULL; 00039 return mLayerSet[ilyr]; 00040 } 00041 00042