OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
baseCells.hpp File Reference
+ Include dependency graph for baseCells.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BaseCellRotation
 base cell at a given ijk and required rotations into its system More...
 

Functions

EXTENSION_INLINE int _isBaseCellPentagon (int baseCell)
 Return whether or not the indicated base cell is a pentagon. More...
 
EXTENSION_INLINE int _faceIjkToBaseCell (const FaceIJK(h))
 Return whether the indicated base cell is a pentagon where all neighbors are oriented towards it. More...
 
EXTENSION_INLINE int _faceIjkToBaseCellCCWrot60 (const FaceIJK(h))
 Find base cell given FaceIJK. More...
 
EXTENSION_INLINE bool _baseCellIsCwOffset (int baseCell, int testFace)
 Find the FaceIJK given a base cell. More...
 

Variables

static DEVICE const
BaseCellRotation 
faceIjkBaseCells [NUM_ICOSA_FACES][3][3][3]
 Neighboring base cell ID in each IJK direction. More...
 
DEVICE const BaseCellData baseCellData [NUM_BASE_CELLS]
 Resolution 0 base cell data table. More...
 

Function Documentation

EXTENSION_INLINE bool _baseCellIsCwOffset ( int  baseCell,
int  testFace 
)

Find the FaceIJK given a base cell.

Given a base cell and the face it appears on, return the number of 60' ccw rotations for that base cell's coordinate system.

Returns
The number of rotations, or INVALID_ROTATIONS if the base cell is not found on the given faceReturn whether or not the tested face is a cw offset face.

Definition at line 887 of file baseCells.hpp.

References baseCellData, and BaseCellData::cwOffsetPent.

Referenced by _faceIjkToH3().

887  {
888  return baseCellData[baseCell].cwOffsetPent[0] == testFace ||
889  baseCellData[baseCell].cwOffsetPent[1] == testFace;
890 }
int cwOffsetPent[2]
Definition: baseCells.h:33
DEVICE const BaseCellData baseCellData[NUM_BASE_CELLS]
Resolution 0 base cell data table.
Definition: baseCells.hpp:697

+ Here is the caller graph for this function:

EXTENSION_INLINE int _faceIjkToBaseCell ( const   FaceIJKh)

Return whether the indicated base cell is a pentagon where all neighbors are oriented towards it.

Find base cell given FaceIJK.

Given the face number and a resolution 0 ijk+ coordinate in that face's face-centered ijk coordinate system, return the base cell located at that coordinate.

Valid ijk+ lookup coordinates are from (0, 0, 0) to (2, 2, 2).

Definition at line 842 of file baseCells.hpp.

References BaseCellRotation::baseCell, FACE_INDEX, faceIjkBaseCells, I_INDEX, J_INDEX, and K_INDEX.

Referenced by _faceIjkToH3().

842  {
844 }
#define J_INDEX
Definition: coordijk.h:43
#define I_INDEX
Definition: coordijk.h:42
int baseCell
base cell number
Definition: baseCells.hpp:28
#define FACE_INDEX
Definition: faceijk.h:35
#define K_INDEX
Definition: coordijk.h:44
static DEVICE const BaseCellRotation faceIjkBaseCells[NUM_ICOSA_FACES][3][3][3]
Neighboring base cell ID in each IJK direction.
Definition: baseCells.hpp:308

+ Here is the caller graph for this function:

EXTENSION_INLINE int _faceIjkToBaseCellCCWrot60 ( const   FaceIJKh)

Find base cell given FaceIJK.

Given the face number and a resolution 0 ijk+ coordinate in that face's face-centered ijk coordinate system, return the number of 60' ccw rotations to rotate into the coordinate system of the base cell at that coordinates.

Valid ijk+ lookup coordinates are from (0, 0, 0) to (2, 2, 2).

Definition at line 854 of file baseCells.hpp.

References BaseCellRotation::ccwRot60, FACE_INDEX, faceIjkBaseCells, I_INDEX, J_INDEX, and K_INDEX.

Referenced by _faceIjkToH3().

854  {
856 }
#define J_INDEX
Definition: coordijk.h:43
#define I_INDEX
Definition: coordijk.h:42
#define FACE_INDEX
Definition: faceijk.h:35
#define K_INDEX
Definition: coordijk.h:44
static DEVICE const BaseCellRotation faceIjkBaseCells[NUM_ICOSA_FACES][3][3][3]
Neighboring base cell ID in each IJK direction.
Definition: baseCells.hpp:308

+ Here is the caller graph for this function:

EXTENSION_INLINE int _isBaseCellPentagon ( int  baseCell)

Return whether or not the indicated base cell is a pentagon.

Invalid number of rotations

Definition at line 824 of file baseCells.hpp.

References baseCellData, and BaseCellData::isPentagon.

Referenced by _faceIjkToH3(), _h3ToFaceIjk(), and _h3ToFaceIjkWithInitializedFijk().

824  {
825  return baseCellData[baseCell].isPentagon;
826 }
DEVICE const BaseCellData baseCellData[NUM_BASE_CELLS]
Resolution 0 base cell data table.
Definition: baseCells.hpp:697
int isPentagon
is this base cell a pentagon?
Definition: baseCells.h:32

+ Here is the caller graph for this function:

Variable Documentation

DEVICE const BaseCellData baseCellData[NUM_BASE_CELLS]

Resolution 0 base cell data table.

For each base cell, gives the "home" face and ijk+ coordinates on that face, whether or not the base cell is a pentagon. Additionally, if the base cell is a pentagon, the two cw offset rotation adjacent faces are given (-1 indicates that no cw offset rotation faces exist for this base cell).

Definition at line 697 of file baseCells.hpp.

Referenced by _baseCellIsCwOffset(), _h3ToFaceIjk(), and _isBaseCellPentagon().

DEVICE const BaseCellRotation faceIjkBaseCells[NUM_ICOSA_FACES][3][3][3]
static

Neighboring base cell ID in each IJK direction.

For each base cell, for each direction, the neighboring base cell ID is given. 127 indicates there is no neighbor in that direction.Neighboring base cell rotations in each IJK direction.

For each base cell, for each direction, the number of 60 degree CCW rotations to the coordinate system of the neighbor is given. -1 indicates there is no neighbor in that direction.Resolution 0 base cell lookup table for each face.

Given the face number and a resolution 0 ijk+ coordinate in that face's face-centered ijk coordinate system, gives the base cell located at that coordinate and the number of 60 ccw rotations to rotate into that base cell's orientation.

Valid lookup coordinates are from (0, 0, 0) to (2, 2, 2).

This table can be accessed using the functions _faceIjkToBaseCell and _faceIjkToBaseCellCCWrot60

Definition at line 308 of file baseCells.hpp.

Referenced by _faceIjkToBaseCell(), and _faceIjkToBaseCellCCWrot60().