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;
|
||||
viewer->setAntiAliasing(settings.value("antialiasing", false).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->setTotalPass(settings.value("transparency_pass_number", 4).toInt());
|
||||
CGAL::Three::Three::s_defaultSMRM = CGAL::Three::Three::modeFromName(
|
||||
|
|
@ -1947,6 +1948,11 @@ void MainWindow::on_actionPreferences_triggered()
|
|||
QSettings settings;
|
||||
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());
|
||||
connect(prefdiag.antialiasingCheckBox, SIGNAL(toggled(bool)),
|
||||
viewer, SLOT(setAntiAliasing(bool)));
|
||||
|
|
@ -2042,6 +2048,8 @@ void MainWindow::on_actionPreferences_triggered()
|
|||
//write settings
|
||||
settings.setValue("antialiasing",
|
||||
prefdiag.antialiasingCheckBox->isChecked());
|
||||
settings.setValue("offset_update",
|
||||
prefdiag.offset_updateCheckBox->isChecked());
|
||||
settings.setValue("quick_camera_mode",
|
||||
prefdiag.quick_cameraCheckBox->isChecked());
|
||||
settings.setValue("transparency_pass_number",
|
||||
|
|
|
|||
|
|
@ -78,6 +78,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="offset_updateCheckBox">
|
||||
<property name="text">
|
||||
<string>Visibility Changes Recenter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="max_itemsSpinBox">
|
||||
<property name="sizePolicy">
|
||||
|
|
|
|||
|
|
@ -1201,7 +1201,8 @@ void Scene::itemVisibilityChanged(CGAL::Three::Scene_item* item)
|
|||
&& !item->isEmpty())
|
||||
{
|
||||
//does not recenter
|
||||
Q_EMIT updated_bbox(false);
|
||||
if(visibility_recentering_enabled)
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
void Scene::enableVisibilityRecentering(bool b)
|
||||
{
|
||||
visibility_recentering_enabled = b;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ public Q_SLOTS:
|
|||
void setItemA(int i);
|
||||
//!Sets the item_B as the item at index i .
|
||||
void setItemB(int i);
|
||||
void enableVisibilityRecentering(bool);
|
||||
|
||||
Q_SIGNALS:
|
||||
//generated automatically by moc
|
||||
|
|
@ -280,6 +281,7 @@ private:
|
|||
QOpenGLShaderProgram program;
|
||||
QOpenGLVertexArrayObject* vao;
|
||||
mutable QOpenGLBuffer vbo[2];
|
||||
bool visibility_recentering_enabled;
|
||||
|
||||
}; // end class Scene
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue