FDO API Reference Feature Data Objects

ILineString.h

Go to the documentation of this file.
00001 #ifndef _ILINESTRING_H_
00002 #define _ILINESTRING_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 
00022 
00023 #ifdef _WIN32
00024 #pragma once
00025 #endif
00026 
00027 #include <Geometry/ICurveAbstract.h>
00028 #include <Geometry/IDirectPosition.h>
00029 #include <Common/Collection.h>
00030 
00031 /// \brief
00032 /// The FdoILineString class is a LineString Geometry type.  
00033 /// The shape of FdoILineString is the set of positions defined by the contained collection, 
00034 /// plus linear interpolation between consecutive points.
00035 class FdoILineString : public FdoICurveAbstract
00036 {
00037 public:
00038 
00039     /// \brief
00040     /// Gets the number of positions in this object.
00041     /// 
00042     /// \return
00043     /// Returns the number of positions
00044     /// 
00045     FDO_GEOM_API virtual FdoInt32 GetCount() const = 0;
00046 
00047     /// \brief
00048     /// Gets the position at the specified (zero-based) index.
00049     /// 
00050     /// \param index 
00051     /// Input Zero-based index in the object's list of positions.
00052     /// 
00053     /// \return
00054     /// Returns the position
00055     /// 
00056     FDO_GEOM_API virtual FdoIDirectPosition* GetItem(
00057         FdoInt32 index) const = 0;
00058 
00059     /// \brief
00060     /// Gets the position at the specified (zero-based) index, by values of its member data.
00061     /// This is in aid of higher performance for any implementation that
00062     /// does not internally use FdoIDirectPosition objects for storage, or for
00063     /// an application seeking to avoid overhead of accessor methods.
00064     /// 
00065     /// \param index 
00066     /// Input Zero-based index in the object's list of positions.
00067     /// \param x 
00068     /// Output X ordinate value.
00069     /// \param y 
00070     /// Output Y ordinate value.
00071     /// \param z 
00072     /// Output Z ordinate value.
00073     /// \param m 
00074     /// Output M ordinate value.
00075     /// \param dimensionality 
00076     /// Output Dimensionality of ordinates in this position.
00077     /// 
00078     /// \return
00079     /// Returns nothing
00080     /// 
00081     FDO_GEOM_API virtual void GetItemByMembers(
00082         FdoInt32 index,
00083         double *x,
00084         double *y,
00085         double *z,
00086         double *m,
00087         FdoInt32 *dimensionality) const = 0;
00088 
00089     /// \brief
00090     /// Gets a collection of all of the positions in this object.
00091     /// 
00092     /// \return
00093     /// Returns the positions
00094     /// 
00095     FDO_GEOM_API virtual FdoDirectPositionCollection* GetPositions() = 0;
00096 
00097     /// \brief
00098     /// Gets the ordinates as an array.
00099     /// 
00100     /// \remarks
00101     /// The caller must not free the returned array.
00102     /// The ordinates are in the order XYZMXYZM..., with only those present 
00103     /// according to the dimensionality.
00104     /// 
00105     /// \return
00106     /// Returns the ordinates
00107     /// 
00108     FDO_GEOM_API virtual const double * GetOrdinates() = 0;
00109 
00110 protected:
00111 
00112     /// \brief
00113     /// Constructs a default instance.
00114     /// 
00115     /// \return
00116     /// Returns nothing
00117     /// 
00118     FDO_GEOM_API FdoILineString() {};
00119 
00120     /// \brief
00121     /// Default destructor.
00122     /// 
00123     /// \return
00124     /// Returns nothing
00125     /// 
00126     FDO_GEOM_API virtual ~FdoILineString() {};
00127 };
00128 
00129 
00130 /// \brief
00131 ///  The FdoLineStringCollection class is a collection of CurvePolygon objects.
00132 class FdoLineStringCollection : public FdoCollection<FdoILineString, FdoException>
00133 {
00134 public:
00135     /// \brief
00136     ///  Creates an instance of FdoLineStringCollection with no contained elements.
00137     /// 
00138     /// \return
00139     /// Returns an empty collection
00140     /// 
00141     static FdoLineStringCollection* Create()
00142     {
00143         FdoLineStringCollection* value = new FdoLineStringCollection();
00144         if (NULL == value)
00145             throw FdoException::Create(FdoException::NLSGetMessage(FDO_NLSID(FDO_1_BADALLOC)));
00146 
00147         return value;
00148     }
00149 
00150 protected:
00151     void Dispose()
00152     {
00153         delete this;
00154     }
00155 };
00156 #endif
00157 
00158 

Comments or suggestions? Send us feedback.