00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_GEOM_GEOMETRYFACTORY_H
00021 #define GEOS_GEOM_GEOMETRYFACTORY_H
00022
00023
00024
00025 #include <geos/export.h>
00026 #include <geos/inline.h>
00027
00028 #include <vector>
00029 #include <memory>
00030
00031 namespace geos {
00032 namespace geom {
00033 class CoordinateSequenceFactory;
00034 class Coordinate;
00035 class CoordinateSequence;
00036 class Envelope;
00037 class Geometry;
00038 class GeometryCollection;
00039 class LineString;
00040 class LinearRing;
00041 class MultiLineString;
00042 class MultiPoint;
00043 class MultiPolygon;
00044 class Point;
00045 class Polygon;
00046 class PrecisionModel;
00047 }
00048 }
00049
00050 namespace geos {
00051 namespace geom {
00052
00063 class GEOS_DLL GeometryFactory {
00064 public:
00070 GeometryFactory();
00071
00084 GeometryFactory(const PrecisionModel *pm, int newSRID,
00085 CoordinateSequenceFactory *nCoordinateSequenceFactory);
00086
00093 GeometryFactory(CoordinateSequenceFactory *nCoordinateSequenceFactory);
00094
00103 GeometryFactory(const PrecisionModel *pm);
00104
00114 GeometryFactory(const PrecisionModel* pm, int newSRID);
00115
00121 GeometryFactory(const GeometryFactory &gf);
00122
00129 static const GeometryFactory*
00130 getDefaultInstance();
00131
00133 virtual ~GeometryFactory();
00134
00135
00136
00137 Point* createPointFromInternalCoord(const Coordinate* coord,
00138 const Geometry *exemplar) const;
00139
00141
00144 Geometry* toGeometry(const Envelope* envelope) const;
00145
00149 const PrecisionModel* getPrecisionModel() const;
00150
00152 Point* createPoint() const;
00153
00155 Point* createPoint(const Coordinate& coordinate) const;
00156
00158 Point* createPoint(CoordinateSequence *coordinates) const;
00159
00161 Point* createPoint(const CoordinateSequence &coordinates) const;
00162
00164 GeometryCollection* createGeometryCollection() const;
00165
00167 Geometry* createEmptyGeometry() const;
00168
00170 GeometryCollection* createGeometryCollection(
00171 std::vector<Geometry *> *newGeoms) const;
00172
00174 GeometryCollection* createGeometryCollection(
00175 const std::vector<Geometry *> &newGeoms) const;
00176
00178 MultiLineString* createMultiLineString() const;
00179
00181 MultiLineString* createMultiLineString(
00182 std::vector<Geometry *> *newLines) const;
00183
00185 MultiLineString* createMultiLineString(
00186 const std::vector<Geometry *> &fromLines) const;
00187
00189 MultiPolygon* createMultiPolygon() const;
00190
00192 MultiPolygon* createMultiPolygon(std::vector<Geometry *> *newPolys) const;
00193
00195 MultiPolygon* createMultiPolygon(
00196 const std::vector<Geometry *> &fromPolys) const;
00197
00199 LinearRing* createLinearRing() const;
00200
00202 LinearRing* createLinearRing(CoordinateSequence* newCoords) const;
00203
00204 std::auto_ptr<Geometry> createLinearRing(
00205 std::auto_ptr<CoordinateSequence> newCoords) const;
00206
00208 LinearRing* createLinearRing(
00209 const CoordinateSequence& coordinates) const;
00210
00212 MultiPoint* createMultiPoint() const;
00213
00215 MultiPoint* createMultiPoint(std::vector<Geometry *> *newPoints) const;
00216
00218 MultiPoint* createMultiPoint(
00219 const std::vector<Geometry *> &fromPoints) const;
00220
00224 MultiPoint* createMultiPoint(
00225 const CoordinateSequence &fromCoords) const;
00226
00228 Polygon* createPolygon() const;
00229
00231 Polygon* createPolygon(LinearRing *shell,
00232 std::vector<Geometry *> *holes) const;
00233
00235 Polygon* createPolygon(const LinearRing &shell,
00236 const std::vector<Geometry *> &holes) const;
00237
00239 LineString* createLineString() const;
00240
00242 std::auto_ptr<LineString> createLineString(const LineString& ls) const;
00243
00245 LineString* createLineString(CoordinateSequence* coordinates) const;
00246
00247 std::auto_ptr<Geometry> createLineString(
00248 std::auto_ptr<CoordinateSequence> coordinates) const;
00249
00251 LineString* createLineString(
00252 const CoordinateSequence& coordinates) const;
00253
00285 Geometry* buildGeometry(std::vector<Geometry *> *geoms) const;
00286
00294 Geometry* buildGeometry(const std::vector<Geometry *> &geoms) const;
00295
00296 int getSRID() const;
00297
00301 const CoordinateSequenceFactory* getCoordinateSequenceFactory() const;
00302
00304 Geometry* createGeometry(const Geometry *g) const;
00305
00307 void destroyGeometry(Geometry *g) const;
00308
00309 private:
00310 const PrecisionModel* precisionModel;
00311 int SRID;
00312 const CoordinateSequenceFactory *coordinateListFactory;
00313 };
00314
00315 }
00316 }
00317
00318 #ifdef GEOS_INLINE
00319 # include "geos/geom/GeometryFactory.inl"
00320 #endif
00321
00322 #endif // ndef GEOS_GEOM_GEOMETRYFACTORY_H
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374