Gui: [skip ci] add options to set one-pass and backface-pass rendering

This commit is contained in:
wmayer
2020-04-06 19:50:58 +02:00
parent 3c52ff6c7f
commit 20745f3301
3 changed files with 63 additions and 8 deletions

View File

@@ -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)