aTc = (Abs (aTn) < Precision::Confusion() ? 0.0 : aTn / aTd);
gp_Pnt aClosestPnt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aTc;
- theDepth = myNearPickedPnt.Distance (aClosestPnt);
+ theDepth = myNearPickedPnt.Distance (aClosestPnt) * myScale;
}
// =======================================================================
}
gp_Pnt aClosestPnt = myNearPickedPnt.XYZ() + anU * aParam;
- theDepth = myNearPickedPnt.Distance (aClosestPnt);
+ theDepth = myNearPickedPnt.Distance (aClosestPnt) * myScale;
}
namespace
// compute vertices projections onto frustum normals and
// {i, j, k} vectors and store them to corresponding class fields
cacheVertexProjections (this);
+
+ myScale = 1.0;
}
// =======================================================================
// compute vertices projections onto frustum normals and
// {i, j, k} vectors and store them to corresponding class fields
cacheVertexProjections (this);
+
+ myScale = 1.0;
}
// =======================================================================
aRes->myEdgeDirs[4] = aRes->myVertices[0].XYZ() - aRes->myVertices[1].XYZ();
// RightUpper
aRes->myEdgeDirs[5] = aRes->myVertices[4].XYZ() - aRes->myVertices[5].XYZ();
+
+ aRes->myScale = 1.0 / theTrsf.ScaleFactor();
}
// compute frustum normals
gp_Pnt aDetectedPnt =
myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * (aV.Dot (myViewRayDir.XYZ()) / myViewRayDir.Dot (myViewRayDir));
- theDepth = aDetectedPnt.Distance (myNearPickedPnt);
+ theDepth = aDetectedPnt.Distance (myNearPickedPnt) * myScale;
return Standard_True;
}
// handle the case when triangle normal and selecting frustum direction are orthogonal: for this case, overlap
// is detected correctly, and distance to triangle's plane can be measured as distance to its arbitrary vertex.
const gp_XYZ aDiff = myNearPickedPnt.XYZ() - thePnt1.XYZ();
- theDepth = aTriangleNormal.Dot (aDiff);
+ theDepth = aTriangleNormal.Dot (aDiff) * myScale;
return Standard_True;
}
if (isInterior)
{
gp_Pnt aDetectedPnt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aTime;
- theDepth = myNearPickedPnt.Distance (aDetectedPnt);
+ theDepth = myNearPickedPnt.Distance (aDetectedPnt) * myScale;
return Standard_True;
}
// =======================================================================
Standard_Real SelectMgr_RectangularFrustum::DistToGeometryCenter (const gp_Pnt& theCOG)
{
- return theCOG.Distance (myNearPickedPnt);
+ return theCOG.Distance (myNearPickedPnt) * myScale;
}
// =======================================================================