- Main Page
- Related Pages
- Modules
- Classes
- Files

# GeometryFactoryAbstract.h

Go to the documentation of this file.

    00001 #ifndef _GEOMETRYFACTORYABSTRACT_H_
    00002 #define _GEOMETRYFACTORYABSTRACT_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 <Geometry/GeometryStd.h>
    00029
    00030 /// \brief
    00031 ///
    00032 /// The FdoGeometryFactoryAbstract class is a factory (abstract, non-pure) for Geometry objects and Geometry helper objects.
    00033 class FdoGeometryFactoryAbstract : public FdoIDisposable
    00034 {
    00035 public:
    00036
    00037     /// Position
    00038
    00039     /// \brief
    00040     ///  Creates a position object using X and Y ordinates.
    00041     ///
    00042     /// \remarks
    00043     ///  The resulting object's accessor methods for ordinates
    00044     /// that are not given here as input parameters will return the default
    00045     /// value of 0.0.
    00046     ///
    00047     /// \param x
    00048     /// Input X ordinate value
    00049     /// \param y
    00050     /// Input Y ordinate value
    00051     ///
    00052     /// \return
    00053     /// Returns a direct position
    00054     ///
    00055     FDO_GEOM_API virtual FdoIDirectPosition* CreatePositionXY(
    00056         double x,
    00057         double y);
    00058
    00059     /// \brief
    00060     ///  Creates a position object using X, Y and Z ordinates.
    00061     ///
    00062     /// \remarks
    00063     ///  The resulting object's accessor methods for ordinates
    00064     /// that are not given here as input parameters will return the default
    00065     /// value of 0.0.
    00066     ///
    00067     /// \param x
    00068     /// Input X ordinate value
    00069     /// \param y
    00070     /// Input Y ordinate value
    00071     /// \param z
    00072     /// Input Z ordinate value
    00073     ///
    00074     /// \return
    00075     /// Returns a direct position
    00076     ///
    00077     FDO_GEOM_API virtual FdoIDirectPosition* CreatePositionXYZ(
    00078         double x,
    00079         double y,
    00080         double z);
    00081
    00082     /// \brief
    00083     ///  Creates a position object using X, Y and M ordinates.
    00084     ///
    00085     /// \remarks
    00086     ///  The resulting object's accessor methods for ordinates
    00087     /// that are not given here as input parameters will return the default
    00088     /// value of 0.0.
    00089     ///
    00090     /// \param x
    00091     /// Input X ordinate value
    00092     /// \param y
    00093     /// Input Y ordinate value
    00094     /// \param m
    00095     /// Input M ordinate value
    00096     ///
    00097     /// \return
    00098     /// Returns a direct position
    00099     ///
    00100     FDO_GEOM_API virtual FdoIDirectPosition* CreatePositionXYM(
    00101         double x,
    00102         double y,
    00103         double m);
    00104
    00105     /// \brief
    00106     ///  Creates a position object using X, Y, Z and M ordinates.
    00107     ///
    00108     /// \param x
    00109     /// Input X ordinate value
    00110     /// \param y
    00111     /// Input Y ordinate value
    00112     /// \param z
    00113     /// Input Z ordinate value
    00114     /// \param m
    00115     /// Input M ordinate value
    00116     ///
    00117     /// \return
    00118     /// Returns a direct position
    00119     ///
    00120     FDO_GEOM_API virtual FdoIDirectPosition* CreatePositionXYZM(
    00121         double x,
    00122         double y,
    00123         double z,
    00124         double m);
    00125
    00126     FDO_GEOM_API virtual FdoIDirectPosition* CreatePosition(
    00127         FdoInt32 dimensionality,
    00128         const double * ordinates);
    00129
    00130     /// \brief
    00131     ///  Creates a position object by copying from an existing position.
    00132     ///
    00133     /// \param position
    00134     /// Input position to copy
    00135     ///
    00136     /// \return
    00137     /// Returns a direct position
    00138     ///
    00139     FDO_GEOM_API virtual FdoIDirectPosition* CreatePosition(
    00140         FdoIDirectPosition * position);
    00141
    00142     /// Envelope
    00143
    00144     /// \brief
    00145     ///  Creates an envelope object using two positions.
    00146     ///
    00147     /// \param lowerLeft
    00148     /// Input lower-left position
    00149     /// \param upperRight
    00150     /// Input upper-right position
    00151     ///
    00152     /// \return
    00153     /// Returns an envelope
    00154     ///
    00155     FDO_GEOM_API virtual FdoIEnvelope* CreateEnvelope(
    00156         FdoIDirectPosition * lowerLeft,
    00157         FdoIDirectPosition * upperRight);
    00158
    00159     /// \brief
    00160     ///  Creates an envelope object by copying from an array of ordinates.
    00161     ///
    00162     /// \param dimensionType
    00163     /// Input dimensionality of the ordinates (see FdoDimensionality)
    00164     /// \param ordinates
    00165     /// Input ordinate array representing two positions
    00166     ///
    00167     /// \return
    00168     /// Returns an envelope
    00169     ///
    00170     FDO_GEOM_API virtual FdoIEnvelope* CreateEnvelope(
    00171         FdoInt32 dimensionType,
    00172         double * ordinates);
    00173
    00174     /// \brief
    00175     ///  Creates an envelope object using X and Y ordinates.
    00176     ///
    00177     /// \param lowerLeftX
    00178     /// Input lower-left X ordinate
    00179     /// \param lowerLeftY
    00180     /// Input lower-left Y ordinate
    00181     /// \param upperRightX
    00182     /// Input upper-right X ordinate
    00183     /// \param upperRightY
    00184     /// Input upper-right Y ordinate
    00185     ///
    00186     /// \return
    00187     /// Returns an envelope
    00188     ///
    00189     FDO_GEOM_API virtual FdoIEnvelope* CreateEnvelopeXY(
    00190         double lowerLeftX,
    00191         double lowerLeftY,
    00192         double upperRightX,
    00193         double upperRightY);
    00194
    00195     /// \brief
    00196     ///  Creates an envelope object using X, Y and Z ordinates.
    00197     ///
    00198     /// \param lowerLeftX
    00199     /// Input lower-left, rear X ordinate
    00200     /// \param lowerLeftY
    00201     /// Input lower-left, rear Y ordinate
    00202     /// \param lowerLeftZ
    00203     /// Input lower-left, rear Z ordinate
    00204     /// \param upperRightX
    00205     /// Input upper-right, front X ordinate
    00206     /// \param upperRightY
    00207     /// Input upper-right, front Y ordinate
    00208     /// \param upperRightZ
    00209     /// Input upper-right, front Z ordinate
    00210     ///
    00211     /// \return
    00212     /// Returns an envelope
    00213     ///
    00214     FDO_GEOM_API virtual FdoIEnvelope* CreateEnvelopeXYZ(
    00215         double lowerLeftX,
    00216         double lowerLeftY,
    00217         double lowerLeftZ,
    00218         double upperRightX,
    00219         double upperRightY,
    00220         double upperRightZ);
    00221
    00222     /// \brief
    00223     ///  Creates a envelope object by copying from another envelope.
    00224     ///
    00225     /// \param envelope
    00226     /// Input Source envelope
    00227     ///
    00228     /// \return
    00229     /// Returns an envelope
    00230     ///
    00231     FDO_GEOM_API virtual FdoIEnvelope* CreateEnvelope(
    00232         FdoIEnvelope * envelope);
    00233
    00234     /// LineString
    00235
    00236     /// \brief
    00237     ///  Creates a LineString object by copying from a collection of positions.
    00238     ///
    00239     /// \param positions
    00240     /// Input collection of positions to copy
    00241     ///
    00242     /// \return
    00243     /// Returns a LineString
    00244     ///
    00245     FDO_GEOM_API virtual FdoILineString* CreateLineString(
    00246         FdoDirectPositionCollection* positions) = 0;
    00247
    00248     /// \brief
    00249     ///  Creates a LineString object by copying from an array of ordinates.
    00250     ///
    00251     /// \param dimensionType
    00252     /// Input dimensionality of the ordinates (see FdoDimensionality)
    00253     /// \param numOrdinates
    00254     /// Input total number of ordinates in the array
    00255     /// \param ordinates
    00256     /// Input ordinate array representing positions
    00257     ///
    00258     /// \return
    00259     /// Returns a LineString
    00260     ///
    00261     FDO_GEOM_API virtual FdoILineString* CreateLineString(
    00262         FdoInt32 dimensionType,
    00263         FdoInt32 numOrdinates,
    00264         double* ordinates) = 0;
    00265
    00266     /// Geometry
    00267
    00268     /// \brief
    00269     ///  Creates a Geometry object by copying from another Geometry.
    00270     ///
    00271     /// \remarks
    00272     ///  This is a pseudo-copy-constructor.
    00273     /// It is required that any implementation use only public methods on the underlying
    00274     /// Geometry object, thus enabling conversion from geometries of the same (or any
    00275     /// other) implementation of this Geometry package.
    00276     ///
    00277     /// \param geometry
    00278     /// Input Source geometry
    00279     ///
    00280     /// \return
    00281     /// Returns an envelope
    00282     ///
    00283     FDO_GEOM_API virtual FdoIGeometry * CreateGeometry(
    00284         FdoIGeometry * geometry) = 0;
    00285
    00286     /// \brief
    00287     ///  Creates a Geometry object by converting from a text string.
    00288     ///
    00289     /// \remarks
    00290     ///  While this method is not pure virtual, its default implementation will
    00291     /// throw an exception if called.  A concrete, derived class should override this
    00292     /// method if conversion from text is required.
    00293     ///
    00294     /// \param text
    00295     /// Input Source geometry text
    00296     ///
    00297     /// \return
    00298     /// Returns a Geometry
    00299     ///
    00300     FDO_GEOM_API FdoIGeometry * CreateGeometry(
    00301         FdoString* text);
    00302
    00303     /// \brief
    00304     ///  Creates a Geometry object by converting from an envelope.
    00305     ///
    00306     /// \remarks
    00307     ///  This method will produce a new Geometry
    00308     /// based on the given envelope.  The actual geometry type produced is implementation-dependent.
    00309     ///
    00310     /// \param envelope
    00311     /// Input Source envelope
    00312     ///
    00313     /// \return
    00314     /// Returns a Geometry
    00315     ///
    00316     FDO_GEOM_API virtual FdoIGeometry * CreateGeometry(
    00317         FdoIEnvelope * envelope) = 0;
    00318
    00319     /// Point
    00320
    00321     /// \brief
    00322     ///  Creates a point object by copying from a position.
    00323     ///
    00324     /// \param position
    00325     /// Input position to copy
    00326     ///
    00327     /// \return
    00328     /// Returns a point
    00329     ///
    00330     FDO_GEOM_API virtual FdoIPoint* CreatePoint(
    00331         FdoIDirectPosition* position) = 0;
    00332
    00333     /// \brief
    00334     ///  Creates a point object by copying from an array of ordinates.
    00335     ///
    00336     /// \param dimensionality
    00337     /// Input dimensionality of the ordinates (see FdoDimensionality)
    00338     /// \param ordinates
    00339     /// Input ordinate array representing one position
    00340     ///
    00341     /// \return
    00342     /// Returns a point
    00343     ///
    00344     FDO_GEOM_API virtual FdoIPoint* CreatePoint(
    00345         FdoInt32 dimensionality,
    00346         double* ordinates) = 0;
    00347
    00348     /// LinearRing
    00349
    00350     /// \brief
    00351     ///  Creates a LinearRing object by copying from a collection of positions.
    00352     ///
    00353     /// \remarks
    00354     ///  The first and last positions must be equal.
    00355     ///
    00356     /// \param positions
    00357     /// Input collection of positions to copy
    00358     ///
    00359     /// \return
    00360     /// Returns a LinearRing
    00361     ///
    00362     FDO_GEOM_API virtual FdoILinearRing* CreateLinearRing(
    00363         FdoDirectPositionCollection* positions) = 0;
    00364
    00365     /// \brief
    00366     ///  Creates a LinearRing object by copying from an array of ordinates.
    00367     ///
    00368     /// \remarks
    00369     ///  The ordinates representing the first and last positions must be equal.
    00370     ///
    00371     /// \param dimensionality
    00372     /// Input dimensionality of the ordinates (see FdoDimensionality)
    00373     /// \param numOrdinates
    00374     /// Input total number of ordinates in the array
    00375     /// \param ordinates
    00376     /// Input ordinate array representing positions
    00377     ///
    00378     /// \return
    00379     /// Returns a LinearRing
    00380     ///
    00381     FDO_GEOM_API virtual FdoILinearRing* CreateLinearRing(
    00382         FdoInt32 dimensionality,
    00383         FdoInt32 numOrdinates,
    00384         double* ordinates) = 0;
    00385
    00386     /// LineStringSegment
    00387
    00388     /// \brief
    00389     ///  Creates a LineStringSegment object by copying from a collection of positions.
    00390     ///
    00391     /// \param positions
    00392     /// Input collection of positions to copy
    00393     ///
    00394     /// \return
    00395     /// Returns a LineStringSegment
    00396     ///
    00397     FDO_GEOM_API virtual FdoILineStringSegment* CreateLineStringSegment(
    00398         FdoDirectPositionCollection* positions) = 0;
    00399
    00400     /// \brief
    00401     ///  Creates a LineStringSegment object by copying from an array of ordinates.
    00402     ///
    00403     /// \param dimtype
    00404     /// Input dimensionality of the ordinates (see FdoDimensionality)
    00405     /// \param numOrdinates
    00406     /// Input total number of ordinates in the array
    00407     /// \param ordinates
    00408     /// Input ordinate array representing positions
    00409     ///
    00410     /// \return
    00411     /// Returns a LineStringSegment
    00412     ///
    00413     FDO_GEOM_API virtual FdoILineStringSegment* CreateLineStringSegment(
    00414         FdoInt32 dimtype,
    00415         FdoInt32 numOrdinates,
    00416         double* ordinates) = 0;
    00417
    00418     /// Polygon
    00419
    00420     /// \brief
    00421     ///  Creates a polygon object by copying from given LinearRing objects.
    00422     ///
    00423     /// \param exteriorRing
    00424     /// Input exterior ring to copy
    00425     /// \param interiorRings
    00426     /// Input collection of interior rings to copy
    00427     ///
    00428     /// \return
    00429     /// Returns a polygon
    00430     ///
    00431     FDO_GEOM_API virtual FdoIPolygon* CreatePolygon(
    00432         FdoILinearRing* exteriorRing,
    00433         FdoLinearRingCollection* interiorRings) = 0;
    00434
    00435     /// MultiPoint
    00436
    00437     /// \brief
    00438     ///  Creates a MultiPoint object by copying from a collection of point objects.
    00439     ///
    00440     /// \param points
    00441     /// Input collection of point objects to copy
    00442     ///
    00443     /// \return
    00444     /// Returns a MultiPoint
    00445     ///
    00446     FDO_GEOM_API virtual FdoIMultiPoint* CreateMultiPoint(
    00447         FdoPointCollection* points) = 0;
    00448
    00449     /// \brief
    00450     ///  Creates a MultiPoint object by copying from an array of ordinates.
    00451     ///
    00452     /// \param dimensionality
    00453     /// Input dimensionality of the ordinates (see FdoDimensionality)
    00454     /// \param numOrdinates
    00455     /// Input total number of ordinates in the array
    00456     /// \param ordinates
    00457     /// Input ordinate array representing positions
    00458     ///
    00459     /// \return
    00460     /// Returns a MultiPoint
    00461     ///
    00462     FDO_GEOM_API virtual FdoIMultiPoint* CreateMultiPoint(
    00463         FdoInt32 dimensionality,
    00464         FdoInt32 numOrdinates,
    00465         double* ordinates) = 0;
    00466
    00467     /// MultiLineString
    00468
    00469     /// \brief
    00470     ///  Creates a MultiLineString object by copying from a collection of LineString objects.
    00471     ///
    00472     /// \param lineStrings
    00473     /// Input collection of LineString objects to copy
    00474     ///
    00475     /// \return
    00476     /// Returns a MultiLineString
    00477     ///
    00478     FDO_GEOM_API virtual FdoIMultiLineString* CreateMultiLineString(
    00479         FdoLineStringCollection* lineStrings) = 0;
    00480
    00481     //MultiPolygon
    00482
    00483     /// \brief
    00484     ///  Creates a MultiPolygon object by copying from a collection of polygon objects.
    00485     ///
    00486     /// \param polygons
    00487     /// Input collection of polygon objects to copy
    00488     ///
    00489     /// \return
    00490     /// Returns a MultiPolygon
    00491     ///
    00492     FDO_GEOM_API virtual FdoIMultiPolygon* CreateMultiPolygon(
    00493         FdoPolygonCollection* polygons) = 0;
    00494
    00495     /// CircularArcSegment
    00496
    00497     /// \brief
    00498     ///  Creates a CircularArcSegment object by copying from three points on the arc.
    00499     ///
    00500     /// \param startPosition
    00501     /// Input starting position of the arc
    00502     /// \param midPosition
    00503     /// Input a position on the arc, and not equal to the starting or ending positions
    00504     /// \param endPosition
    00505     /// Input ending position of the arc
    00506     ///
    00507     /// \return
    00508     /// Returns a CircularArcSegment
    00509     ///
    00510     FDO_GEOM_API virtual FdoICircularArcSegment* CreateCircularArcSegment(
    00511         FdoIDirectPosition* startPosition,
    00512         FdoIDirectPosition* midPosition,
    00513         FdoIDirectPosition* endPosition) = 0;
    00514
    00515     /// CurveString
    00516
    00517     /// \brief
    00518     ///  Creates a CurveString object by copying from a collection of CurveSegment objects.
    00519     ///
    00520     /// \param curveSegments
    00521     /// Input collection of CurveSegment objects to copy
    00522     ///
    00523     /// \return
    00524     /// Returns a CurveString
    00525     ///
    00526     FDO_GEOM_API virtual FdoICurveString* CreateCurveString(
    00527         FdoCurveSegmentCollection* curveSegments) = 0;
    00528
    00529     /// MultiCurveString
    00530
    00531     /// \brief
    00532     ///  Creates an MultiCurveString object by copying from a collection of CurveString objects.
    00533     ///
    00534     /// \param curveStrings
    00535     /// Input collection of CurveString objects to copy
    00536     ///
    00537     /// \return
    00538     /// Returns a MultiCurveString
    00539     ///
    00540     FDO_GEOM_API virtual FdoIMultiCurveString* CreateMultiCurveString(
    00541         FdoCurveStringCollection* curveStrings) = 0;
    00542
    00543     /// Ring
    00544
    00545     /// \brief
    00546     ///  Creates a ring object by copying from a collection of CurveSegment objects.
    00547     ///
    00548     /// \param curveSegments
    00549     /// Input collection of CurveSegment objects to copy
    00550     ///
    00551     /// \return
    00552     /// Returns a ring
    00553     ///
    00554     FDO_GEOM_API virtual FdoIRing* CreateRing(
    00555         FdoCurveSegmentCollection* curveSegments) = 0;
    00556
    00557     /// CurvePolygon
    00558
    00559     /// \brief
    00560     ///  Creates a CurvePolygon object by copying from given ring objects.
    00561     ///
    00562     /// \param exteriorRing
    00563     /// Input exterior ring to copy
    00564     /// \param interiorRings
    00565     /// Input collection of interior rings to copy
    00566     ///
    00567     /// \return
    00568     /// Returns a CurvePolygon
    00569     ///
    00570     FDO_GEOM_API virtual FdoICurvePolygon* CreateCurvePolygon(
    00571         FdoIRing* exteriorRing,
    00572         FdoRingCollection* interiorRings) = 0;
    00573
    00574     /// MultiCurvePolygon
    00575
    00576     /// \brief
    00577     ///  Creates a MultiCurvePolygon object by copying from a collection of CurvePolygon objects.
    00578     ///
    00579     /// \param curvePolygons
    00580     /// Input collection of CurvePolygon objects to copy
    00581     ///
    00582     /// \return
    00583     /// Returns a MultiCurvePolygon
    00584     ///
    00585     FDO_GEOM_API virtual FdoIMultiCurvePolygon* CreateMultiCurvePolygon(
    00586         FdoCurvePolygonCollection* curvePolygons) = 0;
    00587
    00588     /// MultiGeometry
    00589
    00590     /// \brief
    00591     ///  Creates a MultiGeometry object by copying from a collection of Geometry objects.
    00592     ///
    00593     /// \param geometries
    00594     /// Input collection of Geometry objects to copy
    00595     ///
    00596     /// \return
    00597     /// Returns a MultiGeometry
    00598     ///
    00599     FDO_GEOM_API virtual FdoIMultiGeometry* CreateMultiGeometry(
    00600         FdoGeometryCollection* geometries) = 0;
    00601
    00602 protected:
    00603
    00604     /// \brief
    00605     /// Constructs a default instance of a FdoGeometryFactoryAbstract.
    00606     ///
    00607     /// \return
    00608     /// Returns nothing
    00609     ///
    00610     FDO_GEOM_API FdoGeometryFactoryAbstract() {};
    00611
    00612     /// \brief
    00613     /// Default destructor.
    00614     ///
    00615     /// \return
    00616     /// Returns nothing
    00617     ///
    00618     FDO_GEOM_API virtual ~FdoGeometryFactoryAbstract() {};
    00619 };
    00620 #endif
    00621
    00622

Please send us your comment about this page