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.
{
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()));
}
}
--- /dev/null
+puts "============"
+puts "OCC28361 Visualization, TKV3d - buggy behavior of Transformation Persistence compiled on several Linux platforms in optimized mode"
+puts "============"
+puts ""
+
+vclear
+vinit View1
+pload MODELING VISUALIZATION
+box b 10 10 10
+vdisplay b -trsfPers zoomRotate -trsfPersPos 90 90 90
+vmoveto 266 164
+if { [vreadpixel 256 174 rgb name] != "CYAN1" } { puts "Error: the box is not highlighted" }
+
+vdump $imagedir/${casename}.png