OSGeo FDO Provider for WMS API Reference

OSGeo FDO API

API Reference OSGeo FDO Provider for WMS

FdoWmsOvRasterDefinition.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2007  Autodesk, Inc.
00003  * 
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of version 2.1 of the GNU Lesser
00006  * General Public License as published by the Free Software Foundation.
00007  * 
00008  * This library is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  * Lesser General Public License for more details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public
00014  * License along with this library; if not, write to the Free Software
00015  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016  *
00017  */
00018 #ifndef FDOWMSRASTERDEFINITION_H
00019 #define FDOWMSRASTERDEFINITION_H
00020 
00021 #ifdef _WIN32
00022 #pragma once
00023 #endif //_WIN32
00024 
00025 #include <WMS/FdoWmsOvProvider.h>
00026 #include <WMS/Override/FdoWmsOvLayerCollection.h>
00027 
00028 /// \brief
00029 ///  
00030 /// The FdoWmsOvRasterDefinition class defines the physical overrides for a raster property in a WMS FDO schema.
00031 class FdoWmsOvRasterDefinition : public FdoPhysicalElementMapping
00032 {
00033     typedef FdoPhysicalElementMapping BaseType;
00034     friend class FdoWmsOvClassDefinition;
00035 
00036 public:
00037     /// \brief
00038     /// Constructs a new Raster Definition.
00039     /// 
00040     /// \return
00041     /// Returns the newly created FdoWmsOvRasterDefinition instance.
00042     /// 
00043     FDOWMS_API static FdoWmsOvRasterDefinition* Create();
00044 
00045     /// \brief
00046     /// Gets the format type in which the WMS image will be generated.
00047     /// 
00048     /// \remarks
00049     /// Allowed map formats are "picture" formats . Picture formats constitute 
00050     /// a rectangular pixel array of fixed size. Picture formats include file types such 
00051     /// as Portable Network Graphics (PNG), Joint Photographics Expert Group (JPEG) 
00052     /// and file types such as Tagged Image File Format (TIFF).
00053     /// 
00054     /// \return
00055     /// Returns the WMS image format.
00056     /// 
00057     FDOWMS_API FdoString* GetImageFormat(void);
00058 
00059     /// \brief
00060     /// Sets the format type in which the WMS image will be generated.
00061     /// 
00062     /// \remarks
00063     /// Allowed map formats are "picture" formats . Picture formats constitute 
00064     /// a rectangular pixel array of fixed size. Picture formats include file types such 
00065     /// as Portable Network Graphics (PNG), Joint Photographics Expert Group (JPEG) 
00066     /// and file types such as Tagged Image File Format (TIFF).
00067     /// 
00068     /// \return
00069     /// Returns nothing.
00070     /// 
00071     FDOWMS_API void SetImageFormat(FdoString* value);
00072 
00073 
00074     /// \brief
00075     /// Gets the transparency state.
00076     /// 
00077     /// \remarks
00078     /// The transparency state specifies whether the WMS map background is to  
00079     /// be made transparent or not. The default value is false. The ability to return 
00080     /// an image drawn with transparent pixels allows results of different Map requests 
00081     /// to be overlaid, producing a composite map. 
00082     /// 
00083     /// \return
00084     /// Returns an FdoBoolean indicating the state of the transparency flag.
00085     /// 
00086     FDOWMS_API FdoBoolean GetTransparent(void) const;
00087     
00088     /// \brief
00089     /// Sets the transparency state.
00090     /// 
00091     /// \remarks
00092     /// The transparency state specifies whether the WMS map background is to  
00093     /// be made transparent or not. The default value is false. The ability to return 
00094     /// an image drawn with transparent pixels allows results of different Map requests 
00095     /// to be overlaid, producing a composite map. 
00096     /// 
00097     /// \return
00098     /// Returns nothing.
00099     /// 
00100     FDOWMS_API void SetTransparent(FdoBoolean transparent);  
00101 
00102     /// \brief
00103     /// Gets the background color.
00104     /// 
00105     /// \remarks
00106     /// The background color is a string that specifies the color to be used 
00107     /// as the background pixels of the map. The general format of the background color 
00108     /// is a hexadecimal encoding of an RGB value where two hexadecimal characters 
00109     /// are used for each of Red, Green, and Blue colour values. The values can range 
00110     /// between 00 and FF for each (0 and 255, base 10). The format is 0xRRGGBB; either 
00111     /// upper or lower case characters are allowed for RR, GG, and BB values. 
00112     /// The "0x" prefix shall have a lower case ‘x? The default value is 0xFFFFFF 
00113     /// (corresponding to the colour white).
00114     /// 
00115     /// \return
00116     /// Returns a FdoString indicating the background color 
00117     /// to be used when rendering the WMS image.
00118     /// 
00119     FDOWMS_API FdoString* GetBackgroundColor(void) const;
00120 
00121     /// \brief
00122     /// Sets the background color.
00123     /// 
00124     /// \remarks
00125     /// The background color is a string that specifies the color to be used 
00126     /// as the background pixels of the map. The general format of the background color 
00127     /// is a hexadecimal encoding of an RGB value where two hexadecimal characters 
00128     /// are used for each of Red, Green, and Blue colour values. The values can range 
00129     /// between 00 and FF for each (0 and 255, base 10). The format is 0xRRGGBB; either 
00130     /// upper or lower case characters are allowed for RR, GG, and BB values. 
00131     /// The "0x" prefix shall have a lower case ‘x? The default value is 0xFFFFFF 
00132     /// (corresponding to the colour white).
00133     /// 
00134     /// \return
00135     /// Returns nothing.
00136     /// 
00137     FDOWMS_API void SetBackgroundColor(FdoString* bgColor);
00138 
00139     /// \brief
00140     /// Gets the tile caching option value.
00141     /// 
00142     /// \remarks
00143     /// This option specifies whether using the tile caching method to query the raster data. 
00144     /// The default value is true.
00145     ///
00146     /// \return
00147     /// Returns a FdoBoolean indicating whether using tile cache or not.
00148     /// 
00149     FDOWMS_API FdoBoolean GetUseTileCache(void) const;
00150 
00151     /// \brief
00152     /// Sets the tile caching option value.
00153     /// 
00154     /// \remarks
00155     /// This option specifies whether using the tile caching method to query the raster data. 
00156     /// The default value is true.
00157     /// 
00158     /// \return
00159     /// Returns nothing.
00160     /// 
00161     FDOWMS_API void SetUseTileCache(FdoBoolean value);
00162 
00163     /// \brief
00164     /// Gets the time dimension of the requested WMS map.
00165     /// 
00166     /// \remarks
00167     /// If a WMS map has a Time dimension defined, then requests may 
00168     /// include the parameter TIME=value. For the TIME parameter, the special keyword 
00169     /// 'current' may be used if the WMS Dimension:Name="time" service metadata 
00170     /// element includes a nonzero value for the 'current' attribute. The expression 
00171     /// "TIME=current" means send the most current data available. The expression 
00172     /// "TIME=start_time/current" means send data from start_time up to the most 
00173     /// current data available.
00174     /// 
00175     /// \return
00176     /// Returns a FdoString indicating the time dimension of the 
00177     /// requested WMS image.
00178     /// 
00179     FDOWMS_API FdoString* GetTimeDimension(void) const;
00180 
00181     /// \brief
00182     /// Sets the time dimension of the requested WMS map.
00183     /// 
00184     /// \remarks
00185     /// If a WMS map has a Time dimension defined, then requests may 
00186     /// include the parameter TIME=value. For the TIME parameter, the special keyword 
00187     /// 'current' may be used if the WMS Dimension:Name="time" service metadata 
00188     /// element includes a nonzero value for the 'current' attribute. The expression 
00189     /// "TIME=current" means send the most current data available. The expression 
00190     /// "TIME=start_time/current" means send data from start_time up to the most 
00191     /// current data available.
00192     /// 
00193     /// \return
00194     /// Returns nothing .
00195     /// 
00196     FDOWMS_API void SetTimeDimension(FdoString* time);
00197 
00198     /// \brief
00199     /// Gets the elevation dimension of the requested WMS map.
00200     /// 
00201     /// \remarks
00202     /// If a WMS Map has a Elevation dimension defined, then in 
00203     /// order to retrieve the map in the required dimension, 
00204     /// the dimension property may set to 'ELEVATION=value'.
00205     /// 
00206     /// \return
00207     /// Returns a FdoString indicating the elevation dimension 
00208     /// of the requested WMS image.
00209     /// 
00210     FDOWMS_API FdoString* GetElevationDimension(void) const;
00211 
00212     /// \brief
00213     /// Sets the time dimension of the requested WMS map.
00214     /// 
00215     /// \remarks
00216     /// If a WMS Map has a Elevation dimension defined, then in 
00217     /// order to retrieve the map in the required dimension, 
00218     /// the dimension property may set to 'ELEVATION=value'.
00219     /// 
00220     /// \return
00221     /// Returns nothing.
00222     /// \return
00223     /// /// Returns a FdoString indicating the elevation dimension 
00224     /// of the requested WMS image.
00225     /// 
00226     /// 
00227     FDOWMS_API void SetElevationDimension(FdoString* dimension);
00228 
00229     /// \brief
00230     /// Gets the spatial context in which the requested 
00231     /// WMS map will be returned.
00232     /// 
00233     /// \remarks
00234     /// The same spatial context name applies to all layers 
00235     /// in a single WMS class definition.
00236     /// 
00237     /// \return
00238     /// Returns the WMS Provider's spatial context name.
00239     /// 
00240     FDOWMS_API FdoString* GetSpatialContextName(void) const;
00241 
00242     /// \brief
00243     /// Sets the spatial context in which the requested 
00244     /// WMS map will be returned.
00245     /// 
00246     /// \remarks
00247     /// The same spatial context name applies to all layers 
00248     /// in a single WMS class definition.
00249     /// 
00250     /// \return
00251     /// Returns nothing.
00252     /// 
00253     FDOWMS_API void SetSpatialContextName(FdoString* value);
00254 
00255     /// \brief
00256     /// Gets the WMS layers that will be used to construct 
00257     /// the composite WMS image.
00258     /// 
00259     /// \remarks
00260     /// A WMS shall render the requested layers by drawing 
00261     /// the first map in the list bottommost, the next one over that, 
00262     /// and so on.
00263     /// 
00264     /// \return
00265     /// Returns the collection of WMS layers associated to the logical 
00266     /// FDO class definition.
00267     /// 
00268     FDOWMS_API FdoWmsOvLayerCollection* GetLayers(void) const;
00269 
00270     /// \brief
00271     /// Gets the fully qualified name of this element
00272     /// 
00273     /// \return
00274     /// Returns the qualified element name
00275     /// 
00276     FDOWMS_API virtual FdoStringP GetQualifiedName();
00277 
00278 /// \cond DOXYGEN-IGNORE
00279 
00280     /// XML Serialization functions, not part of supported API.
00281     FDOWMS_API virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs);
00282     FDOWMS_API virtual FdoXmlSaxHandler* XmlStartElement(
00283         FdoXmlSaxContext* context, 
00284         FdoString* uri, 
00285         FdoString* name, 
00286         FdoString* qname, 
00287         FdoXmlAttributeCollection* atts
00288     );
00289     FDOWMS_API virtual FdoBoolean XmlEndElement(FdoXmlSaxContext* context, FdoString* uri, FdoString* name, FdoString* qname);
00290     FDOWMS_API void _writeXml( FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags );
00291 
00292 protected:
00293     FDOWMS_API FdoWmsOvRasterDefinition(void);
00294     FDOWMS_API virtual ~FdoWmsOvRasterDefinition(void);
00295 
00296 protected:
00297     void _SetFullFormatType(FdoString* value);
00298 
00299     void _SetFormatAbbr(FdoString* value);
00300     FdoStringP _GetFormatAbbr() const;
00301 
00302     void _SetTransparent(FdoString* value);
00303     FdoStringP _GetTransparent(void) const;
00304     void _SetUseTileCache(FdoString* value);
00305     FdoStringP _GetUseTileCache(void) const;
00306     void Dispose(void);
00307 
00308     FdoStringP MIMEFormatTypeToAbbr(FdoString* fullFormat);
00309     FdoStringP AbbrToMIMEFormatType(FdoString* abbrFormat);
00310 private:
00311     FdoStringP m_backgroundColor;
00312     FdoStringP m_timeDimension;
00313     FdoStringP m_elevationDimension;
00314     FdoStringP m_spatialContext;
00315     FdoBoolean m_transparent;
00316     FdoBoolean m_useTileCache;
00317     FdoStringP m_formatType;
00318     FdoStringP m_formatDesc;
00319     FdoWmsOvLayersP m_layers;
00320     FdoXmlCharDataHandler *m_pXmlContentHandler;
00321     bool m_hasFormat;
00322     bool m_hasFormatType;
00323 
00324 /// \endcond
00325 
00326 };
00327 
00328 /// \brief
00329 ///  FdoWmsOvRasterDefinitionP is a FdoPtr on FdoWmsOvRasterDefinition, provided for convenience. 
00330 typedef FdoPtr<FdoWmsOvRasterDefinition> FdoWmsOvRasterDefinitionP;
00331 
00332 #endif  // FDOWMSRASTERDEFINITION_H
00333 
00334 

Comments?