Commit e72a7865 authored by Mike Kremer's avatar Mike Kremer

Put resetTrackball parameter of resetScenegraph one level up

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7148 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a927e0cb
......@@ -163,7 +163,7 @@ signals:
/// This signal is emitted if the object has been changed (source/target)
void objectSelectionChanged( int );
/// This signal is emitted if one of the viewers updated its view
void pluginViewChanged();
......@@ -422,8 +422,11 @@ private:
*/
int loadObject ( QString _filename );
/// Do a reset of the scenegraph (bounding box update,...)
void resetScenegraph();
/** Do a reset of the scenegraph (bounding box update,...)
*
* @param _resetTrackBall Should the rotation center of the trackball be reset to the scene center?
*/
void resetScenegraph( bool _resetTrackBall );
public :
......@@ -921,8 +924,8 @@ private:
/// If enabled, this timer will block screen refresh if done more then 30 times per second.
QTimer* redrawTimer_;
};
/// Special print function for core logger
......
......@@ -621,7 +621,7 @@ void Core::writeApplicationOptions(INIFile& _ini) {
_ini.add_entry("Options","DefaultProjectionMode" + QString::number(i), OpenFlipper::Options::defaultProjectionMode(i) );
_ini.add_entry("Options","DefaultViewingDirection" + QString::number(i), OpenFlipper::Options::defaultViewingDirection(i) );
}
_ini.add_entry("Options","LoggerState", OpenFlipper::Options::loggerState() );
_ini.add_entry("Options","HideToolbox", OpenFlipper::Options::hideToolbox() );
......@@ -749,7 +749,8 @@ void Core::openIniFile( QString _filename,
OpenFlipper::Options::loadingSettings(false);
resetScenegraph();
// Reset scenegraph and recompute scene center containing all new objects
resetScenegraph(true);
if ( OpenFlipper::Options::gui() ){
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
......
......@@ -125,7 +125,8 @@ void Core::openObjFile(QString _filename)
OpenFlipper::Options::loadingSettings(false);
resetScenegraph();
// Reset scenegraph and recompute scene center containing all new objects
resetScenegraph( true );
if ( OpenFlipper::Options::gui() )
{
......
......@@ -105,8 +105,8 @@ void Core::slotObjectUpdated(int _identifier) {
OpenFlipper::Options::redrawDisabled(false);
// TODO: full reset is not required here. It should at least keep the scene center!
resetScenegraph();
// Reset scenegraph but keep scene center!
resetScenegraph(false);
updateView();
}
......
......@@ -56,13 +56,13 @@
#include <time.h>
void Core::resetScenegraph() {
void Core::resetScenegraph( bool _resetTrackBall ) {
if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() ) {
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
// 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_, true);
coreWidget_->examiner_widgets_[i]->sceneGraph(root_node_scenegraph_, _resetTrackBall );
PluginFunctions::viewerProperties(i).unLockUpdate();
coreWidget_->examiner_widgets_[i]->updateGL();
}
......@@ -335,7 +335,7 @@ void Core::slotObjectOpened ( int _id ) {
if ( PluginFunctions::objectCount() == 1 && OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() )
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ){
PluginFunctions::viewerProperties(i).drawMode( OpenFlipper::Options::defaultDrawMode(i) );
if ( OpenFlipper::Options::defaultProjectionMode(i) == 0 )
PluginFunctions::orthographicProjection(i);
else
......@@ -346,8 +346,9 @@ void Core::slotObjectOpened ( int _id ) {
// ================================================================================
// Recompute bounding box and scenegraph info
// Reset scene center here to include new object
// ================================================================================
resetScenegraph();
resetScenegraph(true);
// ================================================================================
// Tell plugins, that a file has been opened
......
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