Showing the changes to interface/src/VoxelSystem.cpp (1 of 7 files). Show all
Unified · Split
| @@ -84,11 +84,20 @@ void VoxelSystem::createSphere(float r,float xc, float yc, float zc, float s, bo · 83 unmodified lines | ||
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | void VoxelSystem::parseData(void *data, int size) { |
| 87 | − // output the bits received from the voxel server | |
| 87 | + | |
| 88 | + unsigned char command = *(unsigned char*)data; | |
| 88 | 89 | unsigned char *voxelData = (unsigned char *) data + 1; |
| 89 | 90 | |
| 90 | − // ask the VoxelTree to read the bitstream into the tree | |
| 91 | − tree->readBitstreamToTree(voxelData, size - 1); | |
| 91 | + switch(command) { | |
| 92 | + case 'V': | |
| 93 | + // ask the VoxelTree to read the bitstream into the tree | |
| 94 | + tree->readBitstreamToTree(voxelData, size - 1); | |
| 95 | + break; | |
| 96 | + case 'R': | |
| 97 | + // ask the tree to read the "remove" bitstream | |
| 98 | + tree->processRemoveVoxelBitstream((unsigned char*)data,size); | |
| 99 | + break; | |
| 100 | + } | |
| 92 | 101 | |
| 93 | 102 | setupNewVoxelsForDrawing(); |
| 94 | 103 | } |