OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
faceijk.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-2019 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  */
24 #ifndef FACEIJK_H
25 #define FACEIJK_H
26 
30 
35 #define FACE_INDEX 3 // i = 0, j = 1, k = 2, face = 3
36 #define FaceIJK(variable_name) int variable_name[4]
37 #define FaceIJK_clone(fijk) \
38  { fijk[I_INDEX], fijk[J_INDEX], fijk[K_INDEX], fijk[FACE_INDEX] }
39 #define FaceIJK_copy(dest_ijk, src_ijk) \
40  dest_ijk[I_INDEX] = src_ijk[I_INDEX]; \
41  dest_ijk[J_INDEX] = src_ijk[J_INDEX]; \
42  dest_ijk[K_INDEX] = src_ijk[K_INDEX]; \
43  dest_ijk[FACE_INDEX] = src_ijk[FACE_INDEX];
44 
45 // typedef struct {
46 // int face; ///< face number
47 // CoordIJK coord; ///< ijk coordinates on that face
48 // } FaceIJK;
49 
53 #define CCWROT_60_INDEX 4 // i = 0, j = 1, k = 2, face = 3
54 #define FaceOrientIJK(variable_name) int variable_name[5]
55 #define FaceOrientIJK2DArray(variable_name, size1, size2) \
56  int variable_name[size1][size2][5]
57 // typedef struct {
58 // int face; ///< face number
59 // CoordIJK translate; ///< res 0 translation relative to primary face
60 // int ccwRot60; ///< number of 60 degree ccw rotations relative to primary
61 // /// face
62 // } FaceOrientIJK;
63 
64 // extern const GeoCoord faceCenterGeo[NUM_ICOSA_FACES];
65 
66 // indexes for faceNeighbors table
68 #define IJ 1
69 
70 #define KI 2
71 
72 #define JK 3
73 
74 // /** Invalid face index */
75 // #define INVALID_FACE -1
76 
78 typedef enum {
82  FACE_EDGE = 1,
85 } Overage;
86 
87 // Internal functions
88 
90 EXTENSION_NOINLINE bool _geoToFaceIjk(const GeoCoord(g), int res, FaceIJK(h));
91 EXTENSION_NOINLINE bool _geoToHex2d(const GeoCoord(g), int res, int* face, Vec2d(v));
92 EXTENSION_NOINLINE bool _faceIjkToGeo(const FaceIJK(h), int res, GeoCoord(g));
93 // void _faceIjkToGeoBoundary(const FaceIJK* h, int res, int start, int length,
94 // GeoBoundary* g);
95 // void _faceIjkPentToGeoBoundary(const FaceIJK* h, int res, int start, int length,
96 // GeoBoundary* g);
97 // void _faceIjkToVerts(FaceIJK* fijk, int* res, FaceIJK* fijkVerts);
98 // void _faceIjkPentToVerts(FaceIJK* fijk, int* res, FaceIJK* fijkVerts);
100  int face,
101  int res,
102  int substrate,
103  GeoCoord(g));
105  int res,
106  int pentLeading4,
107  int substrate);
108 // Overage _adjustPentVertOverage(FaceIJK* fijk, int res);
109 
111 
112 #endif
Overage
Definition: faceijk.h:78
#define GeoCoord(variable_name)
Definition: h3api.h:94
EXTENSION_INLINE int isResClassIII(int res)
Definition: faceijk.hpp:350
EXTENSION_NOINLINE bool _hex2dToGeo(const Vec2d(v), int face, int res, int substrate, GeoCoord(g))
Definition: faceijk.hpp:442
#define FaceIJK(variable_name)
Definition: faceijk.h:36
2D floating point vector functions.
EXTENSION_NOINLINE bool _geoToHex2d(const GeoCoord(g), int res, int *face, Vec2d(v))
Definition: faceijk.hpp:382
#define EXTENSION_NOINLINE
Definition: OmniSciTypes.h:28
#define Vec2d(variable_name)
Definition: vec2d.h:28
Primary H3 core library entry points.
EXTENSION_NOINLINE bool _faceIjkToGeo(const FaceIJK(h), int res, GeoCoord(g))
Definition: faceijk.hpp:495
Header file for CoordIJK functions including conversion from lat/lon.
#define EXTENSION_INLINE
Definition: OmniSciTypes.h:27
EXTENSION_NOINLINE int _adjustOverageClassII(FaceIJK(fijk), int res, int pentLeading4, int substrate)
Definition: faceijk.hpp:864
EXTENSION_NOINLINE bool _geoToFaceIjk(const GeoCoord(g), int res, FaceIJK(h))
Definition: faceijk.hpp:362