/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2020 Paul Ramsey * * 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. * **********************************************************************/ #pragma once #include #include // for unique_ptr #include // for composition #include #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class #endif // Forward declarations namespace geos { namespace algorithm { class LineIntersector; } namespace index { class ItemVisitor; } namespace noding { namespace snapround { class HotPixel; } } } namespace geos { namespace noding { // geos::noding namespace snapround { // geos::noding::snapround class GEOS_DLL HotPixelIndex { private: /* members */ const geom::PrecisionModel* pm; double scaleFactor; std::unique_ptr index; std::deque hotPixelQue; /* methods */ geom::Coordinate round(const geom::Coordinate& c); HotPixel* find(const geom::Coordinate& pixelPt); public: HotPixelIndex(const geom::PrecisionModel* p_pm); HotPixel* add(const geom::Coordinate& pt); void add(const geom::CoordinateSequence* pts); void add(const std::vector& pts); void addNodes(const geom::CoordinateSequence* pts); void addNodes(const std::vector& pts); /** * Visits all the hot pixels which may intersect a segment (p0-p1). * The visitor must determine whether each hot pixel actually intersects * the segment. */ void query(const geom::Coordinate& p0, const geom::Coordinate& p1, index::kdtree::KdNodeVisitor& visitor); }; } // namespace geos::noding::snapround } // namespace geos::noding } // namespace geos #ifdef _MSC_VER #pragma warning(pop) #endif