00001
00059 #ifndef INC_MI32_MATLAS_H
00060 #define INC_MI32_MATLAS_H
00061
00062 #ifndef INC_MI32_MILIST_H
00063 #include <mi32/milist.h>
00064 #endif
00065
00066 #ifndef INC_RVC_OBJITEM_H
00067 #include <rvc/objitem.h>
00068 #endif
00069
00070 #ifndef INC_MI32_INIHND_H
00071 #include <mi32/inihnd.h>
00072 #endif
00073
00074 #ifndef INC_GRE_GEOLOCK_H
00075 #include <gre/geolock.h>
00076 #endif
00077
00078 #ifndef INC_MI32_COLOR_H
00079 #include <mi32/color.h>
00080 #endif
00081
00082 #ifndef INC_MI32_POINT_H
00083 #include <mi32/point.h>
00084 #endif
00085
00086 #ifndef INC_VECTOR
00087 #include <vector>
00088 #define INC_VECTOR
00089 #endif
00090
00091
00092 #ifndef GENERATING_DOXYGEN_OUTPUT
00093 namespace RVC {
00094 class OBJECT;
00095 }
00096 #endif
00097
00098
00099 class MATLASINFO {
00100 public:
00101
00102 class VIEWINFO {
00103 public:
00104
00105 struct POSITION {
00106 int m_xinit;
00107 int m_xsize;
00108 int m_xrange;
00109 int m_yinit;
00110 int m_ysize;
00111 int m_yrange;
00112
00113 POSITION ();
00114 bool IsValid () const;
00115 void SerialGetString (
00116 char *string
00117 ) const;
00118 bool SerialSetString (
00119 const char *string
00120 );
00121 void Set (int xinit, int xsize, int xrange, int yinit, int ysize, int yrange) {
00122 m_xinit = xinit; m_xsize = xsize; m_xrange = xrange;
00123 m_yinit = yinit; m_ysize = ysize; m_yrange = yrange;
00124 }
00125 };
00126
00127 VIEWINFO (
00128 ) : m_bSidebarVisible(true) { }
00129
00130 const GRE::GEOLOCKSETTINGS& GetGeoLockSettings (
00131 ) const { return (m_GeoLockSettings); }
00132
00133 const POSITION& GetPosition (
00134 ) const { return (m_Position); }
00135
00136 bool GetSidebarVisible () const
00137 { return (m_bSidebarVisible); }
00138
00139 void SetGeoLockSettings (
00140 const GRE::GEOLOCKSETTINGS& GeoLockSettings
00141 ) { m_GeoLockSettings = GeoLockSettings; }
00142
00143 void SetPosition (
00144 const POSITION& Position
00145 ) { m_Position = Position; }
00146
00147 private:
00148 #ifndef GENERATING_DOXYGEN_OUTPUT
00149 GRE::GEOLOCKSETTINGS m_GeoLockSettings;
00150 POSITION m_Position;
00151 bool m_bSidebarVisible;
00152 friend class MATLASINFO;
00153 #endif // GENERATING_DOXYGEN_OUTPUT
00154 };
00155
00157 MATLASINFO (
00158 );
00159
00161 MATLASINFO (
00162 const MATLASINFO& rhs
00163 );
00164
00166 ~MATLASINFO (
00167 );
00168
00170 MATLASINFO& operator= (
00171 const MATLASINFO& rhs
00172 );
00173
00175 ERRVALUE CheckObject (
00176 ) const;
00177
00179 ERRVALUE FileRead (
00180 const FILEPATH& filepath
00181 );
00182
00184 ERRVALUE FileWrite (
00185 const FILEPATH& filepath,
00186 bool wildcardfile = false
00187 );
00188
00189 const COLOR& GetBackgroundColor (
00190 ) const { return (m_BackgroundColor); }
00191
00192 bool GetCenter (
00193 DPOINT2D& Center
00194 ) const { Center = m_Center; return (m_HasCenter); }
00195
00196 const FILEPATH& GetCustomizeFilePath (
00197 ) const { return (m_CustomizePath); }
00198
00199 const INIHND& GetIniHandle (
00200 ) const { return (m_IniHandle); }
00201
00202 const RVC::OBJITEM& GetObjectItem (
00203 ) const { return (m_ObjItem); }
00204
00205 const RVC::OBJITEM& GetObjItemStartup (
00206 ) const { return (m_ObjItemStartup); }
00207
00208 const MISTRING& GetTitle (
00209 ) const { return (m_Title); }
00210
00211 int GetViewCount (
00212 ) const { return (m_ViewInfo.size()); }
00213
00214 const VIEWINFO& GetViewInfo (
00215 unsigned index
00216 ) const { return (m_ViewInfo[index]); }
00217
00218 bool GetWidth (
00219 double& Width
00220 ) const { Width = m_Width; return (m_HasWidth); }
00221
00222 bool GetZoom1X (
00223 ) const { return (m_Zoom1X); }
00224
00225 bool IsAllowedCustomize (
00226 ) const { return (m_AllowCustomize); }
00227
00228 bool IsOpenDisabled (
00229 ) const { return (m_IsOpenDisabled); }
00230
00231 void SetAllowedCustomize (
00232 bool AllowCustomize
00233 ) { m_AllowCustomize = AllowCustomize; }
00234
00235 void SetBackgroundColor (
00236 const COLOR& BackgroundColor
00237 ) { m_BackgroundColor = BackgroundColor; }
00238
00239 void SetCenter (
00240 const DPOINT2D& center
00241 ) { m_Center = center; m_HasCenter = true; }
00242
00243 void SetCustomizeFilePath (
00244 const FILEPATH& CustomizePath
00245 ) { m_CustomizePath = CustomizePath; }
00246
00247 ERRVALUE SetObject (
00248 const RVC::OBJITEM& objitem
00249 );
00250
00252 void SetObjItemStartup (
00253 const RVC::OBJITEM& ObjItem
00254 ) { m_ObjItemStartup = ObjItem; }
00255
00256 void SetTitle (
00257 const MIUNICODE *Title
00258 ) { m_Title = Title; }
00259
00260 void SetWidth (
00261 double Width
00262 ) { m_Width = Width; m_HasWidth = true; }
00263
00264 void SetZoom1X (
00265 bool Zoom1X
00266 ) { m_Zoom1X = Zoom1X; }
00267
00268 private:
00269 #ifndef GENERATING_DOXYGEN_OUTPUT
00270
00272 bool m_HasCenter;
00273 bool m_HasWidth;
00274 bool m_Zoom1X;
00275 bool m_IsOpenDisabled;
00276 bool m_AllowCustomize;
00277 double m_Width;
00279 INIHND m_IniHandle;
00280 MISTRING m_Title;
00281 RVC::OBJITEM m_ObjItem;
00282 RVC::OBJITEM m_ObjItemStartup;
00283 COLOR m_BackgroundColor;
00284 DPOINT2D m_Center;
00285 std::vector<VIEWINFO> m_ViewInfo;
00286 FILEPATH m_CustomizePath;
00287
00288 bool ReadObjItem (RVC::OBJITEM& ObjItem, const char *FileTag, const char *ObjTag);
00289 void WriteObjItem (RVC::OBJITEM& ObjItem, const char *FileTag, const char *ObjTag, bool wildcardfile);
00290 #endif // GENERATING_DOXYGEN_OUTPUT
00291
00292 };
00293
00294 class MATLASUSEDFILE {
00295 public:
00296 MATLASUSEDFILE (const RVC::OBJECT& Object);
00297 MATLASUSEDFILE (const FILEPATH& filepath);
00298 const FILEPATH& GetPathActual () const { return (m_PathActual); }
00299 const FILEPATH& GetPathRLK () const { return (m_PathRLK); }
00300 bool HasRLK () const { return (m_HasRLK); }
00301 private:
00302 #ifndef GENERATING_DOXYGEN_OUTPUT
00303 FILEPATH m_PathActual;
00304 FILEPATH m_PathRLK;
00305 bool m_HasRLK;
00306 #endif // GENERATING_DOXYGEN_OUTPUT
00307 };
00308 typedef MILIST<MATLASUSEDFILE> MATLASUSEDFILELIST;
00309
00310 struct MATLASERRITEM {
00311 ERRVALUE errcode;
00312 RVC::OBJITEM errobjitem;
00313 RVC::OBJITEM refobjitem;
00314 };
00315
00316 typedef MILIST<MATLASERRITEM> MATLASERRLIST;
00317
00318
00320
00321
00323 ERRVALUE MatlasValidate (
00324 const RVC::OBJITEM& ObjItem,
00325 MATLASUSEDFILELIST& UsedFileList,
00326 MATLASERRLIST& ErrorList
00327 );
00328
00329 #endif