Commit 53346650 authored by Jan Möbius's avatar Jan Möbius

Correctly set scene when bb of scenegraph has changed

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4731 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 24f08224
......@@ -91,8 +91,7 @@ void Core::slotObjectUpdated(int _identifier) {
// Reenable redraws
OpenFlipper::Options::redrawDisabled(false);
// resetScenegraph();
// TODO Set correct view after bb of object has changed
resetScenegraph();
updateView();
}
......
......@@ -47,15 +47,9 @@ void Core::resetScenegraph() {
if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() ) {
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
// update scene graph
// update scene graph (get new bounding box and set projection right, including near and far plane)
PluginFunctions::viewerProperties(i).lockUpdate();
coreWidget_->examiner_widgets_[i]->sceneGraph(root_node_scenegraph_);
coreWidget_->examiner_widgets_[i]->viewAll();
coreWidget_->examiner_widgets_[i]->setScenePos( coreWidget_->examiner_widgets_[i]->scene_center() ,
coreWidget_->examiner_widgets_[i]->scene_radius() /* 10.0*/ );
coreWidget_->examiner_widgets_[i]->setHome();
coreWidget_->examiner_widgets_[i]->drawMode( OpenFlipper::Options::standardDrawMode() );
PluginFunctions::viewerProperties(i).unLockUpdate();
coreWidget_->examiner_widgets_[i]->updateGL();
}
......@@ -220,6 +214,11 @@ void Core::slotLoad(QString _filename, DataType _type, int& _id) {
if ( OpenFlipper::Options::gui() )
coreWidget_->addRecent( filename, object2->dataType() );
// if this is the first object opend, reset the global draw mode of all examiners to standard draw mode
if ( PluginFunctions::object_count() == 1 && OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() )
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
coreWidget_->examiner_widgets_[i]->drawMode( OpenFlipper::Options::standardDrawMode() );
// objectRoot_->dumpTree();
}
......
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