| 1 |
/************************************************************************* |
| 2 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* https://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: Details at https://graphviz.org |
| 9 |
*************************************************************************/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include <pathgeom.h> |
| 14 |
|
| 15 |
#ifdef __cplusplus |
| 16 |
extern "C" { |
| 17 |
#endif |
| 18 |
|
| 19 |
|
| 20 |
#ifdef GVDLL |
| 21 |
#ifdef PATHPLAN_EXPORTS |
| 22 |
#define VISPATH_API __declspec(dllexport) |
| 23 |
#else |
| 24 |
#define VISPATH_API __declspec(dllimport) |
| 25 |
#endif |
| 26 |
#endif |
| 27 |
|
| 28 |
#ifndef VISPATH_API |
| 29 |
#define VISPATH_API /* nothing */ |
| 30 |
#endif |
| 31 |
|
| 32 |
/* open a visibility graph |
| 33 |
* Points in polygonal obstacles must be in clockwise order. |
| 34 |
*/ |
| 35 |
VISPATH_API vconfig_t *Pobsopen(Ppoly_t ** obstacles, int n_obstacles); |
| 36 |
|
| 37 |
/* close a visibility graph, freeing its storage */ |
| 38 |
VISPATH_API void Pobsclose(vconfig_t * config); |
| 39 |
|
| 40 |
/* route a polyline from p0 to p1, avoiding obstacles. |
| 41 |
* if an endpoint is inside an obstacle, pass the polygon's index >=0 |
| 42 |
* if the endpoint is not inside an obstacle, pass POLYID_NONE |
| 43 |
* if the endpoint location is not known, pass POLYID_UNKNOWN |
| 44 |
*/ |
| 45 |
|
| 46 |
VISPATH_API void Pobspath(vconfig_t *config, Ppoint_t p0, int poly0, |
| 47 |
Ppoint_t p1, int poly1, |
| 48 |
Ppolyline_t *output_route); |
| 49 |
|
| 50 |
#define POLYID_NONE -1111 |
| 51 |
#define POLYID_UNKNOWN -2222 |
| 52 |
|
| 53 |
#undef VISPATH_API |
| 54 |
|
| 55 |
#ifdef __cplusplus |
| 56 |
} |
| 57 |
#endif |