Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

IsSimpleOp.h

00001 /**********************************************************************
00002  * $Id: IsSimpleOp.h 2556 2009-06-06 22:22:28Z strk $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2009      Sandro Santilli <strk@keybit.net>
00008  * Copyright (C) 2005-2006 Refractions Research Inc.
00009  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00010  *
00011  * This is free software; you can redistribute and/or modify it under
00012  * the terms of the GNU Lesser General Public Licence as published
00013  * by the Free Software Foundation. 
00014  * See the COPYING file for more information.
00015  *
00016  **********************************************************************
00017  *
00018  * Last port: operation/IsSimpleOp.java rev. 1.22 (JTS-1.10)
00019  *
00020  **********************************************************************/
00021 
00022 #ifndef GEOS_OPERATION_ISSIMPLEOP_H
00023 #define GEOS_OPERATION_ISSIMPLEOP_H
00024 
00025 
00026 #include <geos/export.h>
00027 #include <geos/geom/Coordinate.h> // for dtor visibility by auto_ptr (compos)
00028 
00029 #include <map>
00030 #include <memory> // for auto_ptr
00031 
00032 // Forward declarations
00033 namespace geos {
00034         namespace algorithm {
00035                 class BoundaryNodeRule;
00036         }
00037         namespace geom {
00038                 class LineString;
00039                 class MultiLineString;
00040                 class MultiPoint;
00041                 class Geometry;
00042                 struct CoordinateLessThen;
00043         }
00044         namespace geomgraph {
00045                 class GeometryGraph;
00046         }
00047         namespace operation {
00048                 class EndpointInfo;
00049         }
00050 }
00051 
00052 
00053 namespace geos {
00054 namespace operation { // geos.operation
00055 
00090 class GEOS_DLL IsSimpleOp
00091 {
00092 
00093 public:
00094 
00101         IsSimpleOp();
00102 
00110         IsSimpleOp(const geom::Geometry& geom);
00111 
00119         IsSimpleOp(const geom::Geometry& geom,
00120                    const algorithm::BoundaryNodeRule& boundaryNodeRule);
00121 
00127         bool isSimple();
00128 
00139         const geom::Coordinate* getNonSimpleLocation() const
00140         {
00141                 return nonSimpleLocation.get();
00142         }
00143 
00152         bool isSimple(const geom::LineString *geom);
00153 
00162         bool isSimple(const geom::MultiLineString *geom);
00163 
00169         bool isSimple(const geom::MultiPoint *mp);
00170 
00171         bool isSimpleLinearGeometry(const geom::Geometry *geom);
00172 
00173 private:
00174 
00181         bool hasNonEndpointIntersection(geomgraph::GeometryGraph &graph);
00182 
00191         bool hasClosedEndpointIntersection(geomgraph::GeometryGraph &graph);
00192 
00196         void addEndpoint(std::map<const geom::Coordinate*, EndpointInfo*,
00197                         geom::CoordinateLessThen>&endPoints,
00198                         const geom::Coordinate *p, bool isClosed);
00199 
00200         bool isClosedEndpointsInInterior; 
00201 
00202         bool isSimpleMultiPoint(const geom::MultiPoint& mp);
00203 
00204         const geom::Geometry* geom;
00205 
00206         std::auto_ptr<geom::Coordinate> nonSimpleLocation;
00207 };
00208 
00209 } // namespace geos.operation
00210 } // namespace geos
00211 
00212 #endif
00213 
00214 /**********************************************************************
00215  * $Log$
00216  * Revision 1.2  2006/03/15 18:59:33  strk
00217  * Bug #62: 'struct' CoordinateLessThen in forward declaration
00218  *
00219  * Revision 1.1  2006/03/09 16:46:49  strk
00220  * geos::geom namespace definition, first pass at headers split
00221  *
00222  **********************************************************************/
00223 

Generated on Thu Jun 11 06:17:01 2009 for GEOS by  doxygen 1.4.4