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

0028361: Visualization, TKV3d - buggy behavior of Transformation Persistence compiled on several Linux platforms in optimized mode

The patch fixes transformation persistence for various set of GCC compilers.
1) Optimized template-specialized operator /= for division (causes bugs)
   of NCollection_Vec4 was replaced with non-specialized version.
2) NCollection_Vec4::xyz() is not used since compiler uses modifiable-reference
   returning version, which invokes warning of possible strict-aliasing rules
   violation and leads to incorrect behavior of the reference.
This commit is contained in:
apl
2017-01-26 12:54:30 +03:00
committed by apn
parent 8cc8a6925d
commit ff2bd6ef48
2 changed files with 16 additions and 2 deletions

View File

@@ -510,8 +510,8 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
{
typename BVH_Box<T, 4>::BVH_VecNt& aCorner = anArrayOfCorners[anIt];
aCorner = aTPers * aCorner;
aCorner /= aCorner.w();
theBoundingBox.Add (aCorner.xyz());
aCorner = aCorner / aCorner.w();
theBoundingBox.Add (typename BVH_Box<T, 3>::BVH_VecNt (aCorner.x(), aCorner.y(), aCorner.z()));
}
}