geocatd.h

Go to the documentation of this file.
00001 /**
00002  * \file geocatd.h <mi32/geocatd.h>
00003  * \brief Definitions for GEOCAT_DIALOG class
00004  *
00005  * \if NODOC
00006  * $Id: geocatd.h_v 1.9 2004/06/30 13:31:13 mju Exp $
00007  *
00008  * $Log: geocatd.h_v $
00009  * Revision 1.9  2004/06/30 13:31:13  mju
00010  * Use spatref.
00011  *
00012  * Revision 1.8  2004/06/28 17:55:21  mju
00013  * Convert to spatref system.
00014  *
00015  * Revision 1.7  2003/09/15 13:49:56  fileserver!dwilliss
00016  * Doxygen
00017  *
00018  * Revision 1.6  2000/09/20 17:48:07  mju
00019  * Add point searching.
00020  *
00021  * Revision 1.5  2000/09/18 19:46:38  mju
00022  * Add toggle for not using extents.
00023  *
00024  * Revision 1.4  2000/09/14 17:47:28  mju
00025  * Add region selection/searching.
00026  *
00027  * Revision 1.3  2000/09/13 17:09:14  mju
00028  * Begin adding region searching.
00029  *
00030  * Revision 1.2  2000/09/06 21:25:27  mju
00031  * Add search page stuff.
00032  *
00033  * Revision 1.1  2000/08/16 16:48:10  mju
00034  * Initial revision
00035  *
00036  * \endif
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 *  GEOCAT_DIALOG class definition
00075 **/
00076 
00077 class GEOCAT_DIALOG : public MIDIALOG {
00078    public:
00079 
00080       GEOCAT_DIALOG (
00081          );
00082 
00083       virtual ~GEOCAT_DIALOG (
00084          );
00085 
00086       //! Clear selected objects.
00087       void ClearSelectedObjects (
00088          ) {
00089          m_tnv.ClearSelectedObjects();
00090          return;
00091          }
00092 
00093       //! Get first selected object.
00094       //!
00095       //! @return true if any selected, false if not
00096       bool GetSelectedObject (
00097          RVCOBJITEM& objitem
00098          ) const {
00099          return (m_tnv.GetSelectedObject(objitem));
00100          }
00101 
00102       //! Get current selected object list.
00103       //!
00104       //! @return true if any selected, false if not.
00105       bool GetSelectedObjects (
00106          RVCOBJITEMLIST& objlist             //!< Selected object list filled in and returned
00107          ) const {
00108          return (m_tnv.GetSelectedObjects(objlist));
00109          }
00110 
00111       //! Set object types to search for.
00112       //! If used, this must be done before initially opening the dialog.
00113       //! If more than one type is allowed the 'Search' panel will include
00114       //! buttons to choose from among the specified types.  The default
00115       //! is to allow all "displayable" object types.
00116       void SetAllowedObjTypes (
00117          const SIMPLE_ARRAY<UINT16>& objtypes   //!< Object types user is allowed to search for
00118          );
00119 
00120       //! Set extents for next "range" search operation.
00121       void SetSearchExtents (
00122          const DRECT2D& SearchExtents,
00123          const SPATREF::COORDREFSYS& ExtentsCRS
00124          );
00125 
00126       //! Set single object type to search for.
00127       //! If object type is not allowed for searching the setting will be ignored
00128       void SetSearchObjType (
00129          UINT16 objtype                      //!< Object type to search for, OTYPE_ALL for all allowed types
00130          );
00131 
00132       //! Set object types to search for.
00133       //! Object types not "allowed" for selection will be ignored.
00134       void SetSearchObjTypes (
00135          const SIMPLE_ARRAY<UINT16>& objtypes   //!< Object types to search for
00136          );
00137 
00138       //! Set point for next "point" search operation.
00139       void SetSearchPoint (
00140          const DPOINT2D& SearchPoint,
00141          const SPATREF::COORDREFSYS& PointCRS
00142          );
00143 
00144    protected:
00145 
00146       //! Get dialog HelpID.
00147       virtual const char* GetDialogHelpID (
00148          ) const {
00149          return ("geocatalog.search");
00150          }
00151 
00152       //! Get dialog name for title resource.
00153       virtual const char* GetDialogName (
00154          ) const {
00155          return ("search_geospatial_catalog");
00156          }
00157 
00158       //! Called when user presses "Apply" or "OK" button.
00159       //! Derived class must call superclass OnApply() method before
00160       //! performing its own processing.
00161       virtual void OnApply (
00162          );
00163 
00164       //! Create dialog contents.
00165       virtual ERRVALUE OnInitDialog (
00166          Widget form
00167          );
00168 
00169       //! Called when dialog is opened.
00170       virtual void OnOpen (
00171          );
00172 
00173       //! Called when OK button pressed.
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       // UNIMPLEMENTED / UNSUPPORTED
00276       GEOCAT_DIALOG (const GEOCAT_DIALOG&);
00277       GEOCAT_DIALOG& operator= (const GEOCAT_DIALOG&);
00278 
00279       friend class PTFORM;
00280       #endif // GENERATING_DOXYGEN_OUTPUT
00281    };
00282 
00283 
00284 #endif   //!< INC_MI32_GEOCATD_H

Generated on Tue Dec 14 13:18:22 2004 for TNTsdk by  doxygen 1.3.8-20040913