/[zanavi_public1]/navit/navit/maptool/poly2tri-c/002/poly2tri-c/p2t/common/cutils.h
ZANavi

Contents of /navit/navit/maptool/poly2tri-c/002/poly2tri-c/p2t/common/cutils.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Mon Feb 4 17:41:59 2013 UTC (11 years, 1 month ago) by zoff99
File MIME type: text/plain
File size: 2689 byte(s)
new map version, lots of fixes and experimental new features
1 /*
2 * This file is a part of the C port of the Poly2Tri library
3 * Porting to C done by (c) Barak Itkin <lightningismyname@gmail.com>
4 * http://code.google.com/p/poly2tri-c/
5 *
6 * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
7 * http://code.google.com/p/poly2tri/
8 *
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 *
14 * * Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above copyright notice,
17 * this list of conditions and the following disclaimer in the documentation
18 * and/or other materials provided with the distribution.
19 * * Neither the name of Poly2Tri nor the names of its contributors may be
20 * used to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
36 #ifndef __P2TC_P2T_CUTILS_H__
37 #define __P2TC_P2T_CUTILS_H__
38
39 #include <glib.h>
40 #include "poly2tri-private.h"
41
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46
47 #define DEBUG FALSE
48
49 typedef GPtrArray* P2tEdgePtrArray;
50 #define edge_index(array,index_) ((P2tEdge*)g_ptr_array_index(array,index_))
51 typedef GPtrArray* P2tPointPtrArray;
52 #define point_index(array,index_) ((P2tPoint*)g_ptr_array_index(array,index_))
53 typedef GPtrArray* P2tTrianglePtrArray;
54 #define triangle_index(array,index_) ((P2tTriangle*)g_ptr_array_index(array,index_))
55 typedef GPtrArray* P2tNodePtrArray;
56 #define node_index(array,index_) ((P2tNode*)g_ptr_array_index(array,index_))
57 typedef GList* P2tTrianglePtrList;
58 #define triangle_val(list) ((P2tTriangle*)((list)->data))
59
60 #define g_ptr_array_index_cyclic(array,index_) g_ptr_array_index(array,(index_)%((array)->len))
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif /* CUTILS_H */
67

   
Visit the ZANavi Wiki