Showing the changes to interface/src/VoxelSystem.cpp (1 of 26 files). Show all
Unified · Split
| @@ -1530,10 +1530,38 @@ void VoxelSystem::falseColorizeOccludedV2() { · 1529 unmodified lines | ||
| 1530 | 1530 | VoxelProjectedPolygon::intersects_calls |
| 1531 | 1531 | ); |
| 1532 | 1532 | //myCoverageMapV2.erase(); |
| 1533 | − | |
| 1534 | − | |
| 1535 | 1533 | _tree->setDirtyBit(); |
| 1536 | 1534 | setupNewVoxelsForDrawing(); |
| 1537 | 1535 | } |
| 1538 | 1536 | |
| 1537 | +void VoxelSystem::nodeAdded(Node* node) { | |
| 1538 | + if (node->getType() == NODE_TYPE_VOXEL_SERVER) { | |
| 1539 | + uint16_t nodeID = node->getNodeID(); | |
| 1540 | + printf("VoxelSystem... voxel server %u added...\n", nodeID); | |
| 1541 | + } | |
| 1542 | +} | |
| 1543 | + | |
| 1544 | +bool VoxelSystem::killSourceVoxelsOperation(VoxelNode* node, void* extraData) { | |
| 1545 | + uint16_t killedNodeID = *(uint16_t*)extraData; | |
| 1546 | + for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { | |
| 1547 | + VoxelNode* childNode = node->getChildAtIndex(i); | |
| 1548 | + if (childNode && childNode->getSourceID()== killedNodeID) { | |
| 1549 | + node->safeDeepDeleteChildAtIndex(i); | |
| 1550 | + } | |
| 1551 | + } | |
| 1552 | + return true; | |
| 1553 | +} | |
| 1554 | + | |
| 1555 | +void VoxelSystem::nodeKilled(Node* node) { | |
| 1556 | + if (node->getType() == NODE_TYPE_VOXEL_SERVER) { | |
| 1557 | + uint16_t nodeID = node->getNodeID(); | |
| 1558 | + printf("VoxelSystem... voxel server %u removed...\n", nodeID); | |
| 1559 | + | |
| 1560 | + // Kill any voxels from the local tree | |
| 1561 | + _tree->recurseTreeWithOperation(killSourceVoxelsOperation, &nodeID); | |
| 1562 | + _tree->setDirtyBit(); | |
| 1563 | + setupNewVoxelsForDrawing(); | |
| 1564 | + } | |
| 1565 | +} | |
| 1566 | + | |
| 1539 | 1567 | |