aLight = myModel->getViewer3d()->DefinedLight();
if ( aLight->Type() == V3d_DIRECTIONAL ) {
myDirLight = Handle(V3d_DirectionalLight)::DownCast( aLight );
- myPosLight = new V3d_PositionalLight( myModel->getViewer3d(), 0, 0, 0 );
+ myPosLight = new V3d_PositionalLight( gp_Pnt(0, 0, 0) );
+ myModel->getViewer3d()->AddLight( myPosLight );
myDirType->setChecked( true );
myStackedLayout->setCurrentIndex(0);
break;
}
if ( aLight->Type() == V3d_POSITIONAL ) {
myPosLight = Handle(V3d_PositionalLight)::DownCast( aLight );
- myDirLight = new V3d_DirectionalLight( myModel->getViewer3d() );
+ myDirLight = new V3d_DirectionalLight();
+ myModel->getViewer3d()->AddLight( myDirLight );
myPosType->setChecked( true );
myStackedLayout->setCurrentIndex(1);
break;
double aDz = SUIT_Session::session()->resourceMgr()->doubleValue( "OCCViewer", "light_dz", -1.0 );
Handle(V3d_DirectionalLight) aLight =
- new V3d_DirectionalLight( myV3dViewer, V3d_Zneg, OCCViewer::color( aColor ).Name(), Standard_True );
+ new V3d_DirectionalLight( V3d_Zneg, OCCViewer::color( aColor ).Name(), Standard_True );
+ myV3dViewer->AddLight( aLight );
if( !( aDx == 0 && aDy == 0 && aDz == 0 ) )
aLight->SetDirection( aDx, aDy, aDz );
myV3dViewer->SetLightOn( aLight );
- myV3dViewer->SetLightOn( new V3d_AmbientLight( myV3dViewer ) );
+ Handle(V3d_AmbientLight) ambLight = new V3d_AmbientLight();
+ myV3dViewer->AddLight( ambLight );
+ myV3dViewer->SetLightOn( ambLight );
}
/*!
}
Quantity_Color aColor = Quantity_Color( cR, cG, cB, Quantity_TOC_RGB );
if( aType == V3d_DIRECTIONAL ) {
- Handle(V3d_DirectionalLight) aLight = new V3d_DirectionalLight( myModel->getViewer3d() );
+ Handle(V3d_DirectionalLight) aLight = new V3d_DirectionalLight();
+ myModel->getViewer3d()->AddLight( aLight );
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() );
+ Handle(V3d_PositionalLight) aLight = new V3d_PositionalLight( gp_Pnt(aX, aY, aZ), aColor.Name() );
+ myModel->getViewer3d()->AddLight( aLight );
aLight->SetHeadlight( isHeadlight );
myModel->getViewer3d()->SetLightOn( aLight );
}