Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Check for support of CUDA Memory Pools at runtime (#4679)
* Fix `toString`, `CreateFromPoints` methods and improve docs in `AxisAlignedBoundingBox`. 🐛📝
* Migrate Open3d documentation to furo theme ✨ (#6470)
* Fix geometry picker Error when LineSet objects are presented

## 0.13

Expand Down
22 changes: 19 additions & 3 deletions cpp/open3d/visualization/gui/PickPointsInteractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#include "open3d/geometry/Image.h"
#include "open3d/geometry/PointCloud.h"
#include "open3d/geometry/TriangleMesh.h"
#include "open3d/geometry/LineSet.h"
#include "open3d/t/geometry/PointCloud.h"
#include "open3d/t/geometry/TriangleMesh.h"
#include "open3d/t/geometry/LineSet.h"
#include "open3d/utility/Logging.h"
#include "open3d/visualization/gui/Events.h"
#include "open3d/visualization/rendering/MaterialRecord.h"
Expand Down Expand Up @@ -161,15 +163,28 @@ void PickPointsInteractor::SetPickableGeometry(
auto mesh = dynamic_cast<const geometry::TriangleMesh *>(pg.geometry);
auto tmesh =
dynamic_cast<const t::geometry::TriangleMesh *>(pg.tgeometry);
auto lineset = dynamic_cast<const geometry::LineSet *>(pg.geometry);
auto tlineset =
dynamic_cast<const t::geometry::LineSet *>(pg.tgeometry);
if (cloud) {
points_.insert(points_.end(), cloud->points_.begin(),
cloud->points_.end());
} else if (mesh) {
points_.insert(points_.end(), mesh->vertices_.begin(),
mesh->vertices_.end());
} else if (tcloud || tmesh) {
const auto &tpoints = (tcloud ? tcloud->GetPointPositions()
: tmesh->GetVertexPositions());
} else if (lineset) {
points_.insert(points_.end(), lineset->points_.begin(),
lineset->points_.end());
}
else if (tcloud || tmesh || tlineset) {
core::Tensor tpoints;
if(tcloud) {
tpoints = tcloud->GetPointPositions();
} else if (tmesh) {
tpoints = tmesh->GetVertexPositions();
} else if (tlineset) {
tpoints = tlineset->GetPointPositions();
}
const size_t n = tpoints.NumElements();
float *pts = (float *)tpoints.GetDataPtr();
points_.reserve(points_.size() + n);
Expand Down Expand Up @@ -203,6 +218,7 @@ void PickPointsInteractor::SetPickableGeometry(
// picking_scene_->AddGeometry(pg.name, tmesh, mat);
}
}
//TODO what about Lineset selection?
}
// add safety but invalid obj
lookup_->Add("", points_.size());
Expand Down