foreach (QGraphicsItem *item, ipItems) { if (toGroup(item)) { addItems(toGroup(item)->children()); createItemGroup(toGroup(item)->children()); } else if (toDbObject(item)) { addItem(item); } }
VoxelTreeNode::VoxelTreeNode(VoxelTree* voxelTree, const GridAABB &gridAABB, VoxelTreeNode* initialSubnode): VoxelTreeNode(0, voxelTree, nullptr, gridAABB) { toGroup(); delete m_subnodes[0]; m_subnodes[0] = initialSubnode; initialSubnode->setParent(this); if(initialSubnode->active()) { subnodeActivated(initialSubnode); } }
void VoxelTreeNode::insert(Voxel* voxel) { assert(m_gridAABB.contains(voxel->cell())); if (isAtomic()) { assert(m_voxel == nullptr); m_voxel = voxel; m_voxel->setVoxelTreeNode(this); setActive(true); } else { if (isLeaf()) { toGroup(); } cellSubnode(voxel->cell())->insert(voxel); } }