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

MCIndexSnapRounder.h

00001 /**********************************************************************
00002  * $Id: MCIndexSnapRounder.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) 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  * Last port: noding/snapround/MCIndexSnapRounder.java rev. 1.3 (JTS-1.9)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00021 #define GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00022 
00023 #include <geos/export.h>
00024 
00025 #include <vector>
00026 
00027 #include <geos/inline.h>
00028 
00029 #include <geos/noding/Noder.h> // for inheritance
00030 #include <geos/algorithm/LineIntersector.h> // for composition
00031 #include <geos/geom/Coordinate.h> // for use in vector
00032 
00033 // Forward declarations
00034 namespace geos {
00035         namespace geom {
00036                 class PrecisionModel;
00037         }
00038         namespace algorithm {
00039                 class LineIntersector;
00040         }
00041         namespace noding {
00042                 class SegmentString;
00043                 class NodedSegmentString;
00044                 class MCIndexNoder;
00045                 namespace snapround {
00046                         //class HotPixel;
00047                         class MCIndexPointSnapper;
00048                 }
00049         }
00050 }
00051 
00052 namespace geos {
00053 namespace noding { // geos::noding
00054 namespace snapround { // geos::noding::snapround
00055 
00056 
00077 class GEOS_DLL MCIndexSnapRounder: public Noder { // implments Noder
00078 
00079 private:
00080 
00082         geom::PrecisionModel& pm;
00083 
00084         algorithm::LineIntersector li;
00085 
00086         double scaleFactor;
00087 
00088         std::vector<SegmentString*>* nodedSegStrings;
00089 
00090         std::auto_ptr<MCIndexPointSnapper> pointSnapper;
00091 
00092         void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
00093 
00094         
00102         void findInteriorIntersections(MCIndexNoder& noder,
00103                         std::vector<SegmentString*>* segStrings,
00104                         std::vector<geom::Coordinate>& intersections);
00105 
00110         void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
00111 
00116         void computeVertexSnaps(NodedSegmentString* e);
00117         
00118         void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00119 
00120 public:
00121 
00122         MCIndexSnapRounder(geom::PrecisionModel& nPm);
00123 
00124         std::vector<SegmentString*>* getNodedSubstrings() const;
00125 
00126         void computeNodes(std::vector<SegmentString*>* segStrings);
00127  
00136         void computeVertexSnaps(std::vector<SegmentString*>& edges);
00137 
00138 };
00139 
00140 
00141 } // namespace geos::noding::snapround
00142 } // namespace geos::noding
00143 } // namespace geos
00144 
00145 #ifdef GEOS_INLINE
00146 # include <geos/noding/snapround/MCIndexSnapRounder.inl>
00147 #endif
00148 
00149 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00150 
00151 /**********************************************************************
00152  * $Log$
00153  * Revision 1.2  2006/03/24 09:52:41  strk
00154  * USE_INLINE => GEOS_INLINE
00155  *
00156  * Revision 1.1  2006/03/14 12:55:56  strk
00157  * Headers split: geomgraphindex.h, nodingSnapround.h
00158  *
00159  **********************************************************************/
00160 

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