# IsSimpleOp.h

    00001 /**********************************************************************
    00002  * $Id: IsSimpleOp.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) 2005-2006 Refractions Research Inc.
    00008  * Copyright (C) 2001-2002 Vivid Solutions 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 #ifndef GEOS_OPERATION_ISSIMPLEOP_H
    00018 #define GEOS_OPERATION_ISSIMPLEOP_H
    00019
    00020 #include <map>
    00021
    00022 // Forward declarations
    00023 namespace geos {
    00024         namespace geom {
    00025                 class LineString;
    00026                 class MultiLineString;
    00027                 class MultiPoint;
    00028                 class Geometry;
    00029                 class Coordinate;
    00030                 struct CoordinateLessThen;
    00031         }
    00032         namespace geomgraph {
    00033                 class GeometryGraph;
    00034         }
    00035         namespace operation {
    00036                 class EndpointInfo;
    00037         }
    00038 }
    00039
    00040
    00041 namespace geos {
    00042 namespace operation { // geos.operation
    00043
    00053 class IsSimpleOp {
    00054 public:
    00055         IsSimpleOp();
    00056         bool isSimple(const geom::LineString *geom);
    00057         bool isSimple(const geom::MultiLineString *geom);
    00058         bool isSimple(const geom::MultiPoint *mp);
    00059         bool isSimpleLinearGeometry(const geom::Geometry *geom);
    00060 private:
    00061         bool hasNonEndpointIntersection(geomgraph::GeometryGraph &graph);
    00062         bool hasClosedEndpointIntersection(geomgraph::GeometryGraph &graph);
    00063         void addEndpoint(std::map<const geom::Coordinate*, EndpointInfo*,
    00064                         geom::CoordinateLessThen>&endPoints,
    00065                         const geom::Coordinate *p, bool isClosed);
    00066 };
    00067
    00068 } // namespace geos.operation
    00069 } // namespace geos
    00070
    00071 #endif
    00072
    00073 /**********************************************************************
    00074  * $Log$
    00075  * Revision 1.2  2006/03/15 18:59:33  strk
    00076  * Bug #62: 'struct' CoordinateLessThen in forward declaration
    00077  *
    00078  * Revision 1.1  2006/03/09 16:46:49  strk
    00079  * geos::geom namespace definition, first pass at headers split
    00080  *
    00081  **********************************************************************/
    00082