GEOS: OffsetPointGenerator.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# OffsetPointGenerator.h

    00001 /**********************************************************************
    00002  * $Id: OffsetPointGenerator.h 2780 2009-12-03 19:46:43Z mloskot $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2006 Refractions Research Inc.
    00008  *
    00009  * This is free software; you can redistribute and/or modify it under
    00010  * the terms of the GNU Lesser General Public Licence as published
    00011  * by the Free Software Foundation.
    00012  * See the COPYING file for more information.
    00013  *
    00014  ***********************************************************************
    00015  *
    00016  * Last port: operation/overlay/validate/OffsetPointGenerator.java rev. 1.1 (JTS-1.10)
    00017  *
    00018  **********************************************************************/
    00019
    00020 #ifndef GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
    00021 #define GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
    00022
    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 // Forward declarations
    00032 namespace geos {
    00033         namespace geom {
    00034                 //class Geometry;
    00035                 //class MultiPoint;
    00036                 class LineString;
    00037                 //class Coordinate;
    00038         }
    00039 }
    00040
    00041 namespace geos {
    00042 namespace operation { // geos::operation
    00043 namespace overlay { // geos::operation::overlay
    00044 namespace validate { // geos::operation::overlay::validate
    00045
    00047 //
    00048 class OffsetPointGenerator {
    00049
    00050 public:
    00051
    00052         OffsetPointGenerator(const geom::Geometry& geom, double offset);
    00053
    00055         std::auto_ptr< std::vector<geom::Coordinate> > getPoints();
    00056
    00057 private:
    00058
    00059         const geom::Geometry& g;
    00060
    00061         double offsetDistance;
    00062
    00063         std::auto_ptr< std::vector<geom::Coordinate> > offsetPts;
    00064
    00065         void extractPoints(const geom::LineString* line);
    00066
    00067         void computeOffsets(const geom::Coordinate& p0,
    00068                         const geom::Coordinate& p1);
    00069
    00070     // Declare type as noncopyable
    00071     OffsetPointGenerator(const OffsetPointGenerator& other);
    00072     OffsetPointGenerator& operator=(const OffsetPointGenerator& rhs);
    00073 };
    00074
    00075 } // namespace geos::operation::overlay::validate
    00076 } // namespace geos::operation::overlay
    00077 } // namespace geos::operation
    00078 } // namespace geos
    00079
    00080 #endif // ndef GEOS_OP_OVERLAY_OFFSETPOINTGENERATOR_H
    00081
    00082 /**********************************************************************
    00083  * $Log$
    00084  **********************************************************************/
    00085