OffsetPointGenerator.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2006 Refractions Research Inc.
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Public Licence as published
00010  * by the Free Software Foundation. 
00011  * See the COPYING file for more information.
00012  *
00013  ***********************************************************************
00014  *
00015  * Last port: operation/overlay/validate/OffsetPointGenerator.java rev. 1.1 (JTS-1.10)
00016  *
00017  **********************************************************************/
00018 
00019 #ifndef GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
00020 #define GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
00021 
00022 #include <geos/export.h>
00023 #include <geos/algorithm/PointLocator.h> // for composition
00024 #include <geos/geom/Geometry.h> // for auto_ptr visibility of dtor
00025 #include <geos/geom/MultiPoint.h> // for auto_ptr visibility of dtor
00026 #include <geos/geom/Coordinate.h> // for use in vector
00027 
00028 #include <vector>
00029 #include <memory> // for auto_ptr
00030 
00031 #ifdef _MSC_VER
00032 #pragma warning(push)
00033 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00034 #endif
00035 
00036 // Forward declarations
00037 namespace geos {
00038         namespace geom {
00039                 //class Geometry;
00040                 //class MultiPoint;
00041                 class LineString;
00042                 //class Coordinate;
00043         }
00044 }
00045 
00046 namespace geos {
00047 namespace operation { // geos::operation
00048 namespace overlay { // geos::operation::overlay
00049 namespace validate { // geos::operation::overlay::validate
00050 
00052 //
00053 class GEOS_DLL OffsetPointGenerator {
00054 
00055 public:
00056 
00057         OffsetPointGenerator(const geom::Geometry& geom, double offset);
00058 
00060         std::auto_ptr< std::vector<geom::Coordinate> > getPoints();
00061 
00062 private:
00063 
00064         const geom::Geometry& g;
00065 
00066         double offsetDistance;
00067 
00068         std::auto_ptr< std::vector<geom::Coordinate> > offsetPts;
00069 
00070         void extractPoints(const geom::LineString* line);
00071 
00072         void computeOffsets(const geom::Coordinate& p0,
00073                         const geom::Coordinate& p1);
00074 
00075     // Declare type as noncopyable
00076     OffsetPointGenerator(const OffsetPointGenerator& other);
00077     OffsetPointGenerator& operator=(const OffsetPointGenerator& rhs);
00078 };
00079 
00080 } // namespace geos::operation::overlay::validate
00081 } // namespace geos::operation::overlay
00082 } // namespace geos::operation
00083 } // namespace geos
00084 
00085 #ifdef _MSC_VER
00086 #pragma warning(pop)
00087 #endif
00088 
00089 #endif // ndef GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H

Generated on 15 May 2014 for GEOS by  doxygen 1.4.7