While porting my application from 6.2.0 to 6.5.3, I believe I found a bug in the new version of AIS_TexturedShape::Compute().
I have my own class derived from AIS_TexturedShape. When I moved to 6.5.3, I found that while my shapes drew correctly in wireframe, they did not appear in shaded mode. While stepping through the source code, I noticed that the logic changed in the Compute() method's shaded case.
In the old version, if OwnDeviationAngle and OwnDeviationCoefficient both return false, it would skip calling BRepTools::Clean() then go on to draw the shaded surface.
In the new version, if OwnDeviationAngle and OwnDeviationCoefficient both return false, it breaks out of the shaded case and does not draw anything for the surface.
Note that the 6.5.3 version of AIS_Shape::Compute() does not have this problem, only the textured shape does.
Here is the source code for she shape case from 6.2.0 and 6.5.3:
6.2.0
case 1: // Shading)
{
Standard_Real prevangle ;
Standard_Real newangle ;
Standard_Real prevcoeff ;
Standard_Real newcoeff ;
if (OwnDeviationAngle(newangle,prevangle) || OwnDeviationCoefficient(newcoeff,prevcoeff))
if (Abs (newangle - prevangle) > Precision::Angular() || Abs (newcoeff - prevcoeff) > Precision::Confusion() )
{
BRepTools::Clean(myshape);
}
if ((Standard_Integer) myshape.ShapeType()>4)
StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
else
{
myDrawer->SetShadingAspectGlobal(Standard_False);
if (IsInfinite())
StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
else
{
try
{
OCC_CATCH_SIGNALS
StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
}
catch (Standard_Failure)
{
cout
StdPrs_WFShape::Add(aPrs,myshape,myDrawer);
}
}
}
break;
}
6.3.5
case 1: // Shading
{
Standard_Real prevangle;
Standard_Real newangle;
Standard_Real prevcoeff;
Standard_Real newcoeff;
if (!OwnDeviationAngle (newangle, prevangle) && !OwnDeviationCoefficient (newcoeff, prevcoeff))
{
break;
}
if (Abs (newangle - prevangle) > Precision::Angular() || Abs (newcoeff - prevcoeff) > Precision::Confusion())
{
BRepTools::Clean (myshape);
}
if (myshape.ShapeType() > TopAbs_FACE)
{
StdPrs_WFDeflectionShape::Add (thePrs, myshape, myDrawer);
break;
}
myDrawer->SetShadingAspectGlobal (Standard_False);
if (IsInfinite())
{
StdPrs_WFDeflectionShape::Add (thePrs, myshape, myDrawer);
break;
}
try
{
OCC_CATCH_SIGNALS
StdPrs_ShadedShape::Add (thePrs, myshape, myDrawer);
}
catch (Standard_Failure)
{
std::cout
StdPrs_WFShape::Add (thePrs, myshape, myDrawer);
}
break;
}