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:
parent
54f7544df6
commit
7389f96df0
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
25
tests/bugs/vis/bug23804
Normal file
25
tests/bugs/vis/bug23804
Normal 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
|
Loading…
x
Reference in New Issue
Block a user