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

0023501: Redundant triangulation cleaning/generation (1) in AIS_Shape.cxx

Cleaning triangulation only if the AIS_Shape has either (1) OwnDeviationAngle and
the values 'newangle' and 'prevangle' are different or (2) OwnDeviationCoefficient and the values 'newcoeff' and 'prevcoeff' are different
Found similar problems in further code portions and corrected them.
The same faulty condition found in XCAFPrs_AISObject.cxx
This commit is contained in:
Pawel
2013-06-06 10:13:30 +04:00
parent c6df241cea
commit bbf847ad1b
3 changed files with 22 additions and 23 deletions

View File

@@ -260,10 +260,10 @@ void XCAFPrs_AISObject::AddStyledItem (const XCAFPrs_Style &style,
Standard_Real prevcoeff ;
Standard_Real newcoeff ;
if (OwnDeviationAngle(newangle,prevangle) ||
OwnDeviationCoefficient(newcoeff,prevcoeff))
if (Abs (newangle - prevangle) > Precision::Angular() ||
Abs (newcoeff - prevcoeff) > Precision::Confusion() ) {
Standard_Boolean isOwnDeviationAngle = OwnDeviationAngle(newangle,prevangle);
Standard_Boolean isOwnDeviationCoefficient = OwnDeviationCoefficient(newcoeff,prevcoeff);
if (((Abs (newangle - prevangle) > Precision::Angular()) && isOwnDeviationAngle) ||
((Abs (newcoeff - prevcoeff) > Precision::Confusion()) && isOwnDeviationCoefficient)) {
#ifdef DEB
cout << "AIS_Shape : compute"<<endl;
cout << "newangl : " << newangle << " # de " << "prevangl : " << prevangle << " OU "<<endl;