Skip to content

Commit

Permalink
call updatePointCount repetitively
Browse files Browse the repository at this point in the history
  • Loading branch information
nutanong committed Jun 1, 2011
1 parent 5be144a commit 42afbd3
Show file tree
Hide file tree
Showing 2 changed files with 219 additions and 211 deletions.
10 changes: 6 additions & 4 deletions src/rtree/Node.cc
Expand Up @@ -56,6 +56,7 @@ int Node::updatePointCount() {

if (this->isLeaf()) {
this->m_pointCount = this->getChildrenCount();
std::cout << this->m_level << " " << this->m_children << std::endl;

} else {
this->m_pointCount = 0;
Expand All @@ -66,6 +67,7 @@ int Node::updatePointCount() {
}
}


return this->m_pointCount;
}

Expand All @@ -82,8 +84,8 @@ void Node::loadFromByteArray(const byte* ptr)
memcpy(&m_children, ptr, sizeof(uint32_t));
ptr += sizeof(uint32_t);

memcpy(&m_pointCount, ptr, sizeof(int));
ptr += sizeof(int);
//memcpy(&m_pointCount, ptr, sizeof(uint32_t));
//ptr += sizeof(uint32_t);

for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
{
Expand Down Expand Up @@ -142,8 +144,8 @@ void Node::storeToByteArray(byte** data, uint32_t& len)
memcpy(ptr, &m_children, sizeof(uint32_t));
ptr += sizeof(uint32_t);

memcpy(ptr, &m_pointCount, sizeof(int));
ptr += sizeof(int);
//memcpy(ptr, &m_pointCount, sizeof(uint32_t));
//ptr += sizeof(uint32_t);

for (uint32_t u32Child = 0; u32Child < m_children; ++u32Child)
{
Expand Down

0 comments on commit 42afbd3

Please sign in to comment.