1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0023804: Visualization - unexpected color modulation during texture mapping

AIS_TexturedShape - use material set to the Drawer, not default undefined one

Test case for issue CR23804
This commit is contained in:
dbp
2014-05-08 11:26:39 +04:00
committed by bugmaster
parent 54f7544df6
commit 7389f96df0
3 changed files with 47 additions and 2 deletions

View File

@@ -188,6 +188,24 @@ void AIS_TexturedShape::DisableTextureModulate()
myModulate = Standard_False;
}
//=======================================================================
//function : SetColor
//purpose :
//=======================================================================
void AIS_TexturedShape::SetColor (const Quantity_Color& theColor)
{
AIS_Shape::SetColor (theColor);
if (!GetContext().IsNull())
{
if (GetContext()->MainPrsMgr()->HasPresentation (this, 3))
{
updateAttributes (GetContext()->MainPrsMgr()->Presentation (this, 3)->Presentation());
}
}
}
//=======================================================================
//function : UpdateAttributes
//purpose :
@@ -205,8 +223,7 @@ void AIS_TexturedShape::UpdateAttributes()
void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& thePrs)
{
Prs3d_ShadingAspect aDummy;
myAspect = aDummy.Aspect();
myAspect = new Graphic3d_AspectFillArea3d (*myDrawer->ShadingAspect()->Aspect());
if (HasPolygonOffsets())
{
// Issue 23115: copy polygon offset settings passed through myDrawer

View File

@@ -98,6 +98,9 @@ public: //! @name methods to alter texture mapping properties
//! @endcode
Standard_EXPORT void UpdateAttributes();
//! Sets the color
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor);
//! Enables texture modulation
Standard_EXPORT void EnableTextureModulate();