Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
pointset.h
Go to the documentation of this file.
1
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
23extern "C" {
24#endif
25
26 typedef Dict_t PointSet;
27 typedef Dict_t PointMap;
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
38#ifndef POINTSET_API
39#define POINTSET_API /* nothing */
40#endif
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
container data types API
geometric types and macros (e.g. points and boxes)
std::unordered_map< std::pair< int, int >, int, PointHash > PointMap
Dict_t PointSet
set of pointf. Created by newPS
Definition pointset.h:26
POINTSET_API pointf * pointsOf(PointSet *)
Definition pointset.c:93
POINTSET_API PointMap * newPM(void)
Definition pointset.c:131
POINTSET_API PointSet * newPS(void)
Definition pointset.c:53
POINTSET_API void clearPM(PointMap *)
Definition pointset.c:136
POINTSET_API void addPS(PointSet *, double x, double y)
Definition pointset.c:71
POINTSET_API void insertPS(PointSet *, pointf)
Definition pointset.c:63
POINTSET_API void freePS(PointSet *)
Definition pointset.c:58
Dict_t PointMap
map of point. Created by newPM
Definition pointset.h:27
POINTSET_API int sizeOf(PointSet *)
Definition pointset.c:88
POINTSET_API int isInPS(PointSet *, double x, double y)
Definition pointset.c:84
POINTSET_API int insertPM(PointMap *, int x, int y, int value)
Definition pointset.c:146
POINTSET_API int inPS(PointSet *, pointf)
Definition pointset.c:78
POINTSET_API void freePM(PointMap *)
Definition pointset.c:141
Definition cdt.h:100