FDO API Reference Feature Data Objects

GeometryStreamReader.h

Go to the documentation of this file.
00001 #ifndef _GEOMETRYSTREAMREADER_H_
00002 #define _GEOMETRYSTREAMREADER_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 <FdoCommon.h>
00028 #include <Common/Dimensionality.h>
00029 #include <Geometry/IDirectPosition.h>
00030 #include <Geometry/ILinearRing.h>
00031 
00032 class FdoGeometryStreamFactory; // forward declare
00033 
00034 /// \brief
00035 /// The FdoGeometryStreamReader class is a reader for serialized geometric data (abstract). The data source is defined by the implementation.
00036 /// FdoGeometryStreamReader is a helper type and does not inherit from FdoIGeometry.
00037 class FdoGeometryStreamReader /* Abstract */ : public FdoIDisposable
00038 {
00039 public:
00040 
00041     /// \brief
00042     /// Gets an array representing the entire serialized Geometry.
00043     /// 
00044     /// \return
00045     /// Returns the byte array
00046     /// 
00047     FDO_GEOM_API virtual FdoByteArray * GetData() = 0;
00048 
00049     /// \brief
00050     /// Sets the array used by the reader.
00051     /// 
00052     /// \param data 
00053     /// Input array object
00054     /// 
00055     /// \return
00056     /// Returns nothing
00057     /// 
00058     FDO_GEOM_API virtual void SetData(
00059         FdoByteArray * data) = 0;
00060 
00061     /// \brief
00062     /// Sets the array used by the reader.
00063     /// 
00064     /// \param data 
00065     /// Input array data
00066     /// \param count 
00067     /// Input number of bytes in the array
00068     /// The caller must guarantee the validity of the array for the lifetime
00069     /// of the associated geometry stream.
00070     /// 
00071     /// \return
00072     /// Returns nothing
00073     /// 
00074     FDO_GEOM_API virtual void SetData(
00075         const FdoByte * data,
00076         FdoInt32 count) = 0;
00077 
00078     /// \brief
00079     /// Gets the amount of data in the array returned by GetData(), in bytes.
00080     /// 
00081     /// \return
00082     /// Returns the number of bytes of Geometry data
00083     /// 
00084     FDO_GEOM_API virtual FdoInt32 GetLength() = 0;
00085 
00086 
00087     /// \brief
00088     /// Advances the current position by skipping past bytes.
00089     /// 
00090     /// \param count 
00091     /// Input number of bytes to skip
00092     /// 
00093     /// \return
00094     /// Returns nothing
00095     /// 
00096     FDO_GEOM_API virtual void SkipBytes(
00097         FdoInt32 count) = 0;
00098 
00099 
00100     /// \brief
00101     /// Advances the current position by skipping past integers.
00102     /// 
00103     /// \param count 
00104     /// Input number of integers to skip
00105     /// 
00106     /// \return
00107     /// Returns nothing
00108     /// 
00109     FDO_GEOM_API virtual void SkipInts(
00110         FdoInt32 count) = 0;
00111 
00112 
00113     /// \brief
00114     /// Advances the current position by skipping past doubles.
00115     /// 
00116     /// \param count 
00117     /// Input number of doubles to skip
00118     /// 
00119     /// \return
00120     /// Returns nothing
00121     /// 
00122     FDO_GEOM_API virtual void SkipDoubles(
00123         FdoInt32 count) = 0;
00124 
00125 
00126     /// \brief
00127     /// Advances the current position by skipping past geometric
00128     /// positions with the given dimension.
00129     /// 
00130     /// \param dimension 
00131     /// Input dimensionality of the positions (see FdoDimensionality)
00132     /// \param count 
00133     /// Input number of positions to skip
00134     /// 
00135     /// \return
00136     /// Returns nothing
00137     /// 
00138     FDO_GEOM_API virtual void SkipDirectPositions(
00139         FdoInt32 dimension,
00140         FdoInt32 count) = 0;
00141 
00142     /// \brief
00143     /// Resets the current position to the beginning of the stream.
00144     /// 
00145     /// \return
00146     /// Returns nothing
00147     /// 
00148     FDO_GEOM_API virtual void Reset() = 0;
00149 
00150     /// \brief
00151     /// Reads one number as a "double" from current position in the stream.
00152     /// 
00153     /// \return
00154     /// Returns The next number in the stream
00155     /// 
00156     FDO_GEOM_API virtual double ReadDouble() = 0;
00157 
00158     /// \brief
00159     /// Reads one number as a "FdoInt32" from the stream.
00160     /// 
00161     /// \return
00162     /// Returns The next number in the stream
00163     /// 
00164     FDO_GEOM_API virtual FdoInt32 ReadInt() = 0;
00165 
00166     /// \brief
00167     /// Reads one byte from the stream.
00168     /// 
00169     /// \return
00170     /// Returns The next byte in the stream
00171     /// 
00172     FDO_GEOM_API virtual FdoByte ReadByte() = 0;
00173 
00174     /// \brief
00175     /// Reads a geometric position with the given dimensionality from the stream.
00176     /// 
00177     /// \return
00178     /// Returns The numbers in the stream as a FdoIDirectPosition
00179     /// 
00180     FDO_GEOM_API virtual FdoIDirectPosition * ReadDirectPosition(FdoInt32 dimension) = 0;
00181 
00182     /// \brief
00183     /// Reads a geometric position with the given dimensionality from the stream, 
00184     /// by value of its ordinates (for performance).
00185     /// 
00186     /// \param dimensionality 
00187     /// Input Dimensionality of ordinates in this position.
00188     /// \param x 
00189     /// Output X ordinate value.
00190     /// \param y 
00191     /// Output Y ordinate value.
00192     /// \param z 
00193     /// Output Z ordinate value.
00194     /// \param m 
00195     /// Output M ordinate value.
00196     /// 
00197     /// \return
00198     /// Returns nothing
00199     /// 
00200     FDO_GEOM_API virtual void ReadDirectPositionByMembers(FdoInt32 dimensionality, double *x, double *y, double *z, double *m) = 0;
00201 
00202     /// \brief
00203     /// Gets a factory object that can create more streams of the same implementation type as this object.
00204     /// 
00205     /// \return
00206     /// Returns A Geometry stream factory
00207     /// 
00208     FDO_GEOM_API virtual FdoGeometryStreamFactory * GetFactory() = 0;
00209 
00210 protected:
00211 
00212     /// \brief
00213     /// Constructs a default instance of a FdoGeometryStreamReader.
00214     /// 
00215     /// \return
00216     /// Returns nothing
00217     /// 
00218     FDO_GEOM_API FdoGeometryStreamReader() {};
00219 
00220     /// \brief
00221     /// Default destructor.
00222     /// 
00223     /// \return
00224     /// Returns nothing
00225     /// 
00226     FDO_GEOM_API virtual ~FdoGeometryStreamReader() {};
00227 };
00228 #endif
00229 
00230 

Comments or suggestions? Send us feedback.