GEOS: OffsetCurveSetBuilder.h Source File

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

# OffsetCurveSetBuilder.h

    00001 /**********************************************************************
    00002  * $Id: OffsetCurveSetBuilder.h 1820 2006-09-06 16:54:23Z 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 #ifndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
    00017 #define GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
    00018
    00019 #include <vector>
    00020
    00021 // Forward declarations
    00022 namespace geos {
    00023         namespace geom {
    00024                 class Geometry;
    00025                 class CoordinateSequence;
    00026                 class GeometryCollection;
    00027                 class Point;
    00028                 class LineString;
    00029                 class Polygon;
    00030         }
    00031         namespace geomgraph {
    00032                 class Label;
    00033         }
    00034         namespace noding {
    00035                 class SegmentString;
    00036         }
    00037         namespace operation {
    00038                 namespace buffer {
    00039                         class OffsetCurveBuilder;
    00040                 }
    00041         }
    00042 }
    00043
    00044 namespace geos {
    00045 namespace operation { // geos.operation
    00046 namespace buffer { // geos.operation.buffer
    00047
    00060 class OffsetCurveSetBuilder {
    00061
    00062 private:
    00063
    00064         // To keep track of newly-created Labels.
    00065         // Labels will be relesed by object dtor
    00066         std::vector<geomgraph::Label*> newLabels;
    00067
    00068         const geom::Geometry& inputGeom;
    00069
    00070         double distance;
    00071
    00072         OffsetCurveBuilder& curveBuilder;
    00073
    00077         std::vector<noding::SegmentString*> curveList;
    00078
    00089         void addCurve(geom::CoordinateSequence *coord, int leftLoc,
    00090                         int rightLoc);
    00091
    00092         void add(const geom::Geometry& g);
    00093
    00094         void addCollection(const geom::GeometryCollection *gc);
    00095
    00099         void addPoint(const geom::Point *p);
    00100
    00101         void addLineString(const geom::LineString *line);
    00102
    00103         void addPolygon(const geom::Polygon *p);
    00104
    00123         void addPolygonRing(const geom::CoordinateSequence *coord,
    00124                         double offsetDistance, int side, int cwLeftLoc,
    00125                         int cwRightLoc);
    00126
    00136         bool isErodedCompletely(geom::CoordinateSequence *ringCoord,
    00137                         double bufferDistance);
    00138
    00157         bool isTriangleErodedCompletely(geom::CoordinateSequence *triangleCoord,
    00158                         double bufferDistance);
    00159
    00160 public:
    00161
    00163         OffsetCurveSetBuilder(const geom::Geometry& newInputGeom,
    00164                 double newDistance, OffsetCurveBuilder& newCurveBuilder);
    00165
    00167         ~OffsetCurveSetBuilder();
    00168
    00178         std::vector<noding::SegmentString*>& getCurves();
    00179
    00181         void addCurves(const std::vector<geom::CoordinateSequence*>& lineList,
    00182                 int leftLoc, int rightLoc);
    00183
    00184 };
    00185
    00186
    00187
    00188 } // namespace geos::operation::buffer
    00189 } // namespace geos::operation
    00190 } // namespace geos
    00191
    00192 #endif // ndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
    00193
    00194 /**********************************************************************
    00195  * $Log$
    00196  * Revision 1.2  2006/05/04 10:15:20  strk
    00197  * Doxygen comments
    00198  *
    00199  * Revision 1.1  2006/03/14 00:19:40  strk
    00200  * opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/
    00201  *
    00202  **********************************************************************/
    00203