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
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef INC_GRE_VIEWABLE_H
00055 #define INC_GRE_VIEWABLE_H
00056
00057 #if !defined(INC_MI32_STDAFX_H) && defined(WIN32_MFC)
00058 #include <mi32/stdafx.h>
00059 #endif
00060
00061 #ifndef INC_GRE_OBJECTBASE_H
00062 #include <gre/objectbase.h>
00063 #endif
00064
00065 #ifndef INC_GRE_VIEWSCRIPT_H
00066 #include <gre/viewscript.h>
00067 #endif
00068
00069 #ifndef INC_MI32_SERIALIZ_H
00070 #include <mi32/serializ.h>
00071 #endif
00072
00073 #ifndef INC_MI32_MISTRING_H
00074 #include <mi32/mistring.h>
00075 #endif
00076
00077 #ifndef INC_MI32_SIMPLEAR_H
00078 #include <mi32/simplear.h>
00079 #endif
00080
00081 #ifndef INC_MI32_MGD2_H
00082 #include <mi32/mgd2.h>
00083 #endif
00084
00085 #if defined(X_NATIVE) && !defined(INC_MI32_XDEFNS_H)
00086 #include <mi32/xdefns.h>
00087 #endif
00088
00089
00090
00091
00092 class GRE_VIEWABLE : public GRE_OBJECT {
00093 public:
00094
00095
00096 static void SMLClassInstall (
00097 SMLCONTEXT* context
00098 );
00099
00100
00101 explicit GRE_VIEWABLE (
00102 GRE_OBJTYPE type
00103 );
00104
00105
00106 virtual ~GRE_VIEWABLE (
00107 );
00108
00109 #ifdef X_NATIVE
00110
00111 void ClearMacroScriptList (
00112 ) { m_MacroScripts.Clear(); }
00113 #endif
00114
00115
00116 void ClearSaveLocation (
00117 ) { m_SaveObjItem.Clear(); }
00118
00119 #ifdef X_NATIVE
00120
00121 void ClearToolScriptList (
00122 ) { m_ToolScripts.Clear(); }
00123 #endif
00124
00125
00126 void DestroyAllViews (
00127 );
00128
00129 #ifdef X_NATIVE
00130 void DlgObjMgrClose (
00131 ) { v_DlgObjMgrClose(); }
00132
00133 ERRVALUE DlgObjMgrCreate (
00134 MDLGPARENT dlgparent
00135 ) { return (v_DlgObjMgrCreate(dlgparent,MISTRING::GetEmpty())); }
00136
00137 ERRVALUE DlgObjMgrCreate (
00138 MDLGPARENT dlgparent,
00139 const MISTRING& title
00140 ) { return (v_DlgObjMgrCreate(dlgparent,title)); }
00141
00142 void DlgObjMgrDestroy (
00143 ) { v_DlgObjMgrDestroy(); }
00144
00145 bool DlgObjMgrIsOpen (
00146 ) const { return (v_DlgObjMgrIsOpen()); }
00147
00148 void DlgObjMgrOpen (
00149 ) { v_DlgObjMgrOpen(); }
00150 #endif
00151
00152
00153 virtual ERRVALUE DrawAllViews (
00154 UINT32 drawflags = 0
00155 ) = 0;
00156
00157
00158 const DRECT2D& GetExtents (
00159 ) const { return (v_GetExtents()); }
00160
00161
00162 virtual GRE_LAYER *FindLayerByID (
00163 UINT32 LayerID
00164 ) const = 0;
00165
00166
00167 double GetDesignScale (
00168 ) const { return (v_GetDesignScale()); }
00169
00170
00171 MDLGPARENT GetDialogParent (
00172 ) const { return (m_DialogParent); }
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183 GRE_VIEW* GetFirstView (
00184 ) const;
00185
00186
00187 virtual void GetFullName (
00188 MISTRING& name
00189 ) const = 0;
00190
00191
00192 const char* GetIniName (
00193 ) const { return (m_IniName); }
00194
00195 #ifdef X_NATIVE
00196
00197 GRE::MACROSCRIPTLIST& GetMacroScriptList (
00198 ) { return (m_MacroScripts); }
00199 #endif
00200
00201
00202 virtual UINT32 GetNextLayerID (
00203 ) const = 0;
00204
00205
00206 const FILEPATH& GetSaveFilePath (
00207 ) const { return (m_SaveObjItem.GetFilePath()); }
00208
00209
00210 const RVC::OBJITEM& GetSaveObjItem (
00211 ) const { return (m_SaveObjItem); }
00212
00213
00214 bool GetShowInternalTables (
00215 ) const { return (m_ShowInternalTables); }
00216
00217
00218 bool GetShowScaleRanges (
00219 ) const { return (m_ShowScaleRanges); }
00220
00221
00222 virtual ERRVALUE GetSizeMeters (
00223 DPOINT2D& sizemeters
00224 ) = 0;
00225
00226 #ifdef X_NATIVE
00227
00228 GRE::TOOLSCRIPTLIST& GetToolScriptList (
00229 ) { return (m_ToolScripts); }
00230 #endif
00231
00232
00233
00234 GRE_VIEW* GetView (
00235 int ViewNum
00236 ) const;
00237
00238
00239 virtual bool HasLayers (
00240 ) const = 0;
00241
00242
00243 bool HasSaveLocation (
00244 ) const;
00245
00246
00247 bool IsModified (
00248 ) const { return (m_IsModified); }
00249
00250 #ifdef X_NATIVE
00251
00252
00253 Widget ObjMgrCreate (
00254 Widget pwidget,
00255 Arg *arglist,
00256 int argcount
00257 );
00258 #endif
00259
00260 #ifdef X_NATIVE
00261
00262 Widget ObjMgrGetContainer (
00263 ) const { return (m_ObjMgrRC); }
00264 #endif
00265
00266 #ifdef X_NATIVE
00267
00268 void ObjMgrMakeVisible (
00269 Widget widget
00270 );
00271 #endif
00272
00273 #ifdef X_NATIVE
00274
00275
00276 short ObjMgrSetPosition (
00277 Widget widget,
00278 short newindex
00279 );
00280 #endif
00281
00282
00283 ERRVALUE RenderToRaster (
00284 RVC::OBJITEM& objitem,
00285 COLORSPACE colorspace,
00286 INT32 rastcols,
00287 INT32 rastlins,
00288 double cellsize,
00289 const COLOR& bgcolor,
00290 int viewnum = 1,
00291 bool savegeoref = true,
00292 const SIMPLE_ARRAY<COLOR>* pColors = 0,
00293 const DRECT2D *pRect = 0,
00294 MGD::PIXEL *pFallbackPixel = 0
00295 );
00296
00297
00298 void ResetModified (
00299 ) { m_IsModified = false; }
00300
00301
00302 void SetDesignScale (
00303 double DesignScale,
00304 bool notify = true
00305 ) { v_SetDesignScale(DesignScale,notify); }
00306
00307
00308 void SetDialogParent (
00309 MDLGPARENT DialogParent
00310 ) { m_DialogParent = DialogParent; }
00311
00312
00313 void SetIniBase (
00314 const char* name
00315 );
00316
00317 #ifdef X_NATIVE
00318 void SetMacroScriptList (
00319 const GRE::MACROSCRIPTLIST& ScriptList
00320 ) { m_MacroScripts = ScriptList; m_IsModified = true; }
00321 #endif
00322
00323
00324
00325 void SetSaveFilePath (
00326 const FILEPATH& SaveFilePath
00327 );
00328
00329
00330 void SetSaveObjItem (
00331 const RVC::OBJITEM& SaveObjItem
00332 ) { m_SaveObjItem = SaveObjItem; }
00333
00334
00335 void SetSaveObjItem (
00336 const FILEPATH& SaveFilePath,
00337 const RVCGENINFO& SaveObjInfo
00338 ) { m_SaveObjItem.SetItem(SaveFilePath,SaveObjInfo); }
00339
00340
00341 void SetShowInternalTables (
00342 bool ShowInternalTables
00343 );
00344
00345
00346 void SetShowScaleRanges (
00347 bool ShowScaleRanges
00348 );
00349
00350 #ifdef X_NATIVE
00351 void SetToolScriptList (
00352 const GRE::TOOLSCRIPTLIST& ScriptList
00353 ) { m_ToolScripts = ScriptList; m_IsModified = true; }
00354 #endif
00355
00356 #ifdef X_NATIVE
00357
00358 void UpdateViewScriptUI (
00359 );
00360 #endif
00361
00362 protected:
00363
00364 bool m_IsModified;
00365
00366
00367 UINT8 GetIniIndex (
00368 ) const { return (m_IniIndex); }
00369
00370 #ifdef X_NATIVE
00371
00372 virtual void ObjMgrInitItems (
00373 ) = 0;
00374 #endif
00375
00376
00377 static const SERIALIZER::ITEMDEF* SerialGetItemDef (
00378 SERIALIZER& serializer
00379 ) { return (TemplateGetItemDef()); }
00380
00381
00382 void SetIniIndex (
00383 UINT8 IniIndex
00384 );
00385
00386
00387 static const SERIALIZER::ITEMDEF* TemplateGetItemDef (
00388 );
00389
00390 private:
00391 #ifndef GENERATING_DOXYGEN_OUTPUT
00392
00393 bool m_ShowInternalTables;
00394 bool m_ShowScaleRanges;
00395 char m_IniName[20];
00396 UINT8 m_IniIndex;
00397 UINT8 m_IniBaseLen;
00398 MDLGPARENT m_DialogParent;
00399 RVC::OBJITEM m_SaveObjItem;
00400 #ifdef X_NATIVE
00401 GRE::TOOLSCRIPTLIST m_ToolScripts;
00402 GRE::MACROSCRIPTLIST m_MacroScripts;
00403 Widget m_ObjMgrRC;
00404 #endif
00405
00406 #ifdef X_NATIVE
00407 static void CB_NotifyGreObjMgr (const GRE_CALLBACK_MSG *msg, void *vviewable);
00408 virtual void OnNotifyGreObjMgr (const GRE_CALLBACK_MSG& msg) = 0;
00409 static ERRVALUE SerialCB_MacroScript (SERIALIZER&, const SERIALIZER::ITEMDEF*, GRE_VIEWABLE *viewable, SERIALIZER::ITEMDEF::ACTION);
00410 static ERRVALUE SerialCB_ToolScript (SERIALIZER&, const SERIALIZER::ITEMDEF*, GRE_VIEWABLE *viewable, SERIALIZER::ITEMDEF::ACTION);
00411 #endif
00412
00413 #ifdef X_NATIVE
00414 virtual void v_DlgObjMgrClose () = 0;
00415 virtual ERRVALUE v_DlgObjMgrCreate (MDLGPARENT dlgparent, const MISTRING& title) = 0;
00416 virtual void v_DlgObjMgrDestroy () = 0;
00417 virtual bool v_DlgObjMgrIsOpen () const = 0;
00418 virtual void v_DlgObjMgrOpen () = 0;
00419 #endif
00420 virtual double v_GetDesignScale () const = 0;
00421 virtual const DRECT2D& v_GetExtents () const = 0;
00422 virtual void v_SetDesignScale (double DesignScale, bool notify) = 0;
00423
00424 GRE_VIEWABLE (const GRE_VIEWABLE&);
00425 GRE_VIEWABLE& operator= (const GRE_VIEWABLE&);
00426
00427 #endif
00428 }; // End of GRE_VIEWABLE
00429
00430
00431
00432 #ifndef GENERATING_DOXYGEN_OUTPUT
00433 #ifdef WIN32_MFC
00434
00435 class GRE_MFC_VIEWABLE : public CDocument {
00436 protected:
00437
00438 GRE_MFC_VIEWABLE (
00439 GRE_VIEWABLE *viewable = 0
00440 );
00441
00442 DECLARE_DYNCREATE(GRE_MFC_VIEWABLE)
00443
00444 public:
00445 GRE_VIEWABLE *GetViewable (
00446 ) const {
00447 return (m_viewable);
00448 }
00449
00450 virtual ~GRE_MFC_VIEWABLE();
00451
00452 protected:
00453
00454 GRE_VIEWABLE *m_viewable;
00455
00456 protected:
00457 DECLARE_MESSAGE_MAP()
00458 };
00459
00460 #endif
00461 #endif
00462
00463
00464
00465
00466 #endif