Skip to content

Commit

Permalink
SelectMBRs: terminating at points
Browse files Browse the repository at this point in the history
  • Loading branch information
nutanong committed Jun 1, 2011
1 parent e3d9eb3 commit 0118b0b
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions src/rtree/RTree.cc
Expand Up @@ -757,12 +757,33 @@ void SpatialIndex::RTree::RTree::selectMBRs(const int num) {
queue.push(pEntry);
}
} else {
IShape *pShape;
n->getShape(&pShape);
Region *pMBR = new Region(2);
pShape->getMBR(*pMBR);
m_vec_pMBR.push_back(pMBR);
delete pShape;
for (uint32_t cChild = 0; cChild < n->m_children; ++cChild)
{
//double area = n->m_ptrMBR[cChild]->getArea();
//Data* e = new Data(n->m_pDataLength[cChild],
//n->m_pData[cChild],
//*(n->m_ptrMBR[cChild]),
//n->m_pIdentifier[cChild]);

Region *pMBR = new Region(*(n->m_ptrMBR[cChild]));
m_vec_pMBR.push_back(pMBR);

//std::cout << "Adding Point ";
//std::cout << pMBR->m_pLow[0] << " " << pMBR->m_pLow[1] << " ";
//std::cout << pMBR->m_pHigh[0] << " " << pMBR->m_pHigh[1] << std::endl;

//NNEntry *pEntry = new NNEntry(n->m_pIdentifier[cChild], e, -area);
//queue.push(pEntry);
}



//IShape *pShape;
//n->getShape(&pShape);
//Region *pMBR = new Region(2);
//pShape->getMBR(*pMBR);
//m_vec_pMBR.push_back(pMBR);
//delete pShape;
}

if (pFirst->m_pEntry != NULL) delete pFirst->m_pEntry;
Expand Down

0 comments on commit 0118b0b

Please sign in to comment.