Commit 81a3e9b0 authored by Dirk Wilden's avatar Dirk Wilden

fixed flyTo when objects are invisible

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5888 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5e094147
......@@ -502,6 +502,12 @@ void DataControlPlugin::slotZoomTo(){
for (int i=0; i < children.size(); i++){
BaseObjectData* child = dynamic_cast< BaseObjectData* > (children[i]);
if (child){
if ( !child->visible() ){
child->show();
emit visibilityChanged( child->id() );
}
ACG::Vec3d cur_min;
ACG::Vec3d cur_max;
......@@ -535,6 +541,11 @@ void DataControlPlugin::slotZoomTo(){
//zoom to object
BaseObjectData* obj = dynamic_cast< BaseObjectData* >(item);
if ( !obj->visible() ){
obj->show();
emit visibilityChanged( obj->id() );
}
if (obj){
ACG::Vec3d bbmin;
......@@ -542,8 +553,10 @@ void DataControlPlugin::slotZoomTo(){
obj->getBoundingBox(bbmin, bbmax);
if ((bbmin[0] > bbmax[0]) || (bbmin[1] > bbmax[1]) || (bbmin[2] > bbmax[2]))
if ((bbmin[0] > bbmax[0]) || (bbmin[1] > bbmax[1]) || (bbmin[2] > bbmax[2])){
std::cerr << "Error while computing bounding box!";
return;
}
ACG::Vec3d bbcenter = (bbmax + bbmin) * 0.5;
......
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