Commit 6877f111 authored by Matthias Möller's avatar Matthias Möller

infoMesh support for point clouds or other types without faces

refs #498

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14319 383ad7c9-94d9-4d36-a494-682f7c89f535
parent caf65bd7
......@@ -660,11 +660,17 @@ InfoMeshObjectPlugin::
// Only respond on mesh objects
if((_type != DATA_TRIANGLE_MESH) && (_type != DATA_POLY_MESH)) return;
ACG::SceneGraph::PickTarget target = ACG::SceneGraph::PICK_FACE;
ACG::SceneGraph::PickTarget target = ACG::SceneGraph::PICK_ANYTHING;
if(info_->pickMode->currentText().contains("PICK_EDGES") ) {
if (info_->isHidden())
target = ACG::SceneGraph::PICK_ANYTHING;
else
{
//user has selected the pick mode manually
target = ACG::SceneGraph::PICK_FACE;
if (info_->pickMode->currentIndex() == 1 )
target = ACG::SceneGraph::PICK_EDGE;
} else if (info_->pickMode->currentText().contains("PICK_VERTICES")) {
else if (info_->pickMode->currentIndex() == 2 )
target = ACG::SceneGraph::PICK_VERTEX;
}
......@@ -679,13 +685,45 @@ InfoMeshObjectPlugin::
emit log( LOGINFO , object->getObjectinfo() );
if ( object->picked(node_idx) && object->dataType(DATA_TRIANGLE_MESH) )
printMeshInfo( PluginFunctions::triMesh(object) , object->id(), target_idx, hit_point );
{
TriMesh* mesh = PluginFunctions::triMesh(object);
if (info_->isHidden())
{
//we picked anything so we have to decide, which data we picked
if (mesh->n_faces() != 0)
info_->pickMode->setCurrentIndex(0);
else if (mesh->n_edges() != 0)
info_->pickMode->setCurrentIndex(1);
else
info_->pickMode->setCurrentIndex(2);
}
printMeshInfo( mesh , object->id(), target_idx, hit_point );
}
if ( object->picked(node_idx) && object->dataType(DATA_POLY_MESH) )
printMeshInfo( PluginFunctions::polyMesh(object) , object->id(), target_idx, hit_point );
{
PolyMesh* mesh = PluginFunctions::polyMesh(object);
if (info_->isHidden())
{
//we picked anything so we have to decide, which data we picked
if (mesh->n_faces() != 0)
info_->pickMode->setCurrentIndex(0);
else if (mesh->n_edges() != 0)
info_->pickMode->setCurrentIndex(1);
else
info_->pickMode->setCurrentIndex(2);
}
printMeshInfo( PluginFunctions::polyMesh(object) , object->id(), target_idx, hit_point );
}
} else return;
}
else
{
emit log( LOGERR , tr("Unable to pick object.") );
}
}
//------------------------------------------------------------------------------
......
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