| 1 | /* |
| 2 | * Copyright 2016-2018 Uber Technologies, Inc. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | /** @file algos.h |
| 17 | * @brief Hexagon grid algorithms |
| 18 | */ |
| 19 | |
| 20 | #ifndef ALGOS_H |
| 21 | #define ALGOS_H |
| 22 | |
| 23 | #include "bbox.h" |
| 24 | #include "coordijk.h" |
| 25 | #include "h3api.h" |
| 26 | #include "linkedGeo.h" |
| 27 | #include "vertexGraph.h" |
| 28 | |
| 29 | // neighbor along the ijk coordinate system of the current face, rotated |
| 30 | H3Index h3NeighborRotations(H3Index origin, Direction dir, int* rotations); |
| 31 | |
| 32 | // k-ring implementation |
| 33 | void _kRingInternal(H3Index origin, int k, H3Index* out, int* distances, |
| 34 | int maxIdx, int curK); |
| 35 | |
| 36 | // Create a vertex graph from a set of hexagons |
| 37 | void h3SetToVertexGraph(const H3Index* h3Set, const int numHexes, |
| 38 | VertexGraph* out); |
| 39 | |
| 40 | // Create a LinkedGeoPolygon from a vertex graph |
| 41 | void _vertexGraphToLinkedGeo(VertexGraph* graph, LinkedGeoPolygon* out); |
| 42 | |
| 43 | #endif |
| 44 | |