Ejemplo n.º 1
0
 foreach (QGraphicsItem *item, ipItems) {
     if (toGroup(item)) {
         addItems(toGroup(item)->children());
         createItemGroup(toGroup(item)->children());
     } else if (toDbObject(item)) {
         addItem(item);
     }
 }
Ejemplo n.º 2
0
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);
    }
}
Ejemplo n.º 3
0
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);
    }
}