GEOS: EdgeIntersection.h Source File

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

# EdgeIntersection.h

    00001 /**********************************************************************
    00002  * $Id: EdgeIntersection.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
    00018 #ifndef GEOS_GEOMGRAPH_EDGEINTERSECTION_H
    00019 #define GEOS_GEOMGRAPH_EDGEINTERSECTION_H
    00020
    00021 #include <string>
    00022
    00023 #include <geos/geom/Coordinate.h> // for CoordinateLessThen
    00024
    00025 #include <geos/inline.h>
    00026
    00027
    00028 namespace geos {
    00029 namespace geomgraph { // geos.geomgraph
    00030
    00031 class EdgeIntersection {
    00032 public:
    00033         geom::Coordinate coord;
    00034         int segmentIndex;
    00035         double dist;
    00036         EdgeIntersection(const geom::Coordinate& newCoord, int newSegmentIndex, double newDist);
    00037         virtual ~EdgeIntersection();
    00038         int compare(int newSegmentIndex, double newDist) const;
    00039         bool isEndPoint(int maxSegmentIndex);
    00040         std::string print() const;
    00041         int compareTo(const EdgeIntersection *) const;
    00042 };
    00043
    00044 struct EdgeIntersectionLessThen {
    00045         bool operator()(const EdgeIntersection *ei1,
    00046                 const EdgeIntersection *ei2) const
    00047         {
    00048                 if ( ei1->segmentIndex<ei2->segmentIndex ||
    00049                         ( ei1->segmentIndex==ei2->segmentIndex &&
    00050                         ei1->dist<ei2->dist ) ) return true;
    00051                 return false;
    00052         }
    00053 };
    00054
    00055
    00056 } // namespace geos.geomgraph
    00057 } // namespace geos
    00058
    00059 //#ifdef GEOS_INLINE
    00060 //# include "geos/geomgraph/EdgeIntersection.inl"
    00061 //#endif
    00062
    00063 #endif // ifndef GEOS_GEOMGRAPH_EDGEINTERSECTION_H
    00064
    00065 /**********************************************************************
    00066  * $Log$
    00067  * Revision 1.2  2006/03/24 09:52:41  strk
    00068  * USE_INLINE => GEOS_INLINE
    00069  *
    00070  * Revision 1.1  2006/03/09 16:46:49  strk
    00071  * geos::geom namespace definition, first pass at headers split
    00072  *
    00073  **********************************************************************/
    00074