1{ 2 Free Pascal port of the OpenPTC C++ library. 3 Copyright (C) 2001-2010 Nikolay Nikolov (nickysn@users.sourceforge.net) 4 Original C++ version by Glenn Fiedler (ptc@gaffer.org) 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public 8 License as published by the Free Software Foundation; either 9 version 2.1 of the License, or (at your option) any later version 10 with the following modification: 11 12 As a special exception, the copyright holders of this library give you 13 permission to link this library with independent modules to produce an 14 executable, regardless of the license terms of these independent modules,and 15 to copy and distribute the resulting executable under terms of your choice, 16 provided that you also meet, for each linked independent module, the terms 17 and conditions of the license of that module. An independent module is a 18 module which is not derived from or based on this library. If you modify 19 this library, you may extend this exception to your version of the library, 20 but you are not obligated to do so. If you do not wish to do so, delete this 21 exception statement from your version. 22 23 This library is distributed in the hope that it will be useful, 24 but WITHOUT ANY WARRANTY; without even the implied warranty of 25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26 Lesser General Public License for more details. 27 28 You should have received a copy of the GNU Lesser General Public 29 License along with this library; if not, write to the Free Software 30 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 31} 32 33procedure ptc_clipper_clip(area, clip, clipped: TPTC_AREA); 34var 35 tmp: TPTCArea; 36begin 37 try 38 tmp := TPTCClipper.clip(TPTCArea(area), TPTCArea(clip)); 39 try 40 TPTCArea(clipped).Assign(tmp); 41 finally 42 tmp.Destroy; 43 end; 44 except 45 on error: TPTCError do 46 begin 47 ptc_exception_handle(error); 48 end; 49 end; 50end; 51 52procedure ptc_clipper_clip_complex(source, clip_source, clipped_source, destination, clip_destination, clipped_destination: TPTC_AREA); 53begin 54 try 55 TPTCClipper.clip(TPTCArea(source), TPTCArea(clip_source), TPTCArea(clipped_source), TPTCArea(destination), TPTCArea(clip_destination), TPTCArea(clipped_destination)); 56 except 57 on error: TPTCError do 58 begin 59 ptc_exception_handle(error); 60 end; 61 end; 62end; 63