00001
00045 #ifndef INC_GRE_LRWMS_H
00046 #define INC_GRE_LRWMS_H
00047
00048 #ifndef INC_GRE_LRIMAGE_H
00049 #include <gre/lrimage.h>
00050 #endif
00051
00052 #ifndef INC_MI32_MISTRINGLIST_H
00053 #include <mi32/mistringlist.h>
00054 #endif
00055
00056 #ifndef GENERATING_DOXYGEN_OUTPUT
00057 namespace SOA {
00058 namespace WMS {
00059 class CONNECTION;
00060 }
00061 }
00062 namespace SPATMOD {
00063 namespace IMAGE {
00064 class PIXEL;
00065 class PIXELTABLE;
00066 }
00067 }
00068
00069 #endif
00070
00071 namespace GRE {
00072
00073
00075 class LAYER_WMS : public GRE::LAYER_IMAGE {
00076 public:
00077
00078
00079 class DISPPARM : public LAYER::DISPPARM {
00080 public:
00081
00082 DISPPARM ();
00083
00084 DISPPARM (
00085 const DISPPARM& rhs
00086 );
00087
00088 virtual ~DISPPARM ();
00089
00090 DISPPARM& operator= (
00091 const DISPPARM& rhs
00092 ) { if (this != &rhs) { Copy(rhs); } return (*this); }
00093
00095 ERRVALUE BuildGetMapRequest (
00096 const LAYERDC& layerdc,
00097 MISTRING& RequestURL,
00098 LPOINT2D& TgtSize,
00099 TRANS2D_MAPGEN& TransToCRS
00100 ) const;
00101
00103 ERRVALUE BuildPixelTableTransparent (
00104 const COLOR& ColorBG,
00105 SPATMOD::IMAGE::PIXELTABLE& PixelTable
00106 ) const;
00107
00110 static int ComputeFormatGetMapPreference (
00111 const MISTRING& Format
00112 );
00113
00115 ERRVALUE ComputeRegion (
00116 REGION2D& RegionUsed
00117 ) const;
00118
00120 const SOA::WMS::CONNECTION& GetConnection (
00121 ) const { return (*m_pConnection); }
00122
00124 const SPATREF::COORDREFSYS& GetCoordRefSys (
00125 ) const { return (m_CoordRefSys); }
00126
00128 bool GetDetectBackground (
00129 ) const { return (m_DetectBackground); }
00130
00132 bool GetDetectBlack (
00133 ) const { return (m_DetectBlack); }
00134
00136 bool GetDetectWhite (
00137 ) const { return (m_DetectWhite); }
00138
00140 const MISTRING& GetFormatGetMap (
00141 ) const { return (m_FormatGetMap); }
00142
00144 const MISTRINGLIST& GetLayerNameList (
00145 ) const { return (m_LayerNameList); }
00146
00148 const MISTRINGLIST& GetLayerStyleList (
00149 ) const { return (m_LayerStyleList); }
00150
00152 const MISTRING& GetServerURL (
00153 ) const;
00154
00156 UINT8 GetTransparency (
00157 ) const { return (m_Transparency); }
00158
00160 bool IsValidated (
00161 ) const { return (m_IsValidated); }
00162
00164 void SetConnection (
00165 const SOA::WMS::CONNECTION& connection
00166 );
00167
00169 void SetCoordRefSys (
00170 const SPATREF::COORDREFSYS& CoordRefSys
00171 );
00172
00174 void SetDetectBackground (
00175 bool DetectBackground
00176 ) { m_DetectBackground = DetectBackground; }
00177
00179 void SetDetectBlack (
00180 bool DetectBlack
00181 ) { m_DetectBlack = DetectBlack; }
00182
00184 void SetDetectWhite (
00185 bool DetectWhite
00186 ) { m_DetectWhite = DetectWhite; }
00187
00189 void SetDftFormatGetMap (
00190 );
00191
00193 void SetDftLayer (
00194 );
00195
00197 void SetFormatGetMap (
00198 const MISTRING& Format
00199 );
00200
00202 ERRVALUE SetLayerList (
00203 const MISTRINGLIST& LayerNameList,
00204 const MISTRINGLIST& LayerStyleList
00205 );
00206
00208 void SetTransparency (
00209 UINT8 Transparency
00210 ) { m_Transparency = Transparency; }
00211
00212 MISTRING m_Password;
00213 MISTRING m_Username;
00214
00215 private:
00216 #ifndef GENERATING_DOXYGEN_OUTPUT
00217
00218 SOA::WMS::CONNECTION *m_pConnection;
00219 MISTRINGLIST m_LayerNameList;
00220 MISTRINGLIST m_LayerStyleList;
00221 SPATREF::COORDREFSYS m_CoordRefSys;
00222 MISTRING m_FormatGetMap;
00223 UINT8 m_Transparency;
00224 bool m_DetectBackground;
00225 bool m_DetectBlack;
00226 bool m_DetectWhite;
00227 bool m_IsValidated;
00228
00229 void Copy (const DISPPARM&);
00230 static ERRVALUE SerializerCB_Connection (SERIALIZER& serializer, const SERIALIZERITEM *item, void *vDispParm, SERIALIZERITEM::ACTION action);
00231
00232
00233 virtual const SERIALIZERITEM* SerialGetItemDef (SERIALIZER& serializer) const;
00234 virtual ERRVALUE SerialRead (SERIALIZER& serializer);
00235 virtual ERRVALUE SerialWrite (SERIALIZER& serializer, const char *tagname = 0) const;
00236
00237
00238 virtual ERRVALUE v_Validate ();
00239
00240 #endif // GENERATING_DOXYGEN_OUTPUT
00241 };
00242
00244 static void RegisterType (
00245 );
00246
00248 static void SMLClassInstall (
00249 SMLCONTEXT *context
00250 );
00251
00253 explicit LAYER_WMS (
00254 GRE::GROUP *group,
00255 CREATEFLAGS createflags = CREATEFLAG_None,
00256 GRE::LISTPOS listpos = GRE::LISTPOS_Last,
00257 LAYER *reflayer = 0
00258 );
00259
00260 virtual ~LAYER_WMS ();
00261
00264 const DISPPARM& GetDispParm (
00265 ) const {
00266 return (m_dispparm);
00267 }
00268
00274 ERRVALUE SetDispParm (
00275 const DISPPARM& dispparm
00276 );
00277
00278 protected:
00279
00280 DISPPARM m_dispparm;
00281
00282 private:
00283 #ifndef GENERATING_DOXYGEN_OUTPUT
00284
00285 typedef LAYER_IMAGE BASECLASS;
00286 class DLG;
00287
00288 #ifdef USE_MGUI
00289 DLG *m_pDlgControlPanel;
00290 #endif
00291
00292 static void LegendMsgHandler (GRAPHICTREEITEM_MSG *msg);
00293
00294 #ifdef USE_MGUI
00295 void DestroyDlgControlPanel ();
00296 #endif
00297 ERRVALUE Draw2D (LAYERDC& layerdc);
00298 void SetupLegend ();
00299
00300
00301 virtual ERRVALUE v_AssignObject (const RVC::OBJITEM& item, MDLGPARENT dlgparent);
00302 #ifdef USE_MGUI
00303 virtual int v_ControlPanel (MDLGPARENT dlgparent, UINT32 flags = 0);
00304
00305 #endif
00306 virtual LAYER* v_Copy (GRE::GROUP *group) const;
00307 virtual ERRVALUE v_Draw (LAYERDC& layerdc);
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_WMS (const LAYER_WMS&);
00314 LAYER_WMS& operator= (const LAYER_WMS&);
00315
00316 #endif // GENERATING_DOXYGEN_OUTPUT
00317 };
00318
00319
00320
00321 }
00322
00323 #endif // INC_GRE_LRWMS_H