FDO API Reference Feature Data Objects

RasterPropertyDefinition.h

Go to the documentation of this file.
00001 #ifndef _RASTERPROPERTYDEFINITION_H_
00002 #define _RASTERPROPERTYDEFINITION_H_
00003 
00004 //
00005 // Copyright (C) 2004-2006  Autodesk, Inc.
00006 // 
00007 // This library is free software; you can redistribute it and/or
00008 // modify it under the terms of version 2.1 of the GNU Lesser
00009 // General Public License as published by the Free Software Foundation.
00010 // 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 //
00020 
00021 #ifdef _WIN32
00022 #pragma once
00023 #endif
00024 
00025 #include <FdoStd.h>
00026 #include <Fdo/Schema/DataPropertyDefinition.h>
00027 #include <Fdo/Schema/DataType.h>
00028 #include <Fdo/Raster/RasterDataModel.h>
00029 
00030 /// \brief
00031 /// The FdoRasterPropertyDefinition has the information needed to
00032 /// create or completely describe a raster property. This class encapsulates
00033 /// the information necessary to insert a 'new' raster, in the absence of
00034 /// any other information, for the properties defined using this schema
00035 /// element.
00036 class FdoRasterPropertyDefinition : public FdoPropertyDefinition
00037 {
00038     typedef FdoPropertyDefinition superclass;
00039 
00040     friend class FdoFeatureClass;
00041 
00042 protected:
00043 /// \cond DOXYGEN-IGNORE
00044     /// Constructs a default instance of an FdoRasterPropertyDefinition.
00045     FdoRasterPropertyDefinition ();
00046 
00047     /// Constructs an instance of an FdoRasterPropertyDefinition using the
00048     /// specified arguments.
00049     FdoRasterPropertyDefinition (FdoString* name, FdoString* description, bool system = false);
00050 
00051     /// Destructor.
00052     virtual ~FdoRasterPropertyDefinition ();
00053 
00054     //
00055     /// FdoIDisposable interface
00056     //
00057 
00058     /// \brief
00059     /// Dispose this object.
00060     /// 
00061     /// \return
00062     /// Returns nothing
00063     /// 
00064     virtual void Dispose ();
00065 /// \endcond
00066 
00067 public:
00068     /// \brief
00069     /// Constructs a default instance of an FdoRasterPropertyDefinition.
00070     /// 
00071     /// \return
00072     /// Returns FdoRasterPropertyDefinition
00073     /// 
00074     FDO_API static FdoRasterPropertyDefinition* Create ();
00075 
00076     /// \brief
00077     /// Constructs an instance of an FdoRasterPropertyDefinition using the
00078     /// specified arguments.
00079     /// 
00080     /// \param name 
00081     /// Input name
00082     /// \param description 
00083     /// Input description
00084     /// \param system 
00085     /// Input true if this is a system generated property, false otherwise.
00086     /// <\note
00087     /// A client would never set system to true, only a provider.
00088     /// 
00089     /// \return
00090     /// Returns FdoRasterPropertyDefinition
00091     /// 
00092     FDO_API static FdoRasterPropertyDefinition* Create (FdoString* name, FdoString* description, bool system = false);
00093 
00094     //
00095     /// FdoPropertyDefinition interface
00096     //
00097 
00098     /// \brief
00099     /// Gets the concrete property type.
00100     /// 
00101     /// \return
00102     /// Returns the concrete property type
00103     /// 
00104     FDO_API virtual FdoPropertyType GetPropertyType ();
00105 
00106     //
00107     /// Attributes.
00108     //
00109 
00110     /// \brief
00111     /// Returns a Boolean value that indicates if this property is read-only.
00112     /// 
00113     /// \return
00114     /// Returns a Boolean value
00115     /// 
00116     FDO_API virtual bool GetReadOnly ();
00117 
00118     /// \brief
00119     /// Sets a Boolean value that indicates if this property is read-only.
00120     /// 
00121     /// \param value 
00122     /// Input a Boolean value that indicates if this property is read-only
00123     /// 
00124     /// \return
00125     /// Returns nothing
00126     /// 
00127     FDO_API virtual void SetReadOnly (bool value);
00128 
00129     /// \brief
00130     /// Returns a Boolean value that indicates if this property's value can be
00131     /// null.
00132     /// 
00133     /// \return
00134     /// Returns a Boolean value
00135     /// 
00136     FDO_API virtual bool GetNullable();
00137 
00138     /// \brief
00139     /// Sets a Boolean value that indicates if this property's value can be
00140     /// null.
00141     /// 
00142     /// \param value 
00143     /// Input a Boolean value that indicates if this property's value can be
00144     /// null
00145     /// 
00146     /// \return
00147     /// Returns nothing
00148     /// 
00149     FDO_API virtual void SetNullable(bool value);
00150 
00151     /// \brief
00152     /// Gets the default data model used by this raster property.
00153     /// 
00154     /// \return
00155     /// Returns the current default data model.
00156     /// 
00157     FDO_API virtual FdoRasterDataModel* GetDefaultDataModel ();
00158 
00159     /// \brief
00160     /// Sets the default data model used by this raster property.
00161     /// Allowed values are only those data models that are acceptable to the
00162     /// SupportsDataModel capability.
00163     /// 
00164     /// \param datamodel 
00165     /// The datamodel to be used for newly created
00166     /// rasters, or the default datamodel to be used when returning raster data.
00167     /// 
00168     FDO_API virtual void SetDefaultDataModel (FdoRasterDataModel* datamodel);
00169 
00170     /// \brief
00171     /// Gets the default size of image file in the horizontal
00172     /// direction in pixels (number of columns).
00173     /// 
00174     /// \return
00175     /// Returns the current default horizontal image size in pixels
00176     /// (number of columns).
00177     /// 
00178     FDO_API virtual FdoInt32 GetDefaultImageXSize ();
00179 
00180     /// \brief
00181     /// Sets the default size of an image file in the horizontal
00182     /// direction in pixels (number of columns).
00183     /// 
00184     /// \param size 
00185     /// The desired default horizontal image size in pixels
00186     /// (number of columns).
00187     /// 
00188     FDO_API virtual void SetDefaultImageXSize (FdoInt32 size);
00189 
00190     /// \brief
00191     /// Gets the default size of an image file in the vertical
00192     /// direction in pixels (number of rows).
00193     /// 
00194     /// \return
00195     /// Returns the current default vertical image size in pixels
00196     /// (number of rows).
00197     /// 
00198     FDO_API virtual FdoInt32 GetDefaultImageYSize ();
00199 
00200     /// \brief
00201     /// Sets the default size of an image file in the vertical
00202     /// direction in pixels (number of rows).
00203     /// 
00204     /// \param size 
00205     /// The desired default vertical image size in pixels
00206     /// (number of rows).
00207     /// 
00208     FDO_API virtual void SetDefaultImageYSize (FdoInt32 size);
00209 
00210     //
00211     /// Spatial Context Support.
00212     //
00213 
00214     /// \brief
00215     /// Sets a Spatial Context association for this raster property.
00216     /// 
00217     /// \param value 
00218     /// Input the Spatial Context name to be set. 
00219     /// Defaults to the active Spatial Context.
00220     /// 
00221     /// \return
00222     /// Returns nothing
00223     /// 
00224     FDO_API void SetSpatialContextAssociation(FdoString *spatialContextName);
00225 
00226     /// \brief
00227     /// Gets the Spatial Context name associated to this raster property.
00228     /// 
00229     /// \return
00230     /// Returns a String value representing the Spatial Context name.
00231     /// 
00232     FDO_API FdoString * GetSpatialContextAssociation();
00233 
00234 
00235 /// \cond DOXYGEN-IGNORE
00236     /// Public non-API functions for XML support
00237 
00238     /// Update this property from the given property.
00239     virtual void Set( FdoPropertyDefinition* pProperty, FdoSchemaXmlContext* pContext );
00240 
00241     /// Initialize this property from its XML attributes
00242     virtual void InitFromXml(const FdoString* propertyTypeName, FdoSchemaXmlContext* pContext, FdoXmlAttributeCollection* attrs);
00243 
00244     /// Serialize this property to XML.
00245     virtual void _writeXml( FdoSchemaXmlContext* pContext );
00246 
00247 
00248 private:
00249     bool            m_readOnly;
00250     bool            m_nullable;
00251     FdoRasterDataModel* m_model;
00252     FdoInt32        m_sizeX;
00253     FdoInt32        m_sizeY;
00254     FdoStringP      m_spatialContextAssociation;
00255 
00256 private:
00257     FdoStringP DataModelTypeToString(FdoRasterDataModelType type);
00258     FdoStringP DataOrganizationToString(FdoRasterDataOrganization organization);
00259     FdoStringP DataTypeToString(FdoRasterDataType organization);
00260 
00261     FdoRasterDataModelType StringToDataModelType(FdoString *string);
00262     FdoRasterDataOrganization StringToDataOrganization(FdoString *string);
00263     FdoRasterDataType StringToDataType(FdoString *string);
00264 
00265 protected:
00266 
00267     //
00268     /// FdoSchemaElement interface.
00269     //
00270     virtual void    _StartChanges();
00271     virtual void    _RejectChanges();
00272     virtual void    _AcceptChanges();
00273 
00274     bool            m_readOnlyCHANGED;
00275     bool            m_nullableCHANGED;
00276     FdoRasterDataModel* m_modelCHANGED;
00277     FdoInt32        m_sizeXCHANGED;
00278     FdoInt32        m_sizeYCHANGED;
00279     FdoStringP      m_scAssociationCHANGED;
00280 /// \endcond
00281 };
00282 
00283 /// \brief
00284 /// FdoRasterPropertyP is a FdoPtr on FdoRasterPropertyDefinition, provided for convenience.
00285 typedef FdoPtr<FdoRasterPropertyDefinition> FdoRasterPropertyP;
00286 
00287 #endif // _RASTERPROPERTYDEFINITION_H_
00288 
00289 

Comments or suggestions? Send us feedback.