1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +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; 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 //function : UpdateAttributes
//purpose : //purpose :
@ -205,8 +223,7 @@ void AIS_TexturedShape::UpdateAttributes()
void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& thePrs) void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& thePrs)
{ {
Prs3d_ShadingAspect aDummy; myAspect = new Graphic3d_AspectFillArea3d (*myDrawer->ShadingAspect()->Aspect());
myAspect = aDummy.Aspect();
if (HasPolygonOffsets()) if (HasPolygonOffsets())
{ {
// Issue 23115: copy polygon offset settings passed through myDrawer // Issue 23115: copy polygon offset settings passed through myDrawer

View File

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

25
tests/bugs/vis/bug23804 Normal file
View File

@ -0,0 +1,25 @@
puts "============"
puts "CR23804"
puts "============"
puts ""
############################################################
# Unexpected color modulation during texture mapping
############################################################
box b 100 100 100
vinit
vdisplay b
vfit
vsetdispmode b 1
vsetmaterial b plastic
vdump $imagedir/${casename}_1.png
vsetcolor b ANTIQUEWHITE
vdump $imagedir/${casename}_2.png
vtexture b 3
vdump $imagedir/${casename}_3.png
vsetcolor b ANTIQUEWHITE
vdump $imagedir/${casename}_4.png