Debian Codegraph @

lib/common/pointset.h

raw
1 /**
2 * @file
3 * @ingroup common_utils
4 * @brief @ref point containers @ref PointSet and @ref PointMap
5 */
6
7 /*************************************************************************
8 * Copyright (c) 2011 AT&T Intellectual Property
9 * All rights reserved. This program and the accompanying materials
10 * are made available under the terms of the Eclipse Public License v1.0
11 * which accompanies this distribution, and is available at
12 * https://www.eclipse.org/legal/epl-v10.html
13 *
14 * Contributors: Details at https://graphviz.org
15 *************************************************************************/
16
17 #pragma once
18
19 #include <cdt.h>
20 #include <geom.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 typedef Dict_t PointSet; ///< set of @ref pointf. Created by @ref newPS
27 typedef Dict_t PointMap; ///< map of @ref point. Created by @ref newPM
28
29 #ifdef GVDLL
30 #ifdef GVC_EXPORTS
31 #define POINTSET_API __declspec(dllexport)
32 #else
33 #define POINTSET_API __declspec(dllimport)
34 #endif
35 #endif
36
37 /// @cond
38 #ifndef POINTSET_API
39 #define POINTSET_API /* nothing */
40 #endif
41 /// @endcond
42
43 POINTSET_API PointSet *newPS(void);
44 POINTSET_API void freePS(PointSet *);
45 POINTSET_API void insertPS(PointSet *, pointf);
46 POINTSET_API void addPS(PointSet *, double x, double y);
47 POINTSET_API int inPS(PointSet *, pointf);
48 POINTSET_API int isInPS(PointSet *, double x, double y);
49 POINTSET_API int sizeOf(PointSet *);
50 POINTSET_API pointf *pointsOf(PointSet *);
51
52 POINTSET_API PointMap *newPM(void);
53 POINTSET_API void clearPM(PointMap *);
54 POINTSET_API void freePM(PointMap *);
55 POINTSET_API int insertPM(PointMap *, int x, int y, int value);
56
57 #undef POINTSET_API
58 #ifdef __cplusplus
59 }
60 #endif