• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

SegmentIntersector.h

00001 /**********************************************************************
00002  * $Id: SegmentIntersector.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) 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_GEOMGRAPH_INDEX_SEGMENTINTERSECTOR_H
00018 #define GEOS_GEOMGRAPH_INDEX_SEGMENTINTERSECTOR_H
00019 
00020 
00021 #include <geos/export.h>
00022 #include <vector>
00023 
00024 #include <geos/geom/Coordinate.h> // for composition
00025 
00026 // Forward declarations
00027 namespace geos {
00028         namespace algorithm {
00029                 class LineIntersector;
00030         }
00031         namespace geomgraph {
00032                 class Node;
00033                 class Edge;
00034         }
00035 }
00036 
00037 namespace geos {
00038 namespace geomgraph { // geos::geomgraph
00039 namespace index { // geos::geomgraph::index
00040 
00041 
00042 class GEOS_DLL SegmentIntersector{
00043 
00044 private:
00045 
00050         bool hasIntersectionVar;
00051 
00052         bool hasProper;
00053 
00054         bool hasProperInterior;
00055 
00056         // the proper intersection point found
00057         geom::Coordinate properIntersectionPoint;
00058 
00059         algorithm::LineIntersector *li;
00060 
00061         bool includeProper;
00062 
00063         bool recordIsolated;
00064 
00065         //bool isSelfIntersection;
00066 
00067         //bool intersectionFound;
00068 
00069         int numIntersections;
00070 
00072         std::vector<std::vector<Node*>*> bdyNodes;
00073 
00074         bool isTrivialIntersection(Edge *e0,int segIndex0,Edge *e1, int segIndex1);
00075 
00076         bool isBoundaryPoint(algorithm::LineIntersector *li,
00077                         std::vector<std::vector<Node*>*>& tstBdyNodes);
00078 
00079         bool isBoundaryPoint(algorithm::LineIntersector *li,
00080                         std::vector<Node*> *tstBdyNodes);
00081 
00082 public:
00083 
00084         static bool isAdjacentSegments(int i1,int i2);
00085 
00086         // testing only
00087         int numTests;
00088 
00089         //SegmentIntersector();
00090 
00091         virtual ~SegmentIntersector() {}
00092 
00093         SegmentIntersector(algorithm::LineIntersector *newLi,
00094                         bool newIncludeProper, bool newRecordIsolated)
00095                 :
00096                 hasIntersectionVar(false),
00097                 hasProper(false),
00098                 hasProperInterior(false),
00099                 li(newLi),
00100                 includeProper(newIncludeProper),
00101                 recordIsolated(newRecordIsolated),
00102                 numIntersections(0),
00103                 bdyNodes(2),
00104                 numTests(0)
00105         {}
00106 
00110         void setBoundaryNodes(std::vector<Node*> *bdyNodes0,
00111                         std::vector<Node*> *bdyNodes1);
00112 
00113         geom::Coordinate& getProperIntersectionPoint();
00114 
00115         bool hasIntersection();
00116 
00117         bool hasProperIntersection();
00118 
00119         bool hasProperInteriorIntersection();
00120 
00121         void addIntersections(Edge *e0, int segIndex0, Edge *e1, int segIndex1);
00122 
00123 };
00124 
00125 
00126 } // namespace geos.geomgraph.index
00127 } // namespace geos.geomgraph
00128 } // namespace geos
00129 
00130 #endif
00131 
00132 /**********************************************************************
00133  * $Log$
00134  * Revision 1.1  2006/03/14 12:55:55  strk
00135  * Headers split: geomgraphindex.h, nodingSnapround.h
00136  *
00137  **********************************************************************/
00138 

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1