FDO .NET API Reference Feature Data Objects

mgIPolygon.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2004-2006  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 
00019 #pragma once
00020 
00021 #include "mgISurfaceAbstract.h"
00022 
00023 class FdoPolygonCollection;
00024 
00025 BEGIN_NAMESPACE_OSGEO_GEOMETRY
00026 public __gc __interface ILinearRing;
00027 END_NAMESPACE_OSGEO_GEOMETRY
00028 
00029 BEGIN_NAMESPACE_OSGEO_GEOMETRY
00030 
00031 /// \ingroup (OSGeoFDOGeometry)
00032 /// \interface OSGeo::FDO::Geometry::IPolygon
00033 /// \brief
00034 /// The IPolygon class is a polygon Geometry type.  
00035 /// IPolygon is defined by one exterior boundary and zero or more 
00036 /// interior boundaries.
00037 /// Each of the boundaries must be a closed, simple LinearRing.
00038 public __gc __interface IPolygon : public NAMESPACE_OSGEO_GEOMETRY::ISurfaceAbstract
00039 {
00040 public:
00041     /// \brief
00042     /// Gets the ring defining the outer boundary.
00043     /// 
00044     /// \return
00045     /// Returns the exterior ring
00046     /// 
00047     __property NAMESPACE_OSGEO_GEOMETRY::ILinearRing* get_ExteriorRing();
00048 
00049     /// \brief
00050     /// Gets the number of interior rings.
00051     /// 
00052     /// \return
00053     /// Returns the number of interior rings
00054     /// 
00055     __property System::Int32 get_InteriorRingCount();
00056 
00057     /// \brief
00058     /// Gets the interior ring at the specified (zero-based) index.
00059     /// 
00060     /// \param index 
00061     /// Input Zero-based index in the object's list of interior rings.
00062     /// 
00063     /// \return
00064     /// Returns the interior ring
00065     /// 
00066     NAMESPACE_OSGEO_GEOMETRY::ILinearRing* GetInteriorRing(System::Int32 index);
00067     
00068 };
00069 
00070 /// \brief
00071 /// The PolygonCollection class is a collection of IPolygon objects.
00072 [System::Reflection::DefaultMemberAttribute("RealTypeItem")]
00073 public __gc __sealed class PolygonCollection 
00074     : public NAMESPACE_OSGEO_RUNTIME::Disposable, public System::Collections::IList
00075 {
00076 public:
00077     /// \brief
00078     /// Constructs a managed object based on an unmanaged instance of the object
00079     /// 
00080     /// \param unmanaged 
00081     /// Input A Pointer to the unmanaged object.
00082     /// 
00083     /// \param autoDelete 
00084     /// Input Indicates if the constructed element should be automatically deleted 
00085     /// once it no longer referenced.
00086     /// 
00087     PolygonCollection(System::IntPtr unmanaged, System::Boolean autoDelete);
00088 
00089 public private:
00090     FdoPolygonCollection *GetImpObj();
00091 
00092 /// \cond DOXYGEN-IGNORE
00093 protected:
00094     __sealed System::Void ReleaseUnmanagedObject();
00095 
00096 private:
00097     /// \brief
00098     /// A Nested class defined to provide enumeration of Dictionary elements
00099     ///
00100     /// Enumerators can be used to read the data in the collection, 
00101     /// but they cannot be used to modify the underlying collection.
00102     ///
00103     /// An enumerator remains valid as long as the collection remains unchanged. 
00104     /// If changes are made to the collection, such as adding, modifying, or deleting 
00105     /// elements, the enumerator is irrecoverably invalidated and the next call to 
00106     /// MoveNext or Reset throws an InvalidOperationException. If the collection is 
00107     /// modified between MoveNext and Current, Current returns the element that it is 
00108     /// set to, even if the enumerator is already invalidated.
00109     ///
00110     /// The enumerator does not have exclusive access to the collection; therefore, 
00111     /// enumerating through a collection is intrinsically not a thread-safe procedure. 
00112     /// Even when a collection is synchronized, other threads can still modify the 
00113     /// collection, which causes the enumerator to throw an exception. To guarantee 
00114     /// thread safety during enumeration, you can either lock the collection during 
00115     /// the entire enumeration or catch the exceptions resulting from changes made 
00116     /// by other threads.
00117     /// 
00118     __gc class Enumerator : public System::Collections::IEnumerator
00119     {
00120         PolygonCollection *m_pCol;
00121         System::Int32 m_nIdx;
00122 
00123     public:
00124         /// \brief
00125         /// Constructs a new Collection Enumerator
00126         /// 
00127         /// \param col 
00128         /// Input The collection to enumerate.
00129         /// 
00130         Enumerator(PolygonCollection *col)
00131             : m_pCol(col), m_nIdx(-1)
00132         {}
00133 
00134         /// \brief
00135         /// Retrieves the current object at the enumerator location
00136         /// 
00137         /// \return
00138         /// Retuns the current object referenced by the enumerator
00139         /// 
00140         __property System::Object *get_Current();
00141 
00142         /// \brief
00143         /// Initially, the enumerator is positioned before the first element in the collection. 
00144         /// At this position, calling the Current property throws an exception. 
00145         /// Therefore, you must call the MoveNext method to advance the enumerator 
00146         /// to the first element of the collection before reading the value of Current.
00147         /// If MoveNext passes the end of the collection, the enumerator is positioned 
00148         /// after the last element in the collection and MoveNext returns false. 
00149         /// When the enumerator is at this position, subsequent calls to MoveNext also return false. 
00150         /// If the last call to MoveNext returned false, calling Current throws an exception. 
00151         /// To set Current to the first element of the collection again, you can call Reset 
00152         /// followed by MoveNext.
00153         /// 
00154         /// \return
00155         /// Retuns true if the Enumerator is able to move to a valid element
00156         /// otherwise false.
00157         /// 
00158         System::Boolean MoveNext();
00159 
00160         /// \brief
00161         /// Initially, the enumerator is positioned before the first element in the collection. 
00162         /// The Reset method brings the enumerator back to this position. 
00163         /// 
00164         System::Void Reset();
00165     };
00166 /// \endcond
00167 
00168 public:
00169     /// \brief
00170     /// Creates an instance of PolygonCollection with no contained elements.
00171     /// 
00172     /// \return
00173     /// Returns an empty collection
00174     /// 
00175     PolygonCollection();
00176 
00177 private:
00178     // System::Collections::ICollection interface properties
00179     __property System::Object* System::Collections::ICollection::get_SyncRoot();
00180     __property System::Boolean System::Collections::ICollection::get_IsSynchronized();
00181 
00182     // System::Collections::ICollection interface methods
00183     System::Void System::Collections::ICollection::CopyTo(System::Array* array,System::Int32 index);
00184 
00185     // System::Collections::IList interface properties
00186     __property System::Boolean System::Collections::IList::get_IsFixedSize();
00187     __property System::Boolean System::Collections::IList::get_IsReadOnly();
00188     __property Object* System::Collections::IList::get_Item(System::Int32 index);
00189     __property System::Void  System::Collections::IList::set_Item(System::Int32 index, Object* value);
00190 
00191     // System::Collections::IList interface methods
00192     System::Int32 System::Collections::IList::Add(Object* value);
00193     System::Boolean System::Collections::IList::Contains(Object* value);
00194     System::Int32 System::Collections::IList::IndexOf(Object* value);
00195     System::Void System::Collections::IList::Insert(System::Int32 index, Object* value);
00196     System::Void System::Collections::IList::Remove(Object* value);
00197 
00198 public:
00199     /// \brief
00200     /// Gets the count of items in collection.
00201     /// 
00202     /// \return
00203     /// Returns the number of items in the collection.
00204     /// 
00205     __property System::Int32 get_Count(System::Void);
00206 
00207     /// \brief
00208     /// Gets an enumerator that can iterate through a collection.
00209     /// 
00210     /// \return
00211     /// Returns an enumerator on the dictionary.
00212     /// 
00213     __sealed System::Collections::IEnumerator* GetEnumerator(System::Void);
00214 
00215     /// \brief
00216     /// Removes the index-th IPolygon from this collection.
00217     /// 
00218     /// \param index 
00219     /// Input index of the element to remove.
00220     /// 
00221     System::Void RemoveAt(System::Int32 index);
00222     /// \brief
00223     /// Removes all elements from the collection.
00224     /// 
00225     System::Void  Clear();
00226 
00227 public:
00228     /// \brief
00229     /// Adds a IPolygon object into the collection.
00230     /// 
00231     /// \param value 
00232     /// Input the IPolygon object to add.
00233     /// 
00234     /// \return
00235     /// The position into which the new element was inserted.
00236     /// 
00237     System::Int32 Add(NAMESPACE_OSGEO_GEOMETRY::IPolygon* value);
00238     /// \brief
00239     /// Determines the index of a specific IPolygon object.
00240     /// 
00241     /// \param value 
00242     /// Input the IPolygon object to locate in the collection.
00243     /// 
00244     /// \return
00245     /// The index of value if found in the collection; otherwise, -1.
00246     /// 
00247     System::Int32 IndexOf(NAMESPACE_OSGEO_GEOMETRY::IPolygon* value);
00248     /// \brief
00249     /// Inserts an IPolygon object to the collection at the specified position.
00250     /// 
00251     /// \param index 
00252     /// Input the zero-based index at which value should be inserted.
00253     /// \param value 
00254     /// Input the IPolygon object to insert.
00255     /// 
00256     System::Void Insert(System::Int32 index, NAMESPACE_OSGEO_GEOMETRY::IPolygon* value); 
00257     /// \brief
00258     /// Removes the first occurrence of a specific IPolygon object.
00259     /// 
00260     /// \param value 
00261     /// Input the IPolygon object to remove from the collection.
00262     /// 
00263     System::Void Remove(NAMESPACE_OSGEO_GEOMETRY::IPolygon* value);
00264     /// \brief
00265     /// Determines whether the collection contains a specific IPolygon object.
00266     /// 
00267     /// \param value 
00268     /// Input The IPolygon object to locate in the collection.
00269     /// 
00270     /// \return
00271     /// True if the value is found in the collection; otherwise, false.
00272     /// 
00273     System::Boolean Contains(NAMESPACE_OSGEO_GEOMETRY::IPolygon* value);
00274     /// \brief
00275     /// Copies the elements of the collection to an array.
00276     /// 
00277     /// \param array 
00278     /// Output the one-dimensional Array that is the destination of the elements copied from this collection.
00279     /// \param startAt 
00280     /// Input an integer that represents the index in array at which copying begins.
00281     /// 
00282     System::Void CopyTo(NAMESPACE_OSGEO_GEOMETRY::IPolygon* array[],System::Int32 startAt);
00283 
00284     /// \brief
00285     /// Gets an IPolygon object in the collection.
00286     /// 
00287     /// \param index 
00288     /// Input index of the IPolygon object to retrieve.
00289     /// 
00290     __property NAMESPACE_OSGEO_GEOMETRY::IPolygon *get_RealTypeItem(System::Int32 index);
00291 
00292     /// \brief
00293     /// Sets the value of the IPolygon object at the specified index
00294     /// 
00295     /// \param index 
00296     /// Input index of the IPolygon object to set.
00297     /// 
00298     /// \param value 
00299     /// Input the value of the IPolygon
00300     /// 
00301     __property System::Void set_RealTypeItem(System::Int32 index, NAMESPACE_OSGEO_GEOMETRY::IPolygon *value);
00302 
00303     /// \brief
00304     /// Gets an IPolygon object in the collection.
00305     /// 
00306     /// \param index 
00307     /// Input index of the IPolygon object to retrieve.
00308     /// 
00309     /// \return
00310     /// Returns the IPolygon object at the specified index
00311     /// 
00312     __property NAMESPACE_OSGEO_GEOMETRY::IPolygon *get_Item(System::Int32 index);
00313 
00314     /// \brief
00315     /// Sets the value of the IPolygon object at the specified index
00316     /// 
00317     /// \param index 
00318     /// Input index of the IPolygon object to set.
00319     /// 
00320     /// \param value 
00321     /// Input the value of the IPolygon object
00322     /// 
00323     __property System::Void set_Item(System::Int32 index, NAMESPACE_OSGEO_GEOMETRY::IPolygon *value);
00324 };
00325 
00326 END_NAMESPACE_OSGEO_GEOMETRY
00327 
00328 

Comments or suggestions? Send us feedback.