mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025201: Visualization - Implementing soft shadows and ambient occlusion in OCCT ray-tracing core
This commit is contained in:
@@ -454,7 +454,7 @@ is
|
||||
-- - Pewter
|
||||
-- - Silver
|
||||
-- - Stone.
|
||||
|
||||
|
||||
SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is virtual;
|
||||
---Purpose: Sets the name aName for material defining this
|
||||
-- display attribute for the interactive object.
|
||||
|
@@ -276,9 +276,7 @@ void AIS_InteractiveObject::UnsetWidth()
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
//POP pour K4L
|
||||
void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
//void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfPhysicalMaterial aName)
|
||||
{
|
||||
if( HasColor() || IsTransparent() || HasMaterial() )
|
||||
{
|
||||
@@ -292,44 +290,57 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
myOwnMaterial = aName;
|
||||
hasOwnMaterial = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
|
||||
void AIS_InteractiveObject::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
{
|
||||
if (HasColor() || IsTransparent() || HasMaterial())
|
||||
if (!HasColor() && !IsTransparent() && !HasMaterial())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect);
|
||||
}
|
||||
|
||||
myDrawer->ShadingAspect()->SetMaterial (theMaterial);
|
||||
|
||||
hasOwnMaterial = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//function : UnsetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetMaterial()
|
||||
{
|
||||
if( !HasMaterial() ) return;
|
||||
if (!HasMaterial())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasColor() || IsTransparent())
|
||||
{
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (AIS_GraphicTool::GetMaterial (myDrawer->Link()));
|
||||
}
|
||||
if (HasColor()) SetColor (myOwnColor);
|
||||
if (IsTransparent()) SetTransparency (myTransparency);
|
||||
|
||||
if (HasColor())
|
||||
{
|
||||
SetColor (myOwnColor);
|
||||
}
|
||||
|
||||
if (IsTransparent())
|
||||
{
|
||||
SetTransparency (myTransparency);
|
||||
}
|
||||
}
|
||||
else{
|
||||
Handle(Prs3d_ShadingAspect) SA;
|
||||
myDrawer->SetShadingAspect(SA);
|
||||
else
|
||||
{
|
||||
Handle(Prs3d_ShadingAspect) anAspect;
|
||||
myDrawer->SetShadingAspect (anAspect);
|
||||
}
|
||||
|
||||
hasOwnMaterial = Standard_False;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user