GEOS: MCIndexSnapRounder.h Source File

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

# MCIndexSnapRounder.h

    00001 /**********************************************************************
    00002  * $Id: MCIndexSnapRounder.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) 2006      Refractions Research 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
    00016 #ifndef GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
    00017 #define GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
    00018
    00019 #include <vector>
    00020
    00021 #include <geos/inline.h>
    00022
    00023 #include <geos/noding/Noder.h> // for inheritance
    00024 #include <geos/algorithm/LineIntersector.h> // for composition
    00025 #include <geos/geom/Coordinate.h> // for use in vector
    00026
    00027 // Forward declarations
    00028 namespace geos {
    00029         namespace geom {
    00030                 class PrecisionModel;
    00031         }
    00032         namespace algorithm {
    00033                 class LineIntersector;
    00034         }
    00035         namespace noding {
    00036                 class SegmentString;
    00037                 class MCIndexNoder;
    00038                 namespace snapround {
    00039                         //class HotPixel;
    00040                         class MCIndexPointSnapper;
    00041                 }
    00042         }
    00043 }
    00044
    00045 namespace geos {
    00046 namespace noding { // geos::noding
    00047 namespace snapround { // geos::noding::snapround
    00048
    00049
    00073 class MCIndexSnapRounder: public Noder { // implments Noder
    00074
    00075 private:
    00076
    00078         geom::PrecisionModel& pm;
    00079
    00080         algorithm::LineIntersector li;
    00081
    00082         double scaleFactor;
    00083
    00084         std::vector<SegmentString*>* nodedSegStrings;
    00085
    00086         std::auto_ptr<MCIndexPointSnapper> pointSnapper;
    00087
    00088         void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
    00089
    00090
    00098         void findInteriorIntersections(MCIndexNoder& noder,
    00099                         std::vector<SegmentString*>* segStrings,
    00100                         std::vector<geom::Coordinate>& intersections);
    00101
    00106         void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
    00107
    00112         void computeEdgeVertexSnaps(SegmentString* e);
    00113
    00114         void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
    00115
    00116 public:
    00117
    00118         MCIndexSnapRounder(geom::PrecisionModel& nPm);
    00119
    00120         std::vector<SegmentString*>* getNodedSubstrings() const;
    00121
    00122         void computeNodes(std::vector<SegmentString*>* segStrings);
    00123
    00130         void computeVertexSnaps(std::vector<SegmentString*>& edges);
    00131
    00132 };
    00133
    00134
    00135 } // namespace geos::noding::snapround
    00136 } // namespace geos::noding
    00137 } // namespace geos
    00138
    00139 #ifdef GEOS_INLINE
    00140 # include <geos/noding/snapround/MCIndexSnapRounder.inl>
    00141 #endif
    00142
    00143 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
    00144
    00145 /**********************************************************************
    00146  * $Log$
    00147  * Revision 1.2  2006/03/24 09:52:41  strk
    00148  * USE_INLINE => GEOS_INLINE
    00149  *
    00150  * Revision 1.1  2006/03/14 12:55:56  strk
    00151  * Headers split: geomgraphindex.h, nodingSnapround.h
    00152  *
    00153  **********************************************************************/
    00154