00001 #ifndef __GLIMSPROJECT_H 00002 #define __GLIMSPROJECT_H 00003 00004 #include "windows_defs.h" 00005 #include "configdlg.h" 00006 #include "viewset.h" 00007 #include "image.h" 00008 #include "vectorlayerset.h" 00009 #include "vectoreditor.h" 00010 #include "glimsdataset.h" 00011 #include "selectionset.h" 00012 #include "xmlserializeable.h" 00013 #include "projectdlg.h" 00014 #include "imagedlg.h" 00015 00016 #include <qobject.h> 00017 #include <qwidget.h> 00018 #include <qfiledialog.h> 00019 00020 #include <ctime> 00021 00022 #include <string> 00023 00024 #include "ValidationReportDlg.h" 00025 #include "TraceLog.h" 00026 00048 class GV_EXPORT GLIMSProject : public QObject, public XMLSerializeable { 00049 Q_OBJECT 00050 protected: 00051 Image *mImg; 00052 ImageState mImgState; 00053 GLIMSDataset *mGData; 00054 VectorLayerSet *mLyrSet; 00055 VectorEditor *mEditor; 00056 ViewSet *mViewSet; 00057 ConfigDlg *mConfigDlg; 00058 ValidationReportDlg *mValRepDlg ; 00059 bool mOpen; 00060 bool mNeedSave; 00061 QWidget *mParent; 00062 QDate *mVersion; 00063 00064 std::string mFileName; 00065 00066 ValidationReport *mValidationReport ; 00067 00068 QString mLoc ; 00069 00070 void setup( Image * ); 00071 00082 bool checkShapefileSet( const std::string &prefix ) const; 00083 00084 00089 int findIndex( const std::string &str, 00090 const std::vector<Attr> &attr ) { 00091 int i=0; 00092 for ( ; i < (int)attr.size(); i++ ) { 00093 if ( attr[i].id == str ) { 00094 break; 00095 } 00096 } 00097 if ( i >= (int)attr.size() ) { 00098 i = 0; 00099 } 00100 return i; 00101 } 00102 00110 int findIndexOfIdOrValue( const std::string &str, 00111 const std::vector<Attr> &attr ) { 00112 int i=0; 00113 for ( ; i < (int)attr.size(); i++ ) { 00114 if ( attr[i].id == str || attr[i].value == str ) { 00115 break; 00116 } 00117 } 00118 if ( i >= (int)attr.size() ) { 00119 i = 0; 00120 } 00121 return i; 00122 } 00123 00124 00125 public: 00126 GLIMSProject( QWidget *, ViewSet * ); 00127 virtual ~GLIMSProject( ) { 00128 close(); 00129 } 00130 00134 virtual bool toXML( 00135 QDomDocument &doc, 00136 QDomElement &elem, 00137 std::string id = "" ); 00138 00142 virtual bool fromXML( QDomElement &elem ); 00143 00148 Image* getImage( ) { 00149 return mImg; 00150 } 00156 GLIMSDataset* getDataset( ) { 00157 return mGData; 00158 } 00162 VectorLayerSet* getVectorLayerSet( ) { 00163 return mLyrSet; 00164 } 00168 VectorEditor* getVectorEditor( ) { 00169 return mEditor; 00170 } 00176 ViewSet* getViewSet( ) { 00177 return mViewSet; 00178 } 00186 QDate* getVersion( ) { 00187 return mVersion; 00188 } 00192 bool isOpen( ) { 00193 return mOpen; 00194 } 00200 void setTimeStamp( ); 00201 00205 std::string getFileName () { 00206 return mFileName ; 00207 } 00208 00213 void putLoc (QString newLoc) { 00214 mLoc = newLoc ; 00215 } 00216 00217 public slots: 00224 bool open( ); 00228 bool create( ); 00235 bool save( ); 00241 bool saveAs( ); 00247 void openConfigDlg( ); 00248 00287 void exportGLIMSIngest( ); 00288 00308 QString importGLIMSIngestImageInfo( ); 00309 00329 void importGLIMSIngestData( ); 00330 00331 00341 void importSegmentsFromShapefile (); 00342 00352 void importGIDsFromShapefile () ; 00353 00358 void setUnsaved( ) { 00359 mNeedSave = true; 00360 } 00361 00365 bool close( ); 00366 00372 bool validate () ; 00373 00374 signals: 00375 void finishedIngestion () ; 00376 void finishedValidation () ; 00377 00378 }; 00379 00380 #endif 00381 00382 00383
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |