Commit 0c47dbc0 authored by Christopher Tenter's avatar Christopher Tenter

minor optimization

parent 348f5bc1
......@@ -1243,19 +1243,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 if (PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_VERTEX, _event->pos(), node_idx, target_idx, &hit_point)) {
} else {
// Pick point cloud
TriMesh* mesh = PluginFunctions::triMesh(object);
TriMesh::VertexHandle vh = mesh->vertex_handle(target_idx);
mesh->status(vh).set_selected(!mesh->status(vh).selected());
if (mesh->n_vertices() && !mesh->n_faces()) {
if (PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_VERTEX, _event->pos(), node_idx, target_idx, &hit_point)) {
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);
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