GEOS: nodingSnapround.h Source File

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

# nodingSnapround.h

    00001 /**********************************************************************
    00002  * $Id: nodingSnapround.h,v 1.2 2004/07/19 13:19:31 strk Exp $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
    00008  *
    00009  * This is free software; you can redistribute and/or modify it under
    00010  * the terms of the GNU Lesser General Public Licence as published
    00011  * by the Free Software Foundation.
    00012  * See the COPYING file for more information.
    00013  *
    00014  **********************************************************************
    00015  * $Log: nodingSnapround.h,v $
    00016  * Revision 1.2  2004/07/19 13:19:31  strk
    00017  * Documentation fixes
    00018  *
    00019  * Revision 1.1  2004/07/02 13:20:42  strk
    00020  * Header files moved under geos/ dir.
    00021  *
    00022  * Revision 1.1  2004/03/29 06:59:24  ybychkov
    00023  * "noding/snapround" package ported (JTS 1.4);
    00024  * "operation", "operation/valid", "operation/relate" and "operation/overlay" upgraded to JTS 1.4;
    00025  * "geom" partially upgraded.
    00026  *
    00027  *
    00028  **********************************************************************/
    00029
    00030
    00031 #ifndef GEOS_NODING_SNAPROUND_H
    00032 #define GEOS_NODING_SNAPROUND_H
    00033
    00034 #include <geos/platform.h>
    00035 #include <geos/noding.h>
    00036 #include <geos/geom.h>
    00037 #include <vector>
    00038
    00039 using namespace std;
    00040
    00041 namespace geos {
    00042
    00043 class SegmentSnapper {
    00044 private:
    00045         static double TOLERANCE;
    00046 public:
    00050         static bool isWithinTolerance(const Coordinate& p,const Coordinate& p0,const Coordinate& p1);
    00061         bool addSnappedNode(Coordinate& snapPt,SegmentString *segStr,int segIndex);
    00062 };
    00063
    00064 class SimpleSegmentStringsSnapper {
    00065 private:
    00066         int nSnaps;
    00071         void computeSnaps(SegmentString *e0, SegmentString *e1, SegmentSnapper *ss);
    00072 public:
    00073         SimpleSegmentStringsSnapper();
    00074         int getNumSnaps();
    00075         void computeNodes(vector<SegmentString*>* edges, SegmentSnapper *ss, bool testAllSegments);
    00076 };
    00077
    00078 /*
    00079  * Uses snap rounding to compute a rounded, noded arrangement from a
    00080  * set of linestrings.
    00081  */
    00082 class SnapRounder {
    00083 protected:
    00084         LineIntersector *li;
    00085 public:
    00086         void setLineIntersector(LineIntersector *newLi);
    00087         vector<SegmentString*>* node(vector<SegmentString*>* inputSegmentStrings);
    00088 private:
    00089         vector<SegmentString*>* fullyIntersectSegments(vector<SegmentString*>* segStrings, LineIntersector *aLi);
    00094         vector<SegmentString*>* computeSnaps(vector<SegmentString*>* segStrings);
    00095 };
    00096
    00097 }
    00098 #endif
    00099