00001 /*************************************************************************** 00002 qgsclipper.cpp - a class that clips line 00003 segments and polygons 00004 ------------------- 00005 begin : March 2004 00006 copyright : (C) 2005 by Gavin Macaulay 00007 email : 00008 ***************************************************************************/ 00009 00010 /*************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 ***************************************************************************/ 00018 /* $Id$ */ 00019 00020 #include "qgsclipper.h" 00021 00022 // Where has all the code gone? 00023 00024 // It's been inlined, so its in the qgsclipper.h file. 00025 00026 // But the static members must be initialised outside the class! (or GCC 4 dies) 00027 00028 // Qt also does clipping when the coordinates go over +/- 32767 00029 // moreover from Qt 4.6, Qt clips also when the width/height of a painter path 00030 // is more than 32767. Since we want to avoid clipping by Qt (because it is slow) 00031 // we set coordinate limit to less than 32767 / 2 00032 const double QgsClipper::MAX_X = 16000; 00033 const double QgsClipper::MIN_X = -16000; 00034 const double QgsClipper::MAX_Y = 16000; 00035 const double QgsClipper::MIN_Y = -16000; 00036 00037 const double QgsClipper::SMALL_NUM = 1e-12;