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

- File List

# MCIndexSnapRounder.h

    00001 /**********************************************************************
    00002  * $Id: MCIndexSnapRounder.h 2777 2009-12-03 19:41:15Z 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  * 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 public:
    00080
    00081         MCIndexSnapRounder(geom::PrecisionModel& nPm);
    00082
    00083         std::vector<SegmentString*>* getNodedSubstrings() const;
    00084
    00085         void computeNodes(std::vector<SegmentString*>* segStrings);
    00086
    00095         void computeVertexSnaps(std::vector<SegmentString*>& edges);
    00096
    00097 private:
    00098
    00100         geom::PrecisionModel& pm;
    00101
    00102         algorithm::LineIntersector li;
    00103
    00104         double scaleFactor;
    00105
    00106         std::vector<SegmentString*>* nodedSegStrings;
    00107
    00108         std::auto_ptr<MCIndexPointSnapper> pointSnapper;
    00109
    00110         void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
    00111
    00112
    00120         void findInteriorIntersections(MCIndexNoder& noder,
    00121                         std::vector<SegmentString*>* segStrings,
    00122                         std::vector<geom::Coordinate>& intersections);
    00123
    00128         void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
    00129
    00134         void computeVertexSnaps(NodedSegmentString* e);
    00135
    00136         void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
    00137
    00138     // Declare type as noncopyable
    00139     MCIndexSnapRounder(const MCIndexSnapRounder& other);
    00140     MCIndexSnapRounder& operator=(const MCIndexSnapRounder& rhs);
    00141 };
    00142
    00143
    00144 } // namespace geos::noding::snapround
    00145 } // namespace geos::noding
    00146 } // namespace geos
    00147
    00148 #ifdef GEOS_INLINE
    00149 # include <geos/noding/snapround/MCIndexSnapRounder.inl>
    00150 #endif
    00151
    00152 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
    00153
    00154 /**********************************************************************
    00155  * $Log$
    00156  * Revision 1.2  2006/03/24 09:52:41  strk
    00157  * USE_INLINE => GEOS_INLINE
    00158  *
    00159  * Revision 1.1  2006/03/14 12:55:56  strk
    00160  * Headers split: geomgraphindex.h, nodingSnapround.h
    00161  *
    00162  **********************************************************************/
    00163