Gui: [skip ci] add options to set one-pass and backface-pass rendering
This commit is contained in:
@@ -214,6 +214,45 @@ but slower response to any scene changes.</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="transparentRenderLabel">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Transparent objects:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="Gui::PrefComboBox" name="comboTransparentRender">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>120</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Render types of transparent objects</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>TransparentObjectRenderType</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>View</cstring>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>One pass</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Backface pass</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="markerSizeLabel">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
@@ -223,7 +262,7 @@ but slower response to any scene changes.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<item row="3" column="4">
|
||||
<widget class="QComboBox" name="boxMarkerSize">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -236,14 +275,14 @@ but slower response to any scene changes.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="textLabel1">
|
||||
<property name="text">
|
||||
<string>Eye to eye distance for stereo modes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<item row="4" column="4">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="FloatSpinBox_EyeDistance">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -279,7 +318,7 @@ bounding box size of the 3D object that is currently displayed. </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="Gui::PrefCheckBox" name="checkBoxBacklight">
|
||||
<property name="toolTip">
|
||||
<string>Backlight is enabled with the defined color</string>
|
||||
@@ -295,7 +334,7 @@ bounding box size of the 3D object that is currently displayed. </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="Gui::PrefColorButton" name="backlightColor">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@@ -318,7 +357,7 @@ bounding box size of the 3D object that is currently displayed. </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<item row="5" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -331,7 +370,7 @@ bounding box size of the 3D object that is currently displayed. </string>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="backlightLabel">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@@ -347,7 +386,7 @@ bounding box size of the 3D object that is currently displayed. </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<item row="5" column="4">
|
||||
<widget class="Gui::PrefSlider" name="sliderIntensity">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
|
||||
@@ -83,6 +83,8 @@ void DlgSettings3DViewImp::saveSettings()
|
||||
index = ui->renderCache->currentIndex();
|
||||
hGrp->SetInt("RenderCache", index);
|
||||
|
||||
ui->comboTransparentRender->onSave();
|
||||
|
||||
QVariant const &vBoxMarkerSize = ui->boxMarkerSize->itemData(ui->boxMarkerSize->currentIndex());
|
||||
hGrp->SetInt("MarkerSize", vBoxMarkerSize.toInt());
|
||||
|
||||
@@ -124,6 +126,8 @@ void DlgSettings3DViewImp::loadSettings()
|
||||
index = hGrp->GetInt("RenderCache", 0);
|
||||
ui->renderCache->setCurrentIndex(index);
|
||||
|
||||
ui->comboTransparentRender->onRestore();
|
||||
|
||||
int const current = hGrp->GetInt("MarkerSize", 9L);
|
||||
ui->boxMarkerSize->addItem(tr("5px"), QVariant(5));
|
||||
ui->boxMarkerSize->addItem(tr("7px"), QVariant(7));
|
||||
|
||||
@@ -189,6 +189,7 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent,
|
||||
OnChange(*hGrp,"Dimensions3dVisible");
|
||||
OnChange(*hGrp,"DimensionsDeltaVisible");
|
||||
OnChange(*hGrp,"PickRadius");
|
||||
OnChange(*hGrp,"TransparentObjectRenderType");
|
||||
|
||||
stopSpinTimer = new QTimer(this);
|
||||
connect(stopSpinTimer, SIGNAL(timeout()), this, SLOT(stopAnimating()));
|
||||
@@ -414,6 +415,17 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
|
||||
else if (strcmp(Reason, "PickRadius") == 0) {
|
||||
_viewer->setPickRadius(rGrp.GetFloat("PickRadius", 5.0f));
|
||||
}
|
||||
else if (strcmp(Reason, "TransparentObjectRenderType") == 0) {
|
||||
long renderType = rGrp.GetInt("TransparentObjectRenderType", 0);
|
||||
if (renderType == 0) {
|
||||
_viewer->getSoRenderManager()->getGLRenderAction()
|
||||
->setTransparentDelayedObjectRenderType(SoGLRenderAction::ONE_PASS);
|
||||
}
|
||||
else if (renderType == 1) {
|
||||
_viewer->getSoRenderManager()->getGLRenderAction()
|
||||
->setTransparentDelayedObjectRenderType(SoGLRenderAction::NONSOLID_SEPARATE_BACKFACE_PASS);
|
||||
}
|
||||
}
|
||||
else {
|
||||
unsigned long col1 = rGrp.GetUnsigned("BackgroundColor",3940932863UL);
|
||||
unsigned long col2 = rGrp.GetUnsigned("BackgroundColor2",859006463UL); // default color (dark blue)
|
||||
|
||||
Reference in New Issue
Block a user