FDO API Reference Feature Data Objects

GeometricPropertyDefinition.h

Go to the documentation of this file.
00001 #ifndef _GEOMETRICPROPERTYDEFINITION_H_
00002 #define _GEOMETRICPROPERTYDEFINITION_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/PropertyDefinition.h>
00027 #include <Common/GeometryType.h>
00028 #include <Fdo/Schema/PropertyType.h>
00029 
00030 /// \brief
00031 /// FdoGeometricPropertyDefinition derives from FdoPropertyDefinition and represents a
00032 /// geometric value. Geometric properties can take on any of the geometric types
00033 /// listed in the FdoGeometricType enumeration. 
00034 /// \note
00035 /// Geometric properties do
00036 /// not actually store the coordinate system or measure units, this is to enable
00037 /// the use of the same schema in different geometric locals. FdoGeometricType
00038 /// informs the client application what types of geometric primitives it can
00039 /// expect when reading a particular geometric property (and what types they can
00040 /// store in the property on insert/update). The client application can
00041 /// interpret the actual geometry values as it wants, e.g., displaying and
00042 /// manipulating the vertices of a Polyline as a group of independent points.
00043 class FdoGeometricPropertyDefinition : public FdoPropertyDefinition
00044 {
00045     friend class FdoFeatureClass;
00046 
00047 protected:
00048 /// \cond DOXYGEN-IGNORE
00049     /// Constructs a default instance of an FdoGeometricPropertyDefinition.
00050     FdoGeometricPropertyDefinition();
00051 
00052     /// Constructs an instance of an FdoGeometricPropertyDefinition using the
00053     /// specified arguments.
00054     FdoGeometricPropertyDefinition(FdoString* name, FdoString* description, bool system = false);
00055 
00056     virtual ~FdoGeometricPropertyDefinition();
00057 
00058     virtual void Dispose();
00059 /// \endcond
00060 
00061 public:
00062     /// \brief
00063     /// Constructs a default instance of an FdoGeometricPropertyDefinition.
00064     /// 
00065     /// \return
00066     /// Returns FdoGeometricPropertyDefinition
00067     /// 
00068     FDO_API static FdoGeometricPropertyDefinition* Create();
00069 
00070     /// \brief
00071     /// Constructs an instance of an FdoGeometricPropertyDefinition using the
00072     /// specified arguments.
00073     /// 
00074     /// \param name 
00075     /// Input name
00076     /// \param description 
00077     /// Input description
00078     /// \param system 
00079     /// Input true if this is a system generated property, false otherwise.
00080     /// \note
00081     /// A client would never set system to true, only a provider.
00082     /// 
00083     /// \return
00084     /// Returns FdoGeometricPropertyDefinition
00085     /// 
00086     FDO_API static FdoGeometricPropertyDefinition* Create(FdoString* name, FdoString* description, bool system = false);
00087 
00088     /// \brief
00089     /// Gets the concrete property type.
00090     /// 
00091     /// \return
00092     /// Returns the concrete property type
00093     /// 
00094     FDO_API virtual FdoPropertyType GetPropertyType();
00095 
00096     /// \brief
00097     /// Gets the FdoGeometricTypes that can be stored in this geometric property.
00098     /// The returned value may be any combination of the values from the
00099     /// FdoGeometricType enumeration combined via a bit-wise or operation.
00100     /// 
00101     /// \return
00102     /// Returns the FdoGeometricTypes that can be stored in this geometric property
00103     /// 
00104     FDO_API FdoInt32 GetGeometryTypes();
00105 
00106     /// \brief
00107     /// Sets the FdoGeometricTypes that can be stored in this geometric property.
00108     /// The value may be any combination of the values from the FdoGeometricType
00109     /// enumeration combined via a bit-wise or operation.
00110     /// 
00111     /// \param value 
00112     /// Input the FdoGeometricTypes that can be stored in this geometric property
00113     /// 
00114     /// \return
00115     /// Returns nothing
00116     /// 
00117     FDO_API void SetGeometryTypes(FdoInt32 value);
00118 
00119     /// \brief
00120     /// Returns a Boolean value that indicates if this geometric property is
00121     /// read-only.
00122     /// 
00123     /// \return
00124     /// Returns a Boolean value that specifies whether this geometric property is
00125     /// read-only
00126     /// 
00127     FDO_API bool GetReadOnly();
00128 
00129     /// \brief
00130     /// Sets a Boolean value that specifies whether this geometric property is
00131     /// read-only.
00132     /// 
00133     /// \param value 
00134     /// Input a Boolean value that specifies whether this geometric property is
00135     /// read-only
00136     /// 
00137     /// \return
00138     /// Returns nothing
00139     /// 
00140     FDO_API void SetReadOnly(bool value);
00141 
00142     /// \brief
00143     /// Gets a Boolean value that indicates if the geometry of this property
00144     /// include elevation values.
00145     /// 
00146     /// \return
00147     /// Returns a Boolean value that determines if the geometry of this property
00148     /// includes elevation values
00149     /// 
00150     FDO_API bool GetHasElevation();
00151 
00152     /// \brief
00153     /// Sets a Boolean value that determines if the geometry of this property
00154     /// includes elevation values.
00155     /// 
00156     /// \param value 
00157     /// Input a Boolean value that determines if the geometry of this property
00158     /// includes elevation values
00159     /// 
00160     /// \return
00161     /// Returns nothing
00162     /// 
00163     FDO_API void SetHasElevation(bool value);
00164 
00165     /// \brief
00166     /// Gets a Boolean value that indicates if the geometry of this property
00167     /// includes measurement values that can be used for dynamic segmentation.
00168     /// 
00169     /// \return
00170     /// Returns a Boolean value that indicates if the geometry of this property
00171     /// includes measurement values
00172     /// 
00173     FDO_API bool GetHasMeasure();
00174 
00175     /// \brief
00176     /// Sets a Boolean value that determines if the geometry of this property
00177     /// includes measurement values that can be used for dynamic segmentation.
00178     /// 
00179     /// \param value 
00180     /// Input a Boolean value that determines if the geometry of this property
00181     /// includes measurement values
00182     /// 
00183     /// \return
00184     /// Returns nothing
00185     /// 
00186     FDO_API void SetHasMeasure(bool value);
00187 
00188     /// \brief
00189     /// Sets/add a Spatial Context association to this geometric property.
00190     /// 
00191     /// \param value 
00192     /// Input the Spatial Context name to be added/set. 
00193     /// Defaults to the active Spatial Context.
00194     /// 
00195     /// \return
00196     /// Returns nothing
00197     /// 
00198     FDO_API void SetSpatialContextAssociation(FdoString *value);
00199 
00200     /// \brief
00201     /// Gets the Spatial Context name associated to this geometric property.
00202     /// 
00203     /// \return
00204     /// Returns a String value representing the Spatial Context name.
00205     /// If NULL then the geometric property is associated with all the Spatial Contexts
00206     /// in the datastore (supports multiple geometric representations via this property).
00207     /// 
00208     FDO_API FdoString * GetSpatialContextAssociation();
00209 
00210 /// \cond DOXYGEN-IGNORE
00211     /// Public non-API functions for XML support
00212 
00213     /// Update this property from the given property.
00214     virtual void Set( FdoPropertyDefinition* pProperty, FdoSchemaXmlContext* pContext );
00215 
00216     /// Initialize this property from its XML attributes
00217     virtual void InitFromXml(const FdoString* propertyTypeName, FdoSchemaXmlContext* pContext, FdoXmlAttributeCollection* attrs);
00218 
00219     /// read the geometric types from XML sub-elements.
00220     /// Element start
00221     virtual FdoXmlSaxHandler* XmlStartElement(
00222         FdoXmlSaxContext* context, 
00223         FdoString* uri, 
00224         FdoString* name, 
00225         FdoString* qname, 
00226         FdoXmlAttributeCollection* atts
00227     );
00228     /// Element end
00229     virtual FdoBoolean XmlEndElement(
00230         FdoXmlSaxContext* context, 
00231         FdoString* uri, 
00232         FdoString* name, 
00233         FdoString* qname
00234     );
00235 
00236     /// Serialize this property to XML.
00237     virtual void _writeXml( FdoSchemaXmlContext* pContext );
00238 
00239     /// Returns true if none of this property's setters have been called.
00240     bool GetAllDefaults();
00241 
00242 private:
00243     FdoInt32        m_geometricTypes;
00244     bool            m_readOnly;
00245     bool            m_hasElevation;
00246     bool            m_hasMeasure;
00247     FdoStringP      m_associatedSCName;
00248     bool            m_allDefaults;
00249 
00250     /// Temporary holding place for geometric types while being
00251     /// deserialized from XML.
00252     FdoInt32        m_XmlGeometricTypes;
00253 
00254 protected:
00255     /// FdoFeatureSchema::RejectChanges() support
00256     virtual void    _StartChanges();
00257     virtual void    _RejectChanges();
00258     virtual void    _AcceptChanges();
00259     FdoInt32        m_geometricTypesCHANGED;
00260     bool            m_readOnlyCHANGED;
00261     bool            m_hasElevationCHANGED;
00262     bool            m_hasMeasureCHANGED;
00263     FdoStringP      m_associatedSCNameCHANGED;
00264 /// \endcond
00265 };
00266 
00267 /// \brief
00268 /// FdoGeometricPropertyP is a FdoPtr on FdoGeometricPropertyDefinition, provided for convenience.
00269 typedef FdoPtr<FdoGeometricPropertyDefinition> FdoGeometricPropertyP;
00270 
00271 #endif
00272 
00273 

Comments or suggestions? Send us feedback.