@@ -323,29 +323,27 @@ void Mainframe::updateOccludedVoxels() {
323
323
}
324
324
325
325
void Mainframe::updateInvalidVoxels () {
326
- if (invalidVoxels_.size () > 0 ) {
327
- std::vector<LabeledVoxel> voxels;
326
+ std::vector<LabeledVoxel> voxels;
328
327
329
- float voxelSize = pastVoxelGrid_.resolution ();
330
- Eigen::Vector4f offset = pastVoxelGrid_.offset ();
328
+ float voxelSize = pastVoxelGrid_.resolution ();
329
+ Eigen::Vector4f offset = pastVoxelGrid_.offset ();
331
330
332
- for (uint32_t x = 0 ; x < pastVoxelGrid_.size (0 ); ++x) {
333
- for (uint32_t y = 0 ; y < pastVoxelGrid_.size (1 ); ++y) {
334
- for (uint32_t z = 0 ; z < pastVoxelGrid_.size (2 ); ++z) {
335
- if (!pastVoxelGrid_.isInvalid (x, y, z)) continue ;
331
+ for (uint32_t x = 0 ; x < pastVoxelGrid_.size (0 ); ++x) {
332
+ for (uint32_t y = 0 ; y < pastVoxelGrid_.size (1 ); ++y) {
333
+ for (uint32_t z = 0 ; z < pastVoxelGrid_.size (2 ); ++z) {
334
+ if (!pastVoxelGrid_.isInvalid (x, y, z)) continue ;
336
335
337
- LabeledVoxel lv;
338
- Eigen::Vector4f pos =
339
- offset + Eigen::Vector4f (x * voxelSize + 0.1 , y * voxelSize + 0.1 , z * voxelSize + 0.1 , 0 .0f );
340
- lv.position = vec3 (pos.x (), pos.y (), pos.z ());
341
- lv.label = 11 ;
342
- voxels.push_back (lv);
343
- }
336
+ LabeledVoxel lv;
337
+ Eigen::Vector4f pos =
338
+ offset + Eigen::Vector4f (x * voxelSize + 0.1 , y * voxelSize + 0.1 , z * voxelSize + 0.1 , 0 .0f );
339
+ lv.position = vec3 (pos.x (), pos.y (), pos.z ());
340
+ lv.label = 11 ;
341
+ voxels.push_back (lv);
344
342
}
345
343
}
346
-
347
- ui.mViewportXYZ ->setInvalidVoxels (voxels);
348
344
}
345
+
346
+ ui.mViewportXYZ ->setInvalidVoxels (voxels);
349
347
}
350
348
351
349
void Mainframe::extractLabeledVoxels (const VoxelGrid& grid, std::vector<LabeledVoxel>& labeledVoxels) {
0 commit comments