/usr/include/geos/noding/snapround/MCIndexSnapRounder.h is in libgeos-dev 3.2.2-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | /**********************************************************************
* $Id: MCIndexSnapRounder.h 2777 2009-12-03 19:41:15Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: noding/snapround/MCIndexSnapRounder.java rev. 1.3 (JTS-1.9)
*
**********************************************************************/
#ifndef GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
#define GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
#include <geos/export.h>
#include <vector>
#include <geos/inline.h>
#include <geos/noding/Noder.h> // for inheritance
#include <geos/algorithm/LineIntersector.h> // for composition
#include <geos/geom/Coordinate.h> // for use in vector
// Forward declarations
namespace geos {
namespace geom {
class PrecisionModel;
}
namespace algorithm {
class LineIntersector;
}
namespace noding {
class SegmentString;
class NodedSegmentString;
class MCIndexNoder;
namespace snapround {
//class HotPixel;
class MCIndexPointSnapper;
}
}
}
namespace geos {
namespace noding { // geos::noding
namespace snapround { // geos::noding::snapround
/** \brief
* Uses Snap Rounding to compute a rounded,
* fully noded arrangement from a set of SegmentString
*
* Implements the Snap Rounding technique described in Hobby, Guibas & Marimont,
* and Goodrich et al.
*
* Snap Rounding assumes that all vertices lie on a uniform grid
* (hence the precision model of the input must be fixed precision,
* and all the input vertices must be rounded to that precision).
*
* This implementation uses a monotone chains and a spatial index to
* speed up the intersection tests.
*
* This implementation appears to be fully robust using an integer
* precision model.
*
* It will function with non-integer precision models, but the
* results are not 100% guaranteed to be correctly noded.
*/
class GEOS_DLL MCIndexSnapRounder: public Noder { // implments Noder
public:
MCIndexSnapRounder(geom::PrecisionModel& nPm);
std::vector<SegmentString*>* getNodedSubstrings() const;
void computeNodes(std::vector<SegmentString*>* segStrings);
/**
* Computes nodes introduced as a result of
* snapping segments to vertices of other segments
*
* @param segStrings the list of segment strings to snap together
* NOTE: they *must* be instances of NodedSegmentString, or
* an assertion will fail.
*/
void computeVertexSnaps(std::vector<SegmentString*>& edges);
private:
/// externally owned
geom::PrecisionModel& pm;
algorithm::LineIntersector li;
double scaleFactor;
std::vector<SegmentString*>* nodedSegStrings;
std::auto_ptr<MCIndexPointSnapper> pointSnapper;
void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
/**
* Computes all interior intersections in the collection of SegmentStrings,
* and push their Coordinate to the provided vector.
*
* Does NOT node the segStrings.
*
*/
void findInteriorIntersections(MCIndexNoder& noder,
std::vector<SegmentString*>* segStrings,
std::vector<geom::Coordinate>& intersections);
/**
* Computes nodes introduced as a result of snapping
* segments to snap points (hot pixels)
*/
void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
/**
* Performs a brute-force comparison of every segment in each {@link SegmentString}.
* This has n^2 performance.
*/
void computeVertexSnaps(NodedSegmentString* e);
void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
// Declare type as noncopyable
MCIndexSnapRounder(const MCIndexSnapRounder& other);
MCIndexSnapRounder& operator=(const MCIndexSnapRounder& rhs);
};
} // namespace geos::noding::snapround
} // namespace geos::noding
} // namespace geos
#ifdef GEOS_INLINE
# include <geos/noding/snapround/MCIndexSnapRounder.inl>
#endif
#endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
/**********************************************************************
* $Log$
* Revision 1.2 2006/03/24 09:52:41 strk
* USE_INLINE => GEOS_INLINE
*
* Revision 1.1 2006/03/14 12:55:56 strk
* Headers split: geomgraphindex.h, nodingSnapround.h
*
**********************************************************************/
|