12 #ifndef hifi_OctalCode_h
13 #define hifi_OctalCode_h
20 const int BITS_IN_OCTAL = 3;
21 const int NUMBER_OF_COLORS = 3;
22 const int SIZE_OF_COLOR_DATA = NUMBER_OF_COLORS *
sizeof(
unsigned char);
23 const int RED_INDEX = 0;
24 const int GREEN_INDEX = 1;
25 const int BLUE_INDEX = 2;
27 using OctalCodePtr = std::shared_ptr<unsigned char>;
28 using OctalCodePtrList = std::vector<OctalCodePtr>;
30 void printOctalCode(
const unsigned char* octalCode);
31 size_t bytesRequiredForCodeLength(
unsigned char threeBitCodes);
32 int branchIndexWithDescendant(
const unsigned char* ancestorOctalCode,
const unsigned char* descendantOctalCode);
33 unsigned char* childOctalCode(
const unsigned char* parentOctalCode,
int childNumber);
35 const int OVERFLOWED_OCTCODE_BUFFER = -1;
36 const int UNKNOWN_OCTCODE_LENGTH = -2;
41 int numberOfThreeBitSectionsInCode(
const unsigned char* octalCode,
int maxBytes = UNKNOWN_OCTCODE_LENGTH);
43 const int CHECK_NODE_ONLY = -1;
44 bool isAncestorOf(
const unsigned char* possibleAncestor,
const unsigned char* possibleDescendent,
45 int descendentsChild = CHECK_NODE_ONLY);
47 void copyFirstVertexForCode(
const unsigned char* octalCode,
float* output);
49 struct VoxelPositionSize {
52 void voxelDetailsForCode(
const unsigned char* octalCode, VoxelPositionSize& voxelPositionSize);
59 } OctalCodeComparison;
61 OctalCodeComparison compareOctalCodes(
const unsigned char* code1,
const unsigned char* code2);
63 OctalCodePtr createOctalCodePtr(
size_t size);
64 QString octalCodeToHexString(
const unsigned char* octalCode);
65 OctalCodePtr hexStringToOctalCode(
const QString& input);