GEOS: OffsetCurveSetBuilder.h Source File

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

- File List

# OffsetCurveSetBuilder.h

    00001 /**********************************************************************
    00002  * $Id: OffsetCurveSetBuilder.h 3306 2011-04-27 14:13:45Z strk $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
    00008  * Copyright (C) 2006 Refractions Research Inc.
    00009  *
    00010  * This is free software; you can redistribute and/or modify it under
    00011  * the terms of the GNU Lesser General Public Licence as published
    00012  * by the Free Software Foundation.
    00013  * See the COPYING file for more information.
    00014  *
    00015  **********************************************************************
    00016  *
    00017  * Last port: operation/buffer/OffsetCurveSetBuilder.java r378 (JTS-1.12)
    00018  *
    00019  **********************************************************************/
    00020
    00021 #ifndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
    00022 #define GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
    00023
    00024 #include <geos/export.h>
    00025
    00026 #include <vector>
    00027
    00028 #ifdef _MSC_VER
    00029 #pragma warning(push)
    00030 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
    00031 #endif
    00032
    00033 // Forward declarations
    00034 namespace geos {
    00035         namespace geom {
    00036                 class Geometry;
    00037                 class CoordinateSequence;
    00038                 class GeometryCollection;
    00039                 class Point;
    00040                 class LineString;
    00041                 class LinearRing;
    00042                 class Polygon;
    00043         }
    00044         namespace geomgraph {
    00045                 class Label;
    00046         }
    00047         namespace noding {
    00048                 class SegmentString;
    00049         }
    00050         namespace operation {
    00051                 namespace buffer {
    00052                         class OffsetCurveBuilder;
    00053                 }
    00054         }
    00055 }
    00056
    00057 namespace geos {
    00058 namespace operation { // geos.operation
    00059 namespace buffer { // geos.operation.buffer
    00060
    00071 class GEOS_DLL OffsetCurveSetBuilder {
    00072
    00073 private:
    00074
    00075         // To keep track of newly-created Labels.
    00076         // Labels will be relesed by object dtor
    00077         std::vector<geomgraph::Label*> newLabels;
    00078
    00079         const geom::Geometry& inputGeom;
    00080
    00081         double distance;
    00082
    00083         OffsetCurveBuilder& curveBuilder;
    00084
    00088         std::vector<noding::SegmentString*> curveList;
    00089
    00102         void addCurve(geom::CoordinateSequence *coord, int leftLoc,
    00103                         int rightLoc);
    00104
    00105         void add(const geom::Geometry& g);
    00106
    00107         void addCollection(const geom::GeometryCollection *gc);
    00108
    00112         void addPoint(const geom::Point *p);
    00113
    00114         void addLineString(const geom::LineString *line);
    00115
    00116         void addPolygon(const geom::Polygon *p);
    00117
    00136         void addPolygonRing(const geom::CoordinateSequence *coord,
    00137                         double offsetDistance, int side, int cwLeftLoc,
    00138                         int cwRightLoc);
    00139
    00149         bool isErodedCompletely(const geom::LinearRing* ringCoord,
    00150       double bufferDistance);
    00151
    00170         bool isTriangleErodedCompletely(const geom::CoordinateSequence *triCoords,
    00171                         double bufferDistance);
    00172
    00173     // Declare type as noncopyable
    00174     OffsetCurveSetBuilder(const OffsetCurveSetBuilder& other);
    00175     OffsetCurveSetBuilder& operator=(const OffsetCurveSetBuilder& rhs);
    00176
    00177 public:
    00178
    00180         OffsetCurveSetBuilder(const geom::Geometry& newInputGeom,
    00181                 double newDistance, OffsetCurveBuilder& newCurveBuilder);
    00182
    00184         ~OffsetCurveSetBuilder();
    00185
    00195         std::vector<noding::SegmentString*>& getCurves();
    00196
    00198         //
    00202         void addCurves(const std::vector<geom::CoordinateSequence*>& lineList,
    00203                 int leftLoc, int rightLoc);
    00204
    00205 };
    00206
    00207 } // namespace geos::operation::buffer
    00208 } // namespace geos::operation
    00209 } // namespace geos
    00210
    00211 #ifdef _MSC_VER
    00212 #pragma warning(pop)
    00213 #endif
    00214
    00215 #endif // ndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
    00216
    00217 /**********************************************************************
    00218  * $Log$
    00219  * Revision 1.2  2006/05/04 10:15:20  strk
    00220  * Doxygen comments
    00221  *
    00222  * Revision 1.1  2006/03/14 00:19:40  strk
    00223  * opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/
    00224  *
    00225  **********************************************************************/
    00226