From 1341214044afd42898301ff6489db66cae2cdc94 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Thu, 23 Jan 2014 13:30:38 +0100 Subject: [PATCH] Add fwd decl to slash compile time --- Algorithms/DouglasPeucker.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Algorithms/DouglasPeucker.h b/Algorithms/DouglasPeucker.h index 0543cedfb..6f7ecb0e4 100644 --- a/Algorithms/DouglasPeucker.h +++ b/Algorithms/DouglasPeucker.h @@ -28,11 +28,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef DOUGLASPEUCKER_H_ #define DOUGLASPEUCKER_H_ -#include "../DataStructures/SegmentInformation.h" +#include "../Util/SimpleLogger.h" #include #include +#include #include @@ -40,30 +41,31 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -/*This class object computes the bitvector of indicating generalized input points - * according to the (Ramer-)Douglas-Peucker algorithm. +/* This class object computes the bitvector of indicating generalized input + * points according to the (Ramer-)Douglas-Peucker algorithm. * - * Input is vector of pairs. Each pair consists of the point information and a bit - * indicating if the points is present in the generalization. + * Input is vector of pairs. Each pair consists of the point information and a + * bit indicating if the points is present in the generalization. * Note: points may also be pre-selected*/ +struct SegmentInformation; + class DouglasPeucker { private: typedef std::pair PairOfPoints; //Stack to simulate the recursion - std::stack recursion_stack; + std::stack recursion_stack; - /** - * This distance computation does integer arithmetic only and is about twice as fast as - * the other distance function. It is an approximation only, but works more or less ok. - */ - int fastDistance( + double ComputeDistance( const FixedPointCoordinate& point, const FixedPointCoordinate& segA, const FixedPointCoordinate& segB ) const; public: - void Run(std::vector & input_geometry, const unsigned zoom_level); + void Run( + std::vector & input_geometry, + const unsigned zoom_level + ); };