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

Introduced Option to set minimal scene size



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10901 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1cea2e3f
......@@ -93,6 +93,7 @@
* * Core/Gui/glViewer/restrictFrameRate This setting controls if the maximum frame rate should be restricted (bool)\n
* * Core/Gui/glViewer/maxFrameRate If restrictFrameRate is set to yes, this setting controls the maximum frameRate used (unsigned int)\n
* * Core/Gui/glViewer/useMultipleViewers Use only one viewer or automatically generate multiple viewers (bool)\n
* * Core/Gui/glViewer/minimalSceneSize The minimal scene radius. If the scene is smaller, than the size will be set to this value (double)\n
* * Core/Gui/ToolBoxes/hidden Hide the toolbox sidebar (bool)\n
* * Core/Gui/ToolBoxes/ToolBoxOnTheRight Toolbox on the right or on the left (bool)\n
* * Core/Gui/TaskSwitcher/Hide Show or Hide the task switcher(bool)\n
......
......@@ -294,11 +294,11 @@ void glViewer::sceneGraph(ACG::SceneGraph::BaseNode* _root, const bool _resetTra
bbmax = ACG::Vec3d( 1.0, 1.0, 1.0);
} else {
// For small scenes, we set the scene radius to 5
// For very small scenes, we set the scene radius to 0.1
// otherwise we take the real radius
if ( ( bbmax - bbmin ).max() < 5.0 ) {
if ( ( bbmax - bbmin ).max() < OpenFlipperSettings().value("Core/Gui/glViewer/minimalSceneSize",0.1).toDouble() ) {
setScenePos( ( bbmin + bbmax ) * 0.5,
10.0,
OpenFlipperSettings().value("Core/Gui/glViewer/minimalSceneSize",0.1).toDouble(),
_resetTrackBall);
} else {
......
......@@ -378,13 +378,12 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
wheelBox->setChecked( OpenFlipperSettings().value("Core/Gui/glViewer/showControlWheels").toBool() );
// Projection settings
// Get field of view in radiant
double fovy = OpenFlipperSettings().value("Core/Projection/FOVY", 45.0).toDouble();
fieldOfView->setValue(fovy);
fieldOfView->setValue(OpenFlipperSettings().value("Core/Projection/FOVY", 45.0).toDouble() );
restrictFPS->setChecked( OpenFlipperSettings().value("Core/Gui/glViewer/restrictFrameRate",false).toBool() );
FPS->setValue( OpenFlipperSettings().value("Core/Gui/glViewer/maxFrameRate",35).toInt() );
minimalSceneSize->setValue( OpenFlipperSettings().value("Core/Gui/glViewer/minimalSceneSize",0.1).toDouble());
QPixmap color(16,16);
color.fill( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() );
......@@ -611,12 +610,8 @@ void OptionsWidget::slotApply() {
OpenFlipperSettings().setValue("Core/Mouse/Wheel/ZoomFactorShift", wZoomFactorShift->text().toDouble());
// Projection settings
double fovy = fieldOfView->value();
double old_fovy = OpenFlipperSettings().value("Core/Projection/FOVY", 45.0).toDouble();
if(fovy != old_fovy) {
OpenFlipperSettings().setValue("Core/Projection/FOVY", fovy);
}
OpenFlipperSettings().setValue("Core/Projection/FOVY", fieldOfView->value());
OpenFlipperSettings().setValue("Core/Gui/glViewer/minimalSceneSize",minimalSceneSize->value());
OpenFlipperSettings().setValue("Core/Gui/glViewer/showControlWheels", wheelBox->isChecked() );
......
......@@ -23,7 +23,7 @@
<string/>
</property>
<property name="currentIndex">
<number>7</number>
<number>0</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
......@@ -365,62 +365,98 @@
<property name="title">
<string>Projection</string>
</property>
<widget class="QWidget" name="formLayoutWidget_2">
<property name="geometry">
<rect>
<x>30</x>
<y>30</y>
<width>541</width>
<height>62</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Projection type:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="projectionBox">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_24">
<item>
<layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Orthogonal</string>
<string>Projection type:</string>
</property>
</item>
<item>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="projectionBox">
<item>
<property name="text">
<string>Orthogonal</string>
</property>
</item>
<item>
<property name="text">
<string>Perspective</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Perspective</string>
<string>Field of View</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Field of View</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="fieldOfView">
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>179.000000000000000</double>
</property>
<property name="value">
<double>45.000000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="fieldOfView">
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>179.000000000000000</double>
</property>
<property name="value">
<double>45.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_23">
<item>
<widget class="QLabel" name="label_28">
<property name="text">
<string>Minimal Scene size:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="minimalSceneSize">
<property name="maximumSize">
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Bounding box of the scene will have at least the entered size</string>
</property>
<property name="statusTip">
<string>Bounding box of the scene will have at least the entered size</string>
</property>
<property name="whatsThis">
<string>Bounding box of the scene will have at least the entered size</string>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>10000.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>0.010000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
......
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