Commit 1528cbf7 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'selection_pointcloud' into 'master'

Point Cloud Toggle Selection

See merge request !263
parents 34073412 0c47dbc0
......@@ -1254,6 +1254,23 @@ void MeshObjectSelectionPlugin::slotToggleSelection(QMouseEvent* _event, Selecti
if (object->dataType(DATA_TRIANGLE_MESH)) {
toggleMeshSelection(object->id(), PluginFunctions::triMesh(object), target_idx, hit_point, _currentType);
}
} else {
// Pick point cloud
TriMesh* mesh = PluginFunctions::triMesh(object);
if (mesh->n_vertices() && !mesh->n_faces()) {
if (PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_VERTEX, _event->pos(), node_idx, target_idx, &hit_point)) {
TriMesh::VertexHandle vh = mesh->vertex_handle(target_idx);
mesh->status(vh).set_selected(!mesh->status(vh).selected());
if (mesh->status(vh).selected())
emit scriptInfo("selectVertices(ObjectId(" + QString::number(object->id()) + ") , [" + QString::number(vh.idx()) + "])");
else
emit scriptInfo("unselectVertices(ObjectId(" + QString::number(object->id()) + ") , [" + QString::number(vh.idx()) + "])");
emit updatedObject(object->id(), UPDATE_SELECTION_VERTICES);
}
}
}
} else if (object->dataType() == DATA_POLY_MESH) {
// Pick poly meshes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment