mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0029825: Foundation Classes, NCollection_Vec4 - workaround gcc optimizer issues with xyz() method
Methods of NCollection_Vec3 and NCollection_Vec3 that returned reference to internal buffer as vector of lower dimension (non-const xy(), xyz() etc.) are eliminated. Use of these methods could led to generation of incorrect binary code by GCC. Instead added new method SetValues() accepting vector of lower dimension and additional value. DRAW test command QANColTestVec4 reproducing one situation where the bug occurs is added, along with a test case.
This commit is contained in:
@@ -365,7 +365,7 @@ bool Select3D_SensitivePrimitiveArray::InitTriangulation (const Handle(Graphic3d
|
||||
const Graphic3d_Vec2& aNode1 = getPosVec2 (aTriNodes[0]);
|
||||
const Graphic3d_Vec2& aNode2 = getPosVec2 (aTriNodes[1]);
|
||||
const Graphic3d_Vec2& aNode3 = getPosVec2 (aTriNodes[2]);
|
||||
aCenter.xy() += (aNode1 + aNode2 + aNode3) / 3.0;
|
||||
aCenter += Graphic3d_Vec3((aNode1 + aNode2 + aNode3) / 3.0);
|
||||
}
|
||||
if (myBvhIndices.HasPatches())
|
||||
{
|
||||
@@ -543,7 +543,7 @@ bool Select3D_SensitivePrimitiveArray::InitPoints (const Handle(Graphic3d_Buffer
|
||||
else
|
||||
{
|
||||
aPnt2d = &getPosVec2 (aPointIndex);
|
||||
aCenter.xy() += *aPnt2d;
|
||||
aCenter += Graphic3d_Vec3(*aPnt2d);
|
||||
}
|
||||
|
||||
if (myBvhIndices.HasPatches())
|
||||
|
Reference in New Issue
Block a user