58 (m_children * (m_pTree->m_dimension *
sizeof(
double) * 2 +
sizeof(
id_type) +
sizeof(uint32_t))) +
60 (2 * m_pTree->m_dimension *
sizeof(
double)));
65 m_nodeMBR = m_pTree->m_infiniteRegion;
68 ptr +=
sizeof(uint32_t);
70 memcpy(&m_level, ptr,
sizeof(uint32_t));
71 ptr +=
sizeof(uint32_t);
73 memcpy(&m_children, ptr,
sizeof(uint32_t));
74 ptr +=
sizeof(uint32_t);
76 for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
78 m_ptrMBR[u32Child] = m_pTree->m_regionPool.
acquire();
79 *(m_ptrMBR[u32Child]) = m_pTree->m_infiniteRegion;
81 memcpy(m_ptrMBR[u32Child]->m_pLow, ptr, m_pTree->m_dimension *
sizeof(
double));
82 ptr += m_pTree->m_dimension *
sizeof(double);
83 memcpy(m_ptrMBR[u32Child]->m_pHigh, ptr, m_pTree->m_dimension *
sizeof(
double));
84 ptr += m_pTree->m_dimension *
sizeof(double);
85 memcpy(&(m_pIdentifier[u32Child]), ptr,
sizeof(
id_type));
88 memcpy(&(m_pDataLength[u32Child]), ptr,
sizeof(uint32_t));
89 ptr +=
sizeof(uint32_t);
91 if (m_pDataLength[u32Child] > 0)
93 m_totalDataLength += m_pDataLength[u32Child];
94 m_pData[u32Child] =
new uint8_t[m_pDataLength[u32Child]];
95 memcpy(m_pData[u32Child], ptr, m_pDataLength[u32Child]);
96 ptr += m_pDataLength[u32Child];
100 m_pData[u32Child] =
nullptr;
106 memcpy(m_nodeMBR.
m_pLow, ptr, m_pTree->m_dimension *
sizeof(
double));
107 ptr += m_pTree->m_dimension *
sizeof(double);
108 memcpy(m_nodeMBR.
m_pHigh, ptr, m_pTree->m_dimension *
sizeof(
double));
116 *data =
new uint8_t[len];
117 uint8_t* ptr = *data;
124 memcpy(ptr, &nodeType,
sizeof(uint32_t));
125 ptr +=
sizeof(uint32_t);
127 memcpy(ptr, &m_level,
sizeof(uint32_t));
128 ptr +=
sizeof(uint32_t);
130 memcpy(ptr, &m_children,
sizeof(uint32_t));
131 ptr +=
sizeof(uint32_t);
133 for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
135 memcpy(ptr, m_ptrMBR[u32Child]->m_pLow, m_pTree->m_dimension *
sizeof(
double));
136 ptr += m_pTree->m_dimension *
sizeof(double);
137 memcpy(ptr, m_ptrMBR[u32Child]->m_pHigh, m_pTree->m_dimension *
sizeof(
double));
138 ptr += m_pTree->m_dimension *
sizeof(double);
139 memcpy(ptr, &(m_pIdentifier[u32Child]),
sizeof(
id_type));
142 memcpy(ptr, &(m_pDataLength[u32Child]),
sizeof(uint32_t));
143 ptr +=
sizeof(uint32_t);
145 if (m_pDataLength[u32Child] > 0)
147 memcpy(ptr, m_pData[u32Child], m_pDataLength[u32Child]);
148 ptr += m_pDataLength[u32Child];
153 memcpy(ptr, m_nodeMBR.
m_pLow, m_pTree->m_dimension *
sizeof(
double));
154 ptr += m_pTree->m_dimension *
sizeof(double);
155 memcpy(ptr, m_nodeMBR.
m_pHigh, m_pTree->m_dimension *
sizeof(
double));
158 assert(len == (ptr - *data) + m_pTree->m_dimension *
sizeof(
double));
171 *out =
new Region(m_nodeMBR);
186 return m_pIdentifier[
index];
193 *out =
new Region(*(m_ptrMBR[index]));
199 if (m_pData[index] ==
nullptr)
206 length = m_pDataLength[
index];
207 *data = m_pData[
index];
218 return (m_level == 0);
223 return (m_level != 0);
238 m_capacity(capacity),
241 m_pIdentifier(
nullptr),
242 m_pDataLength(
nullptr),
249 m_pDataLength =
new uint32_t[m_capacity + 1];
250 m_pData =
new uint8_t*[m_capacity + 1];
251 m_ptrMBR =
new RegionPtr[m_capacity + 1];
252 m_pIdentifier =
new id_type[m_capacity + 1];
256 delete[] m_pDataLength;
259 delete[] m_pIdentifier;
266 if (m_pData !=
nullptr)
268 for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
270 if (m_pData[u32Child] !=
nullptr)
delete[] m_pData[u32Child];
276 delete[] m_pDataLength;
278 delete[] m_pIdentifier;
286 void Node::insertEntry(uint32_t dataLength, uint8_t* pData,
Region& mbr,
id_type id)
288 assert(m_children < m_capacity);
290 m_pDataLength[m_children] = dataLength;
291 m_pData[m_children] = pData;
292 m_ptrMBR[m_children] = m_pTree->m_regionPool.
acquire();
293 *(m_ptrMBR[m_children]) = mbr;
294 m_pIdentifier[m_children] = id;
296 m_totalDataLength += dataLength;
302 void Node::deleteEntry(uint32_t
index)
304 assert(index >= 0 && index < m_children);
309 m_totalDataLength -= m_pDataLength[
index];
310 if (m_pData[index] !=
nullptr)
delete[] m_pData[
index];
312 if (m_children > 1 && index != m_children - 1)
314 m_pDataLength[
index] = m_pDataLength[m_children - 1];
315 m_pData[
index] = m_pData[m_children - 1];
316 m_ptrMBR[
index] = m_ptrMBR[m_children - 1];
317 m_pIdentifier[
index] = m_pIdentifier[m_children - 1];
326 m_nodeMBR = m_pTree->m_infiniteRegion;
328 else if (m_pTree->m_bTightMBRs && m_nodeMBR.
touchesRegion(*ptrR))
330 for (uint32_t cDim = 0; cDim < m_nodeMBR.
m_dimension; ++cDim)
332 m_nodeMBR.
m_pLow[cDim] = std::numeric_limits<double>::max();
333 m_nodeMBR.
m_pHigh[cDim] = -std::numeric_limits<double>::max();
335 for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
337 m_nodeMBR.
m_pLow[cDim] = std::min(m_nodeMBR.
m_pLow[cDim], m_ptrMBR[u32Child]->
m_pLow[cDim]);
344 bool Node::insertData(uint32_t dataLength, uint8_t* pData,
Region& mbr,
id_type id, std::stack<id_type>& pathBuffer, uint8_t* overflowTable)
346 if (m_children < m_capacity)
348 bool adjusted =
false;
353 insertEntry(dataLength, pData, mbr,
id);
354 m_pTree->writeNode(
this);
356 if ((! b) && (! pathBuffer.empty()))
358 id_type cParent = pathBuffer.top(); pathBuffer.pop();
359 NodePtr ptrN = m_pTree->readNode(cParent);
367 else if (m_pTree->m_treeVariant ==
RV_RSTAR && (! pathBuffer.empty()) && overflowTable[m_level] == 0)
369 overflowTable[m_level] = 1;
371 std::vector<uint32_t> vReinsert, vKeep;
372 reinsertData(dataLength, pData, mbr,
id, vReinsert, vKeep);
374 uint32_t lReinsert =
static_cast<uint32_t
>(vReinsert.size());
375 uint32_t lKeep =
static_cast<uint32_t
>(vKeep.size());
377 uint8_t** reinsertdata =
nullptr;
380 uint32_t* reinsertlen =
nullptr;
381 uint8_t** keepdata =
nullptr;
384 uint32_t* keeplen =
nullptr;
388 reinsertdata =
new uint8_t*[lReinsert];
390 reinsertid =
new id_type[lReinsert];
391 reinsertlen =
new uint32_t[lReinsert];
393 keepdata =
new uint8_t*[m_capacity + 1];
395 keepid =
new id_type[m_capacity + 1];
396 keeplen =
new uint32_t[m_capacity + 1];
400 delete[] reinsertdata;
401 delete[] reinsertmbr;
403 delete[] reinsertlen;
413 for (cIndex = 0; cIndex < lReinsert; ++cIndex)
415 reinsertlen[cIndex] = m_pDataLength[vReinsert[cIndex]];
416 reinsertdata[cIndex] = m_pData[vReinsert[cIndex]];
417 reinsertmbr[cIndex] = m_ptrMBR[vReinsert[cIndex]];
418 reinsertid[cIndex] = m_pIdentifier[vReinsert[cIndex]];
421 for (cIndex = 0; cIndex < lKeep; ++cIndex)
423 keeplen[cIndex] = m_pDataLength[vKeep[cIndex]];
424 keepdata[cIndex] = m_pData[vKeep[cIndex]];
425 keepmbr[cIndex] = m_ptrMBR[vKeep[cIndex]];
426 keepid[cIndex] = m_pIdentifier[vKeep[cIndex]];
429 delete[] m_pDataLength;
432 delete[] m_pIdentifier;
434 m_pDataLength = keeplen;
437 m_pIdentifier = keepid;
439 m_totalDataLength = 0;
441 for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child) m_totalDataLength += m_pDataLength[u32Child];
443 for (uint32_t cDim = 0; cDim < m_nodeMBR.
m_dimension; ++cDim)
445 m_nodeMBR.
m_pLow[cDim] = std::numeric_limits<double>::max();
446 m_nodeMBR.
m_pHigh[cDim] = -std::numeric_limits<double>::max();
448 for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
450 m_nodeMBR.
m_pLow[cDim] = std::min(m_nodeMBR.
m_pLow[cDim], m_ptrMBR[u32Child]->
m_pLow[cDim]);
455 m_pTree->writeNode(
this);
460 id_type cParent = pathBuffer.top(); pathBuffer.pop();
461 NodePtr ptrN = m_pTree->readNode(cParent);
465 for (cIndex = 0; cIndex < lReinsert; ++cIndex)
467 m_pTree->insertData_impl(
468 reinsertlen[cIndex], reinsertdata[cIndex],
469 *(reinsertmbr[cIndex]), reinsertid[cIndex],
470 m_level, overflowTable);
473 delete[] reinsertdata;
474 delete[] reinsertmbr;
476 delete[] reinsertlen;
484 split(dataLength, pData, mbr,
id, n, nn);
486 if (pathBuffer.empty())
488 n->m_level = m_level;
489 nn->m_level = m_level;
490 n->m_identifier = -1;
491 nn->m_identifier = -1;
492 m_pTree->writeNode(n.
get());
493 m_pTree->writeNode(nn.
get());
496 if (ptrR.
get() ==
nullptr)
498 ptrR =
NodePtr(
new Index(m_pTree, m_pTree->m_rootID, m_level + 1), &(m_pTree->m_indexPool));
503 ptrR->m_identifier = m_pTree->m_rootID;
504 ptrR->m_level = m_level + 1;
505 ptrR->m_nodeMBR = m_pTree->m_infiniteRegion;
508 ptrR->insertEntry(0,
nullptr, n->m_nodeMBR, n->m_identifier);
509 ptrR->insertEntry(0,
nullptr, nn->m_nodeMBR, nn->m_identifier);
511 m_pTree->writeNode(ptrR.
get());
513 m_pTree->m_stats.m_nodesInLevel[m_level] = 2;
514 m_pTree->m_stats.m_nodesInLevel.push_back(1);
515 m_pTree->m_stats.m_u32TreeHeight = m_level + 2;
519 n->m_level = m_level;
520 nn->m_level = m_level;
521 n->m_identifier = m_identifier;
522 nn->m_identifier = -1;
524 m_pTree->writeNode(n.
get());
525 m_pTree->writeNode(nn.
get());
527 id_type cParent = pathBuffer.top(); pathBuffer.pop();
528 NodePtr ptrN = m_pTree->readNode(cParent);
537 void Node::reinsertData(uint32_t dataLength, uint8_t* pData,
Region& mbr,
id_type id, std::vector<uint32_t>& reinsert, std::vector<uint32_t>& keep)
539 ReinsertEntry** v =
new ReinsertEntry*[m_capacity + 1];
541 m_pDataLength[m_children] = dataLength;
542 m_pData[m_children] = pData;
543 m_ptrMBR[m_children] = m_pTree->m_regionPool.
acquire();
544 *(m_ptrMBR[m_children]) = mbr;
545 m_pIdentifier[m_children] = id;
547 PointPtr nc = m_pTree->m_pointPool.acquire();
549 PointPtr c = m_pTree->m_pointPool.acquire();
551 for (uint32_t u32Child = 0; u32Child < m_capacity + 1; ++u32Child)
555 v[u32Child] =
new ReinsertEntry(u32Child, 0.0);
559 for (uint32_t i = 0; i < u32Child; ++i)
delete v[i];
567 for (uint32_t cDim = 0; cDim < m_nodeMBR.
m_dimension; ++cDim)
569 double d = nc->m_pCoords[cDim] - c->m_pCoords[cDim];
570 v[u32Child]->m_dist += d * d;
575 ::qsort(v, m_capacity + 1,
sizeof(ReinsertEntry*), ReinsertEntry::compareReinsertEntry);
577 uint32_t cReinsert =
static_cast<uint32_t
>(std::floor((m_capacity + 1) * m_pTree->m_reinsertFactor));
581 for (cCount = 0; cCount < m_capacity + 1; ++cCount)
583 if (cCount < m_capacity + 1 - cReinsert)
586 keep.push_back(v[cCount]->m_index);
594 reinsert.push_back(v[cCount]->m_index);
602 void Node::rtreeSplit(uint32_t dataLength, uint8_t* pData,
Region& mbr,
id_type id, std::vector<uint32_t>& group1, std::vector<uint32_t>& group2)
605 uint32_t minimumLoad =
static_cast<uint32_t
>(std::floor(m_capacity * m_pTree->m_fillFactor));
608 uint8_t* mask =
new uint8_t[m_capacity + 1];
609 memset(mask, 0, m_capacity + 1);
613 m_pDataLength[m_capacity] = dataLength;
614 m_pData[m_capacity] = pData;
615 m_ptrMBR[m_capacity] = m_pTree->m_regionPool.
acquire();
616 *(m_ptrMBR[m_capacity]) = mbr;
617 m_pIdentifier[m_capacity] = id;
621 uint32_t seed1, seed2;
622 pickSeeds(seed1, seed2);
624 group1.push_back(seed1);
625 group2.push_back(seed2);
632 *mbr1 = *(m_ptrMBR[seed1]);
634 *mbr2 = *(m_ptrMBR[seed2]);
637 uint32_t cRemaining = m_capacity + 1 - 2;
639 while (cRemaining > 0)
641 if (minimumLoad - group1.size() == cRemaining)
644 for (u32Child = 0; u32Child < m_capacity + 1; ++u32Child)
646 if (mask[u32Child] == 0)
648 group1.push_back(u32Child);
654 else if (minimumLoad - group2.size() == cRemaining)
657 for (u32Child = 0; u32Child < m_capacity + 1; ++u32Child)
659 if (mask[u32Child] == 0)
661 group2.push_back(u32Child);
673 double md1 = 0.0, md2 = 0.0;
674 double m = -std::numeric_limits<double>::max();
682 for (u32Child = 0; u32Child < m_capacity + 1; ++u32Child)
684 if (mask[u32Child] == 0)
690 d = std::abs(d1 - d2);
697 if (m_pTree->m_treeVariant==
RV_LINEAR || m_pTree->m_treeVariant ==
RV_RSTAR)
break;
707 group1.push_back(sel);
712 group2.push_back(sel);
717 group1.push_back(sel);
722 group2.push_back(sel);
725 else if (group1.size() < group2.size())
727 group1.push_back(sel);
730 else if (group2.size() < group1.size())
732 group2.push_back(sel);
737 group1.push_back(sel);
756 void Node::rstarSplit(uint32_t dataLength, uint8_t* pData,
Region& mbr,
id_type id, std::vector<uint32_t>& group1, std::vector<uint32_t>& group2)
758 RstarSplitEntry** dataLow =
nullptr;
759 RstarSplitEntry** dataHigh =
nullptr;
763 dataLow =
new RstarSplitEntry*[m_capacity + 1];
764 dataHigh =
new RstarSplitEntry*[m_capacity + 1];
772 m_pDataLength[m_capacity] = dataLength;
773 m_pData[m_capacity] = pData;
774 m_ptrMBR[m_capacity] = m_pTree->m_regionPool.
acquire();
775 *(m_ptrMBR[m_capacity]) = mbr;
776 m_pIdentifier[m_capacity] = id;
779 uint32_t nodeSPF =
static_cast<uint32_t
>(
780 std::floor((m_capacity + 1) * m_pTree->m_splitDistributionFactor));
781 uint32_t splitDistribution = (m_capacity + 1) - (2 * nodeSPF) + 2;
783 uint32_t u32Child = 0, cDim, cIndex;
785 for (u32Child = 0; u32Child <= m_capacity; ++u32Child)
789 dataLow[u32Child] =
new RstarSplitEntry(m_ptrMBR[u32Child].
get(), u32Child, 0);
793 for (uint32_t i = 0; i < u32Child; ++i)
delete dataLow[i];
799 dataHigh[u32Child] = dataLow[u32Child];
802 double minimumMargin = std::numeric_limits<double>::max();
803 uint32_t splitAxis = std::numeric_limits<uint32_t>::max();
804 uint32_t sortOrder = std::numeric_limits<uint32_t>::max();
807 for (cDim = 0; cDim < m_pTree->m_dimension; ++cDim)
809 ::qsort(dataLow, m_capacity + 1,
sizeof(RstarSplitEntry*), RstarSplitEntry::compareLow);
810 ::qsort(dataHigh, m_capacity + 1,
sizeof(RstarSplitEntry*), RstarSplitEntry::compareHigh);
813 double marginl = 0.0;
814 double marginh = 0.0;
816 Region bbl1, bbl2, bbh1, bbh2;
818 for (u32Child = 1; u32Child <= splitDistribution; ++u32Child)
820 uint32_t l = nodeSPF - 1 + u32Child;
822 bbl1 = *(dataLow[0]->m_pRegion);
823 bbh1 = *(dataHigh[0]->m_pRegion);
825 for (cIndex = 1; cIndex < l; ++cIndex)
831 bbl2 = *(dataLow[l]->m_pRegion);
832 bbh2 = *(dataHigh[l]->m_pRegion);
834 for (cIndex = l + 1; cIndex <= m_capacity; ++cIndex)
844 double margin = std::min(marginl, marginh);
847 if (margin < minimumMargin)
849 minimumMargin = margin;
851 sortOrder = (marginl < marginh) ? 0 : 1;
855 for (u32Child = 0; u32Child <= m_capacity; ++u32Child)
857 dataLow[u32Child]->m_sortDim = cDim + 1;
861 for (u32Child = 0; u32Child <= m_capacity; ++u32Child)
863 dataLow[u32Child]->m_sortDim = splitAxis;
866 ::qsort(dataLow, m_capacity + 1,
sizeof(RstarSplitEntry*), (sortOrder == 0) ? RstarSplitEntry::compareLow : RstarSplitEntry::compareHigh);
868 double ma = std::numeric_limits<double>::max();
869 double mo = std::numeric_limits<double>::max();
870 uint32_t splitPoint = std::numeric_limits<uint32_t>::max();
874 for (u32Child = 1; u32Child <= splitDistribution; ++u32Child)
876 uint32_t l = nodeSPF - 1 + u32Child;
878 bb1 = *(dataLow[0]->m_pRegion);
880 for (cIndex = 1; cIndex < l; ++cIndex)
885 bb2 = *(dataLow[l]->m_pRegion);
887 for (cIndex = l + 1; cIndex <= m_capacity; ++cIndex)
896 splitPoint = u32Child;
906 splitPoint = u32Child;
912 uint32_t l1 = nodeSPF - 1 + splitPoint;
914 for (cIndex = 0; cIndex < l1; ++cIndex)
916 group1.push_back(dataLow[cIndex]->m_index);
917 delete dataLow[cIndex];
920 for (cIndex = l1; cIndex <= m_capacity; ++cIndex)
922 group2.push_back(dataLow[cIndex]->m_index);
923 delete dataLow[cIndex];
930 void Node::pickSeeds(uint32_t& index1, uint32_t& index2)
932 double separation = -std::numeric_limits<double>::max();
933 double inefficiency = -std::numeric_limits<double>::max();
934 uint32_t cDim, u32Child, cIndex;
936 switch (m_pTree->m_treeVariant)
940 for (cDim = 0; cDim < m_pTree->m_dimension; ++cDim)
942 double leastLower = m_ptrMBR[0]->
m_pLow[cDim];
943 double greatestUpper = m_ptrMBR[0]->
m_pHigh[cDim];
944 uint32_t greatestLower = 0;
945 uint32_t leastUpper = 0;
948 for (u32Child = 1; u32Child <= m_capacity; ++u32Child)
950 if (m_ptrMBR[u32Child]->m_pLow[cDim] > m_ptrMBR[greatestLower]->m_pLow[cDim]) greatestLower = u32Child;
951 if (m_ptrMBR[u32Child]->m_pHigh[cDim] < m_ptrMBR[leastUpper]->m_pHigh[cDim]) leastUpper = u32Child;
953 leastLower = std::min(m_ptrMBR[u32Child]->m_pLow[cDim], leastLower);
954 greatestUpper = std::max(m_ptrMBR[u32Child]->m_pHigh[cDim], greatestUpper);
957 width = greatestUpper - leastLower;
958 if (width <= 0) width = 1;
960 double f = (m_ptrMBR[greatestLower]->
m_pLow[cDim] - m_ptrMBR[leastUpper]->
m_pHigh[cDim]) / width;
965 index2 = greatestLower;
970 if (index1 == index2)
972 if (index2 == 0) ++index2;
979 for (u32Child = 0; u32Child < m_capacity; ++u32Child)
981 double a = m_ptrMBR[u32Child]->
getArea();
983 for (cIndex = u32Child + 1; cIndex <= m_capacity; ++cIndex)
992 if (d > inefficiency)
1007 void Node::condenseTree(std::stack<NodePtr>& toReinsert, std::stack<id_type>& pathBuffer,
NodePtr& ptrThis)
1009 uint32_t minimumLoad =
static_cast<uint32_t
>(std::floor(m_capacity * m_pTree->m_fillFactor));
1011 if (pathBuffer.empty())
1014 if (m_level != 0 && m_children == 1)
1016 NodePtr ptrN = m_pTree->readNode(m_pIdentifier[0]);
1017 m_pTree->deleteNode(ptrN.
get());
1018 ptrN->m_identifier = m_pTree->m_rootID;
1019 m_pTree->writeNode(ptrN.
get());
1021 m_pTree->m_stats.m_nodesInLevel.pop_back();
1022 m_pTree->m_stats.m_u32TreeHeight -= 1;
1024 m_pTree->m_stats.m_nodesInLevel[m_pTree->m_stats.m_u32TreeHeight - 1] = 2;
1029 if (m_pTree->m_bTightMBRs)
1031 for (uint32_t cDim = 0; cDim < m_nodeMBR.
m_dimension; ++cDim)
1033 m_nodeMBR.
m_pLow[cDim] = std::numeric_limits<double>::max();
1034 m_nodeMBR.
m_pHigh[cDim] = -std::numeric_limits<double>::max();
1036 for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
1038 m_nodeMBR.
m_pLow[cDim] = std::min(m_nodeMBR.
m_pLow[cDim], m_ptrMBR[u32Child]->
m_pLow[cDim]);
1045 m_pTree->writeNode(
this);
1050 id_type cParent = pathBuffer.top(); pathBuffer.pop();
1051 NodePtr ptrParent = m_pTree->readNode(cParent);
1057 for (child = 0; child != p->m_children; ++child)
1059 if (p->m_pIdentifier[child] == m_identifier)
break;
1062 if (m_children < minimumLoad)
1066 p->deleteEntry(child);
1068 toReinsert.push(ptrThis);
1073 *(p->m_ptrMBR[child]) = m_nodeMBR;
1077 if (m_pTree->m_bTightMBRs)
1079 for (uint32_t cDim = 0; cDim < p->m_nodeMBR.m_dimension; ++cDim)
1081 p->m_nodeMBR.m_pLow[cDim] = std::numeric_limits<double>::max();
1082 p->m_nodeMBR.m_pHigh[cDim] = -std::numeric_limits<double>::max();
1084 for (uint32_t u32Child = 0; u32Child < p->m_children; ++u32Child)
1086 p->m_nodeMBR.m_pLow[cDim] = std::min(p->m_nodeMBR.m_pLow[cDim], p->m_ptrMBR[u32Child]->m_pLow[cDim]);
1087 p->m_nodeMBR.m_pHigh[cDim] = std::max(p->m_nodeMBR.m_pHigh[cDim], p->m_ptrMBR[u32Child]->m_pHigh[cDim]);
1094 m_pTree->writeNode(p);
1096 p->condenseTree(toReinsert, pathBuffer, ptrParent);
bool isIndex() const override
virtual bool containsRegion(const Region &in) const
void adjustTree(Node *, std::stack< id_type > &, bool force=false)
virtual bool touchesRegion(const Region &in) const
void loadFromByteArray(const uint8_t *data) override
virtual double getIntersectingArea(const Region &in) const
virtual void getCombinedRegion(Region &out, const Region &in) const
void getShape(IShape **out) const override
void getChildShape(uint32_t index, IShape **out) const override
uint32_t getChildrenCount() const override
uint32_t getLevel() const override
void getChildData(uint32_t index, uint32_t &length, uint8_t **data) const override
virtual void combineRegion(const Region &in)
double getArea() const override
Tools::IObject * clone() override
virtual void makeInfinite(uint32_t dimension)
Tools::PoolPointer< Node > NodePtr
void storeToByteArray(uint8_t **data, uint32_t &len) override
virtual double getMargin() const
bool isLeaf() const override
uint32_t getByteArraySize() override
id_type getIdentifier() const override
SpatialIndex::ISpatialIndex & index()
id_type getChildIdentifier(uint32_t index) const override
void getCenter(Point &out) const override