Skip to content

Commit

Permalink
cleand up
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed Jul 10, 2023
1 parent 7ef9bc5 commit 16a0419
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
48 changes: 0 additions & 48 deletions inst/include/h3libapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,60 +587,12 @@ Direction(*fun)(H3Index, H3Index) =
return fun(origin, destination);
}

// inline void _geoToFaceIjk(const LatLng *g, int res, FaceIJK *h) {
// void(*fun)(const LatLng*, int, FaceIJK*) =
// (void(*)(const LatLng*, int, FaceIJK*)) R_GetCCallable("h3lib", "_geoToFaceIjk");
// fun(g, res, h);
// }
//
//
// inline void _faceIjkToGeo(const FaceIJK *h, int res, LatLng *g) {
// void(*fun)(const FaceIJK*, int, LatLng*) =
// (void(*)(const FaceIJK*, int, LatLng*)) R_GetCCallable("h3lib", "_faceIjkToGeo");
// fun(h, res, g);
// }
//
// inline void _geoToHex2d(const LatLng *g, int res, int *face, Vec2d *v) {
// void(*fun)(const LatLng*, int, int*, Vec2d*) =
// (void(*)(const LatLng*, int, int*, Vec2d*)) R_GetCCallable("h3lib", "_geoToHex2d");
// fun(g, res, face, v);
// }
//
// inline void _hex2dToCoordIJK(const Vec2d *v, CoordIJK *h) {
// void(*fun)(const Vec2d*, CoordIJK*) =
// (void(*)(const Vec2d*, CoordIJK*)) R_GetCCallable("h3lib", "_hex2dToCoordIJK");
// fun(v, h);
// }
//
// inline H3Error _h3ToFaceIjk(H3Index h, FaceIJK *fijk) {
// H3Error(*fun)(H3Index, FaceIJK*) =
// (H3Error(*)(H3Index, FaceIJK*)) R_GetCCallable("h3lib", "_h3ToFaceIjk");
// return fun(h, fijk);
// }
//
// inline H3Index _faceIjkToH3(const FaceIJK *fijk, int res) {
// H3Index(*fun)(const FaceIJK*, int) =
// (H3Index(*)(const FaceIJK*, int)) R_GetCCallable("h3lib", "_faceIjkToH3");
// return fun(fijk, res);
// }

inline H3Error cellToLocalIjk(H3Index origin, H3Index h3, CoordIJK *out) {
H3Index(*fun)(H3Index, H3Index, CoordIJK*) =
(H3Index(*)(H3Index, H3Index, CoordIJK*)) R_GetCCallable("h3lib", "cellToLocalIjk");
return fun(origin, h3, out);
}

inline void _geoToClosestFace(const LatLng *g, int *face, double *sqd) {
void(*fun)(const LatLng*, int*, double*) =
(void(*)(const LatLng*, int*, double*)) R_GetCCallable("h3lib", "_geoToClosestFace");
fun(g, face, sqd);
}

// inline void _ijkToHex2d(const CoordIJK *h, Vec2d *v) {
// void(*fun)(const CoordIJK*, Vec2d*) =
// (void(*)(const CoordIJK*, Vec2d*)) R_GetCCallable("h3lib", "_ijkToHex2d");
// fun(h, v);
// }

#ifdef __cplusplus
}
Expand Down
10 changes: 0 additions & 10 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "algos.h" // directionForNeighbor
#include "faceijk.h" // FACEIJK operations
#include "h3Index.h" // _h3ToFaceIjk and _faceIjkToH3
#include "localij.h" // cellToLocalIJK

#include <R.h>
#include <Rconfig.h>
Expand Down Expand Up @@ -97,16 +96,7 @@ void attribute_visible R_init_h3lib(DllInfo *info)

// Non-API
R_RegisterCCallable("h3lib", "directionForNeighbor", (DL_FUNC) &directionForNeighbor);
// R_RegisterCCallable("h3lib", "_geoToFaceIjk", (DL_FUNC) &_geoToFaceIjk);
// R_RegisterCCallable("h3lib", "_hex2dToCoordIJK", (DL_FUNC) &_hex2dToCoordIJK);
// R_RegisterCCallable("h3lib", "_faceIjkToGeo", (DL_FUNC) &_faceIjkToGeo);
// R_RegisterCCallable("h3lib", "_geoToHex2d", (DL_FUNC) &_geoToHex2d);
// R_RegisterCCallable("h3lib", "_h3ToFaceIjk", (DL_FUNC) &_h3ToFaceIjk);
// R_RegisterCCallable("h3lib", "_faceIjkToH3", (DL_FUNC) &_faceIjkToH3);
// R_RegisterCCallable("h3lib", "cellToLocalIjk", (DL_FUNC) &cellToLocalIjk);
R_RegisterCCallable("h3lib", "_geoToClosestFace", (DL_FUNC) &_geoToClosestFace);
// R_RegisterCCallable("h3lib", "_ijkToHex2d", (DL_FUNC) &_ijkToHex2d);


R_forceSymbols(info, TRUE); // controls visibility

Expand Down

0 comments on commit 16a0419

Please sign in to comment.