+ else if ( paramName == "rayTracing" )
+ {
+ Graphic3d_RenderingParams& rendParams = this->getViewPort()->getView()->ChangeRenderingParams();
+ rendParams.Method = Graphic3d_RM_RAYTRACING;
+ QStringList rtData = paramValue.split( ';' );
+ foreach( QString rtParam, rtData )
+ {
+ QString rt_paramName = rtParam.section( '~', 0, 0 ).trimmed();
+ QString rt_paramValue = rtParam.section( '~', 1, 1 ).trimmed();
+ if ( rt_paramName == "rtDepth" ) rendParams.RaytracingDepth = rt_paramValue.toInt();
+ else if ( rt_paramName == "rtReflection" ) rendParams.IsReflectionEnabled = rt_paramValue.toInt();
+ else if ( rt_paramName == "rtAntialiasing" ) rendParams.IsAntialiasingEnabled = rt_paramValue.toInt();
+ else if ( rt_paramName == "rtShadow" ) rendParams.IsShadowEnabled = rt_paramValue.toInt();
+ else if ( rt_paramName == "rtTransShadow" ) rendParams.IsTransparentShadowEnabled = rt_paramValue.toInt();
+ }
+ }
+ else if ( paramName == "envTexture" )
+ {
+ Handle(Graphic3d_TextureEnv) aTexture;
+ QStringList etData = paramValue.split( ';' );
+ foreach( QString etParam, etData )
+ {
+ QString et_paramName = etParam.section( '~', 0, 0 ).trimmed();
+ QString et_paramValue = etParam.section( '~', 1, 1 ).trimmed();
+ if ( et_paramName == "etNumber" )
+ aTexture = new Graphic3d_TextureEnv( Graphic3d_NameOfTextureEnv( et_paramValue.toInt() ) );
+ else if ( et_paramName == "etFile" )
+ aTexture = new Graphic3d_TextureEnv( TCollection_AsciiString( et_paramValue.toStdString().c_str() ) );
+ Handle(V3d_View) aView = this->getViewPort()->getView();
+ aView->SetTextureEnv( aTexture );
+ }
+ }
+ else if ( paramName == "lightSource" )
+ {
+ myModel->getViewer3d()->InitDefinedLights();
+ while ( myModel->getViewer3d()->MoreDefinedLights() )
+ {
+ Handle(V3d_Light) aLight = myModel->getViewer3d()->DefinedLight();
+ if( aLight->Type() != V3d_AMBIENT ) {
+ myModel->getViewer3d()->DelLight( aLight );
+ myModel->getViewer3d()->InitDefinedLights();
+ } else {
+ myModel->getViewer3d()->NextDefinedLights();
+ }
+ }
+ double aX, aY, aZ;
+ double cR, cG, cB;
+ V3d_TypeOfLight aType;
+ bool isHeadlight;
+ QStringList lsData = paramValue.split( ';' );
+ foreach( QString lsParam, lsData )
+ {
+ QString ls_paramName = lsParam.section( '~', 0, 0 ).trimmed();
+ QString ls_paramValue = lsParam.section( '~', 1, 1 ).trimmed();
+ if ( ls_paramName == "lightType" ) aType = V3d_TypeOfLight( ls_paramValue.toInt() );
+ else if ( ls_paramName == "lightX" ) aX = ls_paramValue.toDouble();
+ else if ( ls_paramName == "lightY" ) aY = ls_paramValue.toDouble();
+ else if ( ls_paramName == "lightZ" ) aZ = ls_paramValue.toDouble();
+ else if ( ls_paramName == "lightColorR" ) cR = ls_paramValue.toDouble();
+ else if ( ls_paramName == "lightColorG" ) cG = ls_paramValue.toDouble();
+ else if ( ls_paramName == "lightColorB" ) cB = ls_paramValue.toDouble();
+ else if ( ls_paramName == "lightHeadlight" ) isHeadlight = ls_paramValue.toInt();
+ }
+ Quantity_Color aColor = Quantity_Color( cR, cG, cB, Quantity_TOC_RGB );
+ if( aType == V3d_DIRECTIONAL ) {
+ Handle(V3d_DirectionalLight) aLight = new V3d_DirectionalLight( myModel->getViewer3d() );
+ aLight->SetDirection( aX, aY, aZ );
+ aLight->SetColor( aColor );
+ aLight->SetHeadlight( isHeadlight );
+ myModel->getViewer3d()->SetLightOn( aLight );
+ }
+ else if( aType == V3d_POSITIONAL ) {
+ Handle(V3d_PositionalLight) aLight = new V3d_PositionalLight( myModel->getViewer3d(), aX, aY, aZ, aColor.Name() );
+ aLight->SetHeadlight( isHeadlight );
+ myModel->getViewer3d()->SetLightOn( aLight );
+ }
+ }