From e11dfd6bc69a5e40b59bf69545faee717ccb7954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 25 Nov 2009 15:01:15 +0000 Subject: [PATCH] Some documentation at traversal points to make clear why we use single pass traversal at these points git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7633 383ad7c9-94d9-4d36-a494-682f7c89f535 --- BasePlugin/PluginFunctions.cc | 7 +++++-- Core/Core.cc | 3 +++ Core/PluginLoader.cc | 2 ++ common/BaseObjectData.cc | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/BasePlugin/PluginFunctions.cc b/BasePlugin/PluginFunctions.cc index e76bd28f..5130864f 100644 --- a/BasePlugin/PluginFunctions.cc +++ b/BasePlugin/PluginFunctions.cc @@ -448,8 +448,9 @@ bool scenegraphRegionPick( const unsigned int _examiner, //Warning : Dont use template function as external static pointer for examiner widget is not resolved correctly!! void traverse( ACG::SceneGraph::MouseEventAction &_action ) { - ACG::SceneGraph::traverse(sceneGraphRootNode_, - _action,viewerProperties().glState() ); + // Single pass action, as the mouse action will only update the graph. + // If its changed, it will be set to dirty and an automatic redraw is triggered. + ACG::SceneGraph::traverse(sceneGraphRootNode_, _action,viewerProperties().glState() ); } //Warning : Dont use template function as external static pointer for examiner widget is not resolved correctly!! @@ -460,6 +461,8 @@ void traverse( const unsigned int _examiner, ACG::SceneGraph::MouseEventAction return; } + // Single pass action, as the mouse action will only update the graph. + // If its changed, it will be set to dirty and an automatic redraw is triggered. ACG::SceneGraph::traverse(sceneGraphRootNode_, _action,viewerProperties(_examiner).glState() ); } diff --git a/Core/Core.cc b/Core/Core.cc index 0a82ecf1..1ec217ac 100644 --- a/Core/Core.cc +++ b/Core/Core.cc @@ -769,8 +769,11 @@ void Core::updateView() { void Core::checkScenegraphDirty() { if ( true ) { + // This is a single pass traversal as we only need to check if there is still one node dirty in the graph ACG::SceneGraph::CheckDirtyAction action; ACG::SceneGraph::traverse( root_node_scenegraph_, action ); + + // If the scenegraph is dirty, we have to redraw if ( action.isDirty () ) emit updateView (); } diff --git a/Core/PluginLoader.cc b/Core/PluginLoader.cc index 92b1522b..6d94c912 100644 --- a/Core/PluginLoader.cc +++ b/Core/PluginLoader.cc @@ -1140,6 +1140,8 @@ void Core::loadPlugin(QString filename, bool silent){ ft.loadFilters = filePlugin->getLoadFilters(); ft.saveFilters = filePlugin->getSaveFilters(); ft.plugin = filePlugin; + + std::cerr << ft.type << std::endl; supportedTypes_.push_back(ft); } diff --git a/common/BaseObjectData.cc b/common/BaseObjectData.cc index 90384259..bb65c357 100644 --- a/common/BaseObjectData.cc +++ b/common/BaseObjectData.cc @@ -251,6 +251,7 @@ void BaseObjectData::manipPlaced( bool _placed ) { void BaseObjectData::getBoundingBox(ACG::Vec3d& bbmin, ACG::Vec3d& bbmax){ + // Single pass action, as the bounding box is not influenced by multipass traversal ACG::SceneGraph::BoundingBoxAction act; ACG::SceneGraph::traverse(separatorNode_, act); -- GitLab