mirror of https://github.com/CGAL/cgal
Add option to disable recenter on visibility changed
This commit is contained in:
parent
a8e2de77aa
commit
3fb15424bf
|
|
@ -1575,6 +1575,7 @@ void MainWindow::readSettings()
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
viewer->setAntiAliasing(settings.value("antialiasing", false).toBool());
|
viewer->setAntiAliasing(settings.value("antialiasing", false).toBool());
|
||||||
viewer->setFastDrawing(settings.value("quick_camera_mode", true).toBool());
|
viewer->setFastDrawing(settings.value("quick_camera_mode", true).toBool());
|
||||||
|
scene->enableVisibilityRecentering(settings.value("offset_update", true).toBool());
|
||||||
viewer->textRenderer()->setMax(settings.value("max_text_items", 10000).toInt());
|
viewer->textRenderer()->setMax(settings.value("max_text_items", 10000).toInt());
|
||||||
viewer->setTotalPass(settings.value("transparency_pass_number", 4).toInt());
|
viewer->setTotalPass(settings.value("transparency_pass_number", 4).toInt());
|
||||||
CGAL::Three::Three::s_defaultSMRM = CGAL::Three::Three::modeFromName(
|
CGAL::Three::Three::s_defaultSMRM = CGAL::Three::Three::modeFromName(
|
||||||
|
|
@ -1947,6 +1948,11 @@ void MainWindow::on_actionPreferences_triggered()
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
prefdiag.setupUi(&dialog);
|
prefdiag.setupUi(&dialog);
|
||||||
|
|
||||||
|
prefdiag.offset_updateCheckBox->setChecked(
|
||||||
|
settings.value("offset_update", true).toBool());
|
||||||
|
connect(prefdiag.offset_updateCheckBox, SIGNAL(toggled(bool)),
|
||||||
|
scene, SLOT(enableVisibilityRecentering(bool)));
|
||||||
|
|
||||||
prefdiag.antialiasingCheckBox->setChecked(settings.value("antialiasing", false).toBool());
|
prefdiag.antialiasingCheckBox->setChecked(settings.value("antialiasing", false).toBool());
|
||||||
connect(prefdiag.antialiasingCheckBox, SIGNAL(toggled(bool)),
|
connect(prefdiag.antialiasingCheckBox, SIGNAL(toggled(bool)),
|
||||||
viewer, SLOT(setAntiAliasing(bool)));
|
viewer, SLOT(setAntiAliasing(bool)));
|
||||||
|
|
@ -2042,6 +2048,8 @@ void MainWindow::on_actionPreferences_triggered()
|
||||||
//write settings
|
//write settings
|
||||||
settings.setValue("antialiasing",
|
settings.setValue("antialiasing",
|
||||||
prefdiag.antialiasingCheckBox->isChecked());
|
prefdiag.antialiasingCheckBox->isChecked());
|
||||||
|
settings.setValue("offset_update",
|
||||||
|
prefdiag.offset_updateCheckBox->isChecked());
|
||||||
settings.setValue("quick_camera_mode",
|
settings.setValue("quick_camera_mode",
|
||||||
prefdiag.quick_cameraCheckBox->isChecked());
|
prefdiag.quick_cameraCheckBox->isChecked());
|
||||||
settings.setValue("transparency_pass_number",
|
settings.setValue("transparency_pass_number",
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="offset_updateCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Visibility Changes Recenter</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="max_itemsSpinBox">
|
<widget class="QSpinBox" name="max_itemsSpinBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
|
|
||||||
|
|
@ -1201,6 +1201,7 @@ void Scene::itemVisibilityChanged(CGAL::Three::Scene_item* item)
|
||||||
&& !item->isEmpty())
|
&& !item->isEmpty())
|
||||||
{
|
{
|
||||||
//does not recenter
|
//does not recenter
|
||||||
|
if(visibility_recentering_enabled)
|
||||||
Q_EMIT updated_bbox(false);
|
Q_EMIT updated_bbox(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1662,3 +1663,8 @@ void Scene::adjustIds(Item_id removed_id)
|
||||||
m_entries[i]->setId(i-1);//the signal is emitted before m_entries is amputed from the item, so new id is current id -1.
|
m_entries[i]->setId(i-1);//the signal is emitted before m_entries is amputed from the item, so new id is current id -1.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scene::enableVisibilityRecentering(bool b)
|
||||||
|
{
|
||||||
|
visibility_recentering_enabled = b;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,7 @@ public Q_SLOTS:
|
||||||
void setItemA(int i);
|
void setItemA(int i);
|
||||||
//!Sets the item_B as the item at index i .
|
//!Sets the item_B as the item at index i .
|
||||||
void setItemB(int i);
|
void setItemB(int i);
|
||||||
|
void enableVisibilityRecentering(bool);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
//generated automatically by moc
|
//generated automatically by moc
|
||||||
|
|
@ -280,6 +281,7 @@ private:
|
||||||
QOpenGLShaderProgram program;
|
QOpenGLShaderProgram program;
|
||||||
QOpenGLVertexArrayObject* vao;
|
QOpenGLVertexArrayObject* vao;
|
||||||
mutable QOpenGLBuffer vbo[2];
|
mutable QOpenGLBuffer vbo[2];
|
||||||
|
bool visibility_recentering_enabled;
|
||||||
|
|
||||||
}; // end class Scene
|
}; // end class Scene
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue