matlas.h

Go to the documentation of this file.
00001 /**
00002  * \file matlas.h <mi32/matlas.h>
00003  * \brief Definitions for "atlas" library functions
00004  *
00005  * \if NODOC
00006  * $Id: matlas.h_v 1.17 2003/09/22 13:50:14 mju Exp $
00007  *
00008  * $Log: matlas.h_v $
00009  * Revision 1.17  2003/09/22 13:50:14  mju
00010  * Remove deprecated methods.
00011  *
00012  * Revision 1.16  2003/09/15 13:49:56  fileserver!dwilliss
00013  * Doxygen
00014  *
00015  * Revision 1.15  2003/08/28 15:26:04  scowan
00016  * Added ctor for matlas used list.
00017  *
00018  * Revision 1.14  2003/07/29 15:42:38  mju
00019  * Add SetBackgroundColor.
00020  *
00021  * Revision 1.13  2003/05/19 21:03:39  mju
00022  * Add SetCustomizePath.
00023  *
00024  * Revision 1.12  2003/05/14 21:19:48  mju
00025  * Allow access to 'Ini' handle.
00026  * Support interface customization.
00027  *
00028  * Revision 1.11  2003/04/29 21:18:23  mju
00029  * Add MATLASUSEDFILE class/list and use so can deal with RLK files.
00030  *
00031  * Revision 1.10  2003/02/18 16:37:52  mju
00032  * Add SetCenter method.
00033  *
00034  * Revision 1.9  2002/12/16 17:26:14  mju
00035  * Add multi-view open capability.
00036  *
00037  * Revision 1.8  2002/11/20 18:41:32  mju
00038  * Add CheckObject.
00039  *
00040  * Revision 1.7  2002/10/25 20:54:22  mju
00041  * Support all items settable in atlas file with methods to get.
00042  *
00043  * Revision 1.6  2002/08/22 14:55:02  mju
00044  * Simple MATLASERRITEM and define MATLASERRLIST.
00045  * Use list references in validation.
00046  *
00047  * Revision 1.5  2002/08/20 14:30:47  mju
00048  * Redesign to use MISTRING and OBJITEM.
00049  *
00050  * Revision 1.4  2001/09/28 17:57:07  mju
00051  * Add version using OBJITEM.
00052  *
00053  * Revision 1.3  2000/03/22 16:26:51  mju
00054  * Add MATLASINFO class.
00055  *
00056  * Revision 1.1  1999/06/28  15:06:30  mju
00057  * Initial revision
00058  * \endif
00059 **/
00060 
00061 #ifndef  INC_MI32_MATLAS_H
00062 #define  INC_MI32_MATLAS_H
00063 
00064 #ifndef INC_MI32_FILEPATH_H
00065    #include <mi32/filepath.h>
00066 #endif
00067 
00068 #ifndef  INC_MI32_RVCDEFNS_H
00069    #include <mi32/rvcdefns.h>
00070 #endif
00071 
00072 #ifndef  INC_GRE_GEOLOCK_H
00073    #include <gre/geolock.h>
00074 #endif
00075 
00076 #include <vector>
00077 
00078 
00079 class MATLASINFO {
00080    public:
00081 
00082       class VIEWINFO {
00083          public:
00084 
00085             struct POSITION {
00086                int m_xinit;
00087                int m_xsize;
00088                int m_xrange;
00089                int m_yinit;
00090                int m_ysize;
00091                int m_yrange;
00092 
00093                POSITION ();
00094                bool IsValid () const;
00095                void SerialGetString (
00096                   char *string            //!< String to contain values, should be at least 64 bytes
00097                   ) const;
00098                bool SerialSetString (
00099                   const char *string      //!< String to set from
00100                   );
00101                void Set (int xinit, int xsize, int xrange, int yinit, int ysize, int yrange) {
00102                   m_xinit = xinit; m_xsize = xsize; m_xrange = xrange;
00103                   m_yinit = yinit; m_ysize = ysize; m_yrange = yrange;
00104                   }
00105                };
00106 
00107             VIEWINFO (
00108                ) : m_LegendShowMode(0) { }
00109 
00110             const GRE_GEOLOCKSETTINGS& GetGeoLockSettings (
00111                ) const { return (m_GeoLockSettings); }
00112 
00113             const UINT8 GetLegendShowMode (
00114                ) const { return (m_LegendShowMode); }
00115 
00116             const POSITION& GetPosition (
00117                ) const { return (m_Position); }
00118 
00119             void SetGeoLockSettings (
00120                const GRE_GEOLOCKSETTINGS& GeoLockSettings
00121                ) { m_GeoLockSettings = GeoLockSettings; }
00122 
00123             void SetPosition (
00124                const POSITION& Position
00125                ) { m_Position = Position; }
00126 
00127          private:
00128             #ifndef GENERATING_DOXYGEN_OUTPUT
00129             UINT8 m_LegendShowMode;
00130             GRE_GEOLOCKSETTINGS m_GeoLockSettings;
00131             POSITION m_Position;
00132             friend class MATLASINFO;
00133             #endif // GENERATING_DOXYGEN_OUTPUT
00134          };
00135 
00136       //! Default constructor.
00137       MATLASINFO (
00138          );
00139 
00140       //! Copy constructor.
00141       MATLASINFO (
00142          const MATLASINFO& rhs
00143          );
00144 
00145       //! Destructor.
00146       ~MATLASINFO (
00147          );
00148 
00149       //! Assignment.
00150       MATLASINFO& operator= (
00151          const MATLASINFO& rhs
00152          );
00153 
00154       //! Check if object referenced by atlas actually exists.
00155       ERRVALUE CheckObject (
00156          ) const;
00157 
00158       //! Read atlas file.
00159       ERRVALUE FileRead (
00160          const FILEPATH& filepath
00161          );
00162 
00163       //! Write atlas file.
00164       ERRVALUE FileWrite (
00165          const FILEPATH& filepath,
00166          bool wildcardfile = false
00167          );
00168 
00169       const COLOR& GetBackgroundColor (
00170          ) const { return (m_BackgroundColor); }
00171 
00172       bool GetCenter (
00173          DPOINT2D& Center
00174          ) const { Center = m_Center; return (m_HasCenter); }
00175 
00176       const FILEPATH& GetCustomizeFilePath (
00177          ) const { return (m_CustomizePath); }
00178 
00179       const INIHND& GetIniHandle (
00180          ) const { return (m_IniHandle); }
00181 
00182       const RVC::OBJITEM& GetObjectItem (
00183          ) const { return (m_ObjItem); }
00184 
00185       const MISTRING& GetTitle (
00186          ) const { return (m_Title); }
00187 
00188       int GetViewCount (
00189          ) const { return (m_ViewInfo.size()); }
00190 
00191       const VIEWINFO& GetViewInfo (
00192          unsigned index
00193          ) const { return (m_ViewInfo[index]); }
00194 
00195       bool GetWidth (
00196          double& Width
00197          ) const { Width = m_Width; return (m_HasWidth); }
00198 
00199       bool GetZoom1X (
00200          ) const { return (m_Zoom1X); }
00201 
00202       bool IsAllowedCustomize (
00203          ) const { return (m_AllowCustomize); }
00204 
00205       bool IsOpenDisabled (
00206          ) const { return (m_IsOpenDisabled); }
00207 
00208       void SetAllowedCustomize (
00209          bool AllowCustomize
00210          ) { m_AllowCustomize = AllowCustomize; }
00211 
00212       void SetBackgroundColor (
00213          const COLOR& BackgroundColor
00214          ) { m_BackgroundColor = BackgroundColor; }
00215 
00216       void SetCenter (
00217          const DPOINT2D& center
00218          ) { m_Center = center; m_HasCenter = true; }
00219 
00220       void SetCustomizeFilePath (
00221          const FILEPATH& CustomizePath
00222          ) { m_CustomizePath = CustomizePath; }
00223 
00224       ERRVALUE SetObject (
00225          const RVC::OBJITEM& objitem
00226          );
00227 
00228       void SetTitle (
00229          const UNICODE *Title
00230          ) { m_Title = Title; }
00231 
00232       void SetWidth (
00233          double Width
00234          ) { m_Width = Width; m_HasWidth = true; }
00235 
00236       void SetZoom1X (
00237          bool Zoom1X
00238          ) { m_Zoom1X = Zoom1X; }
00239 
00240    private:
00241       #ifndef GENERATING_DOXYGEN_OUTPUT
00242 
00243       //! Explicitly initialized
00244       bool m_HasCenter;
00245       bool m_HasWidth;
00246       bool m_Zoom1X;
00247       bool m_IsOpenDisabled;
00248       bool m_AllowCustomize;
00249       double m_Width;
00250       //! Self initializing
00251       INIHND m_IniHandle;
00252       MISTRING m_Title;
00253       RVC::OBJITEM m_ObjItem;
00254       COLOR m_BackgroundColor;
00255       DPOINT2D m_Center;
00256       std::vector<VIEWINFO> m_ViewInfo;
00257       FILEPATH m_CustomizePath;
00258       #endif // GENERATING_DOXYGEN_OUTPUT
00259 
00260    };
00261 
00262 class MATLASUSEDFILE {
00263    public:
00264       MATLASUSEDFILE (const RVCFILEHANDLE& rvcfhandle);
00265       MATLASUSEDFILE (const RVC::OBJECT& Object);
00266       MATLASUSEDFILE (const FILEPATH& filepath);
00267       const FILEPATH& GetPathActual () const { return (m_PathActual); }
00268       const FILEPATH& GetPathRLK () const { return (m_PathRLK); }
00269       bool HasRLK () const { return (m_HasRLK); }
00270    private:
00271       #ifndef GENERATING_DOXYGEN_OUTPUT
00272       FILEPATH m_PathActual;
00273       FILEPATH m_PathRLK;
00274       bool m_HasRLK;
00275       #endif // GENERATING_DOXYGEN_OUTPUT
00276    };
00277 typedef MILIST<MATLASUSEDFILE> MATLASUSEDFILELIST;
00278 
00279 struct MATLASERRITEM {           //! Validation error list item
00280    ERRVALUE errcode;                //!< TNT error code
00281    RVC::OBJITEM errobjitem;         //!< Object item having error
00282    RVC::OBJITEM refobjitem;         //!< Object item referencing bad file/object
00283    };
00284 
00285 typedef MILIST<MATLASERRITEM> MATLASERRLIST;
00286 
00287 //-----------------------------------------------------------------------------
00288 //!      Function prototypes
00289 //-----------------------------------------------------------------------------
00290 
00291 //! Validate atlas starting from specified object.
00292 ERRVALUE MatlasValidate (
00293    const RVC::OBJITEM& ObjItem,        //!< Starting object
00294    MATLASUSEDFILELIST& UsedFileList,   //!< List of "used" files returned
00295    MATLASERRLIST& ErrorList            //!< List of "errors" returned
00296    );
00297 
00298 #endif

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