00001
00070 #ifndef INC_GRE_LRTILESET_H
00071 #define INC_GRE_LRTILESET_H
00072
00073 #ifndef INC_GRE_LRIMAGE_H
00074 #include <gre/lrimage.h>
00075 #endif
00076
00077 #ifndef INC_SPATMOD_IMAGESOURCETILESET_H
00078 #include <spatmod/imagesourcetileset.h>
00079 #endif
00080
00081 #ifndef INC_SPATMOD_IMAGERESAMPLEMETHOD_H
00082 #include <spatmod/imageresamplemethod.h>
00083 #endif
00084
00085 #ifndef INC_MI32_RASTERFILTERPARMS_H
00086 #include <mi32/rasterfilterparms.h>
00087 #endif
00088
00089 namespace GRE {
00090
00091
00093 class LAYER_TILESET : public GRE::LAYER_IMAGE {
00094 public:
00095
00096
00097 class DISPPARM : public LAYER::DISPPARM {
00098 public:
00099 DISPPARM ();
00100
00101 DISPPARM (
00102 const DISPPARM& rhs
00103 );
00104
00105 virtual ~DISPPARM ();
00106
00107 DISPPARM& operator= (
00108 const DISPPARM& rhs
00109 ) { if (this != &rhs) { Copy(rhs); } return (*this); }
00110
00111 bool GetBlackTransparent (
00112 ) const { return (m_bBlackTransparent); }
00113
00114 bool GetWhiteTransparent (
00115 ) const { return (m_bWhiteTransparent); }
00116
00117 bool GetDefinedTransparent (
00118 ) const { return (m_bDefinedTransparent); }
00119
00120 bool GetDoShading (
00121 ) const { return (m_bDoShading); }
00122
00123 const RVC::OBJITEM& GetObjItem (
00124 ) const { return (m_objitem); }
00125
00126 RASTER_FILTER_PARMS GetRasterFilterParms (
00127 ) const { return (m_RasterFilterParms); }
00128
00129 SPATMOD::IMAGE::RESAMPLEMETHOD GetResampleMethod (
00130 ) const { return (m_ResampleMethod); }
00131
00132 double GetSaturation (
00133 ) const { return (m_Saturation); }
00134
00135 bool GetShowDatatipTileInfo (
00136 ) const { return (m_bShowDatatipTileInfo); }
00137
00138 bool GetShowDatatipImageValue (
00139 ) const { return (m_bShowDatatipImageValue); }
00140
00141 bool GetShowLabels (
00142 ) const { return (m_bShowLabels); }
00143
00144 double GetTransparency (
00145 ) const { return (m_Transparency); }
00146
00148 bool IsValidated (
00149 ) const { return (m_IsValidated); }
00150
00151 void SetBlackTransparent (
00152 bool BlackTransparent
00153 ) { m_bBlackTransparent = BlackTransparent; }
00154
00155 void SetWhiteTransparent (
00156 bool WhiteTransparent
00157 ) { m_bWhiteTransparent = WhiteTransparent; }
00158
00159 void SetDefinedTransparent (
00160 bool DefinedTransparent
00161 ) { m_bDefinedTransparent = DefinedTransparent; }
00162
00163 void SetDoShading (
00164 bool DoShading
00165 ) { m_bDoShading = DoShading; }
00166
00167 void SetObjItem (
00168 const RVC::OBJITEM& objitem
00169 ) { m_objitem = objitem; }
00170
00171 void SetRasterFilterParms (
00172 const RASTER_FILTER_PARMS& RasterFilterParms
00173 ) { m_RasterFilterParms = RasterFilterParms; }
00174
00175 void SetResampleMethod (
00176 SPATMOD::IMAGE::RESAMPLEMETHOD ResampleMethod
00177 ) { m_ResampleMethod = ResampleMethod; }
00178
00179 void SetSaturation (
00180 double Saturation
00181 ) { m_Saturation = Saturation; }
00182
00183 void SetShowDatatipTileInfo (
00184 bool ShowDatatipTileInfo
00185 ) { m_bShowDatatipTileInfo = ShowDatatipTileInfo; }
00186
00187 void SetShowDatatipImageValue (
00188 bool ShowDatatipImageValue
00189 ) { m_bShowDatatipImageValue = ShowDatatipImageValue; }
00190
00191 void SetShowLabels (
00192 bool ShowLabels
00193 ) { m_bShowLabels = ShowLabels; }
00194
00195 void SetTransparency (
00196 double Transparency
00197 ) { m_Transparency = Transparency; }
00198
00199 private:
00200 #ifndef GENERATING_DOXYGEN_OUTPUT
00201 RVC::OBJITEM m_objitem;
00202 SPATMOD::IMAGE::RESAMPLEMETHOD m_ResampleMethod;
00203 RASTER_FILTER_PARMS m_RasterFilterParms;
00204 double m_Saturation;
00205 double m_Transparency;
00206 bool m_bDoShading;
00207 bool m_bShowDatatipTileInfo;
00208 bool m_bShowDatatipImageValue;
00209 bool m_bShowLabels;
00210 bool m_bBlackTransparent;
00211 bool m_bWhiteTransparent;
00212 bool m_bDefinedTransparent;
00213 bool m_IsValidated;
00214
00215 void Copy (const DISPPARM&);
00216
00217
00218 virtual const SERIALIZERITEM* SerialGetItemDef (SERIALIZER& serializer) const;
00219 virtual ERRVALUE SerialRead (SERIALIZER& serializer);
00220 virtual ERRVALUE SerialWrite (SERIALIZER& serializer, const char *tagname = 0) const;
00221
00222
00223 virtual ERRVALUE v_Validate ();
00224
00225 #endif // GENERATING_DOXYGEN_OUTPUT
00226 };
00227
00229 static void RegisterType (
00230 );
00231
00233 static void SMLClassInstall (
00234 SMLCONTEXT *context
00235 );
00236
00238 explicit LAYER_TILESET (
00239 GRE::GROUP *group,
00240 CREATEFLAGS createflags = CREATEFLAG_None,
00241 GRE::LISTPOS listpos = GRE::LISTPOS_Last,
00242 LAYER *reflayer = 0
00243 );
00244
00245 virtual ~LAYER_TILESET ();
00246
00249 const DISPPARM& GetDispParm (
00250 ) const {
00251 return (m_dispparm);
00252 }
00253
00255 void SetDispParm (
00256 const DISPPARM& dispparm
00257 ) { m_dispparm = dispparm; }
00258
00259 protected:
00260
00261 DISPPARM m_dispparm;
00262
00263 private:
00264 #ifndef GENERATING_DOXYGEN_OUTPUT
00265
00266 typedef LAYER_IMAGE BASECLASS;
00267
00268 class DLG;
00269 #ifdef USE_MGUI
00270 DLG *m_pDlgControlPanel;
00271 #endif
00272
00273 SPATMOD::IMAGE::SOURCE_TILESET *m_pSource;
00274 SIMPLE_ARRAY<INT32> m_ZoomLevelArray;
00275 bool m_HasError;
00276
00277 bool FilterDelegate (
00278 const SPATMOD::IMAGE::SAMPLEITERATOR *ittgt,
00279 const SPATMOD::IMAGE::SAMPLEITERATOR *itsrc,
00280 bool valid
00281 );
00282
00283 ERRVALUE InsertSpatialFilter (
00284 SPATMOD::IMAGE::STAGE_AUTOPTR& StagePtr
00285 );
00286
00287 ERRVALUE Draw2D (LAYERDC& layerdc);
00288 bool CanDoShading();
00289
00290 #ifdef USE_MGUI
00291 void OnMenuTool (MGUI::ID, bool);
00292 #endif
00293
00294
00295 virtual ERRVALUE v_AssignObject (const RVC::OBJITEM& objitem, MDLGPARENT dlgparent);
00296 #ifdef USE_MGUI
00297 virtual int v_ControlPanel (MDLGPARENT dlgparent, UINT32 flags = 0);
00298 virtual ERRVALUE v_PromptObject (bool OpenCtrlPanel, MDLGPARENT dlgparent);
00299 virtual void v_MenuAddLayerItems (MGUI::MENU& menu);
00300 #endif
00301 bool v_DataTipHasEnabled () const;
00302 virtual void v_DataTipGetObjectNamesString (const DPOINT2D& point, MISTRING& string, int indent, GRE::VIEW *view) const;
00303 int v_DataTipGetString (const DPOINT2D& point, MISTRING& string, SPATMOD::IMAGE::STAGE_ARRAY& images, GRE::VIEW *view);
00304 virtual bool v_CanRender () const;
00305 virtual LAYER* v_Copy (GRE::GROUP *group) const;
00306 virtual ERRVALUE v_Draw (LAYERDC& layerdc);
00307 virtual double v_GetScaleMaxDetail (const DPOINT2D& point, const SPATREF::COORDREFSYS& crs, double DisplayPixelSizeMM) const;
00308 virtual bool v_HasNullImageCells () const;
00309 virtual const char* v_SerialGetTagName () const;
00310 virtual void v_SetDftName (bool ReplaceExisting);
00311 virtual ERRVALUE v_UpdateExtents (bool forceupdate);
00312
00313 LAYER_TILESET (const LAYER_TILESET&);
00314 LAYER_TILESET& operator= (const LAYER_TILESET&);
00315
00316 #endif // GENERATING_DOXYGEN_OUTPUT
00317 };
00318
00319
00320
00321 }
00322
00323 #endif // INC_GRE_LRTILESET_H