00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef INC_MI32_GEOCATD_H
00040 #define INC_MI32_GEOCATD_H
00041
00042 #ifndef INC_MI32_MIDIALOG_H
00043 #include <mi32/midialog.h>
00044 #endif
00045
00046 #ifndef INC_MI32_THUMBNLV_H
00047 #include <mi32/thumbnlv.h>
00048 #endif
00049
00050 #ifndef INC_MI32_MILIST_H
00051 #include <mi32/milist.h>
00052 #endif
00053
00054 #ifndef INC_MI32_GEOCAT_H
00055 #include <mi32/geocat.h>
00056 #endif
00057
00058 #ifndef INC_MI32_SPATREF_H
00059 #include <mi32/spatref.h>
00060 #endif
00061
00062 #ifndef INC_MI32_FORMTBFL_H
00063 #include <mi32/formpjpt.h>
00064 #endif
00065
00066 #ifndef INC_MGUI_FORMEXTENS_H
00067 #include <mgui/formextents.h>
00068 #endif
00069
00070 #define GEOCAT_MAXOBJTYPES 16
00071
00072
00073
00074
00075
00076
00077 class GEOCAT_DIALOG : public MIDIALOG {
00078 public:
00079
00080 GEOCAT_DIALOG (
00081 );
00082
00083 virtual ~GEOCAT_DIALOG (
00084 );
00085
00086
00087 void ClearSelectedObjects (
00088 ) {
00089 m_tnv.ClearSelectedObjects();
00090 return;
00091 }
00092
00093
00094
00095
00096 bool GetSelectedObject (
00097 RVCOBJITEM& objitem
00098 ) const {
00099 return (m_tnv.GetSelectedObject(objitem));
00100 }
00101
00102
00103
00104
00105 bool GetSelectedObjects (
00106 RVCOBJITEMLIST& objlist
00107 ) const {
00108 return (m_tnv.GetSelectedObjects(objlist));
00109 }
00110
00111
00112
00113
00114
00115
00116 void SetAllowedObjTypes (
00117 const SIMPLE_ARRAY<UINT16>& objtypes
00118 );
00119
00120
00121 void SetSearchExtents (
00122 const DRECT2D& SearchExtents,
00123 const SPATREF::COORDREFSYS& ExtentsCRS
00124 );
00125
00126
00127
00128 void SetSearchObjType (
00129 UINT16 objtype
00130 );
00131
00132
00133
00134 void SetSearchObjTypes (
00135 const SIMPLE_ARRAY<UINT16>& objtypes
00136 );
00137
00138
00139 void SetSearchPoint (
00140 const DPOINT2D& SearchPoint,
00141 const SPATREF::COORDREFSYS& PointCRS
00142 );
00143
00144 protected:
00145
00146
00147 virtual const char* GetDialogHelpID (
00148 ) const {
00149 return ("geocatalog.search");
00150 }
00151
00152
00153 virtual const char* GetDialogName (
00154 ) const {
00155 return ("search_geospatial_catalog");
00156 }
00157
00158
00159
00160
00161 virtual void OnApply (
00162 );
00163
00164
00165 virtual ERRVALUE OnInitDialog (
00166 Widget form
00167 );
00168
00169
00170 virtual void OnOpen (
00171 );
00172
00173
00174 virtual void OnOK (
00175 );
00176
00177 private:
00178 #ifndef GENERATING_DOXYGEN_OUTPUT
00179
00180 enum EXTENTSPEC {
00181 EXTENTSPEC_Range,
00182 EXTENTSPEC_Point,
00183 EXTENTSPEC_Region
00184 };
00185
00186 class TNV : public THUMBNAILVIEW {
00187 public:
00188
00189 GEOCAT_DIALOG *m_dlg;
00190
00191 explicit TNV (
00192 GEOCAT_DIALOG *dlg
00193 ):
00194 m_dlg(dlg)
00195 { }
00196
00197 virtual void OnSelection (
00198 );
00199
00200 };
00201
00202 class PTFORM : public MXFORM_PROJPOINT {
00203 public:
00204
00205 GEOCAT_DIALOG *m_dlg;
00206
00207 explicit PTFORM (
00208 GEOCAT_DIALOG *dlg
00209 ):
00210 m_dlg(dlg)
00211 { }
00212
00213 virtual void OnChangePoint (
00214 );
00215
00216 virtual void OnChangeCoordRefSys (
00217 );
00218 };
00219
00220
00221 TNV m_tnv;
00222 PTFORM m_ExtPointForm;
00223
00224 EXTENTSPEC m_ExtentSpec;
00225 bool m_NeedNewSearch;
00226 bool m_UseSearchExtents;
00227 mutable bool m_CatFileListChanged;
00228 double m_MinCoverage;
00229 double m_MinContainment;
00230 Widget m_TabPages;
00231 Widget m_CatFileList;
00232 Widget m_ObjTypeTB[GEOCAT_MAXOBJTYPES];
00233 Widget m_ExtForm;
00234 Widget m_ExtRangeForm;
00235 Widget m_ExtRegionForm;
00236 Widget m_ExtRegionXeT;
00237 Widget m_MinCoverageP;
00238 Widget m_MinContainmentP;
00239 Widget m_ObjCountLabel;
00240 BITSET m_AllowedObjTypes;
00241 BITSET m_SearchObjTypes;
00242 MGUI::FORM_EDIT_EXTENTS_T<GEOCAT_DIALOG> m_FormExtents;
00243
00244 MILIST<GEOCAT*> m_GeoCatList;
00245 DRECT2D m_SearchExtents;
00246 SPATREF::COORDREFSYS m_SearchExtentsCRS;
00247 REGION2D m_SearchRegion;
00248
00249 static void CB_CatalogAdd (Widget, GEOCAT_DIALOG*, void*);
00250 static void CB_CatalogRemove (Widget, GEOCAT_DIALOG*, void*);
00251 static void CB_CatalogRemoveAll (Widget, GEOCAT_DIALOG*, void*);
00252 static void CB_ExtentRegionSpecify (Widget, GEOCAT_DIALOG*, void*);
00253 static void CB_OptionExtentSpec (Widget, void*, void*);
00254 static void CB_ToggleSearchObjType (Widget, void*, XmToggleButtonCallbackStruct *);
00255 static void CB_ToggleUseSearchExtents (Widget, void*, XmToggleButtonCallbackStruct *);
00256 static void PCB_SearchChange (MxPromptCallbackStruct*, GEOCAT_DIALOG*);
00257
00258 static void ActivatePage (Widget, int, GEOCAT_DIALOG*);
00259 static void CreatePageCatalogs (Widget, int, GEOCAT_DIALOG*);
00260 static void CreatePageSearch (Widget, int, GEOCAT_DIALOG*);
00261 static void CreatePageResults (Widget, int, GEOCAT_DIALOG*);
00262
00263 MXPRMTCB_ADD(GEOCAT_DIALOG);
00264
00265 void AddCatalogFiles ();
00266 void ClearCatalogList ();
00267 void DoSearch ();
00268 bool HasSearchCriteria () const;
00269 void ManageExtForm () const;
00270 void OnExtentsRangeChange ();
00271 void SaveCatFileListIni () const;
00272 void SetSensitive () const;
00273 void UpdateSearchPage () const;
00274
00275
00276 GEOCAT_DIALOG (const GEOCAT_DIALOG&);
00277 GEOCAT_DIALOG& operator= (const GEOCAT_DIALOG&);
00278
00279 friend class PTFORM;
00280 #endif
00281 };
00282
00283
00284 #endif