mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023404: Create SquareConfusion function in Precision package for speed and convenience
SquareConfusion function was created in FoundationClasses module -> TKMath toolkit -> Precision package. The function returns square of Precision::Confusion(). SquareConfusion function was corrected in FoundationClasses module -> TKMath toolkit -> Precision package. Squares of Precision::Confusion() were replaced by Precision::SquareConfusion().
This commit is contained in:
@@ -322,7 +322,7 @@ void DsgPrs::ComputePlanarFacesLengthPresentation( const Standard_Real FirstArro
|
||||
EndOfArrow1 = ElCLib::Value( ElCLib::Parameter( FirstLin, OffsetPoint ), FirstLin );
|
||||
EndOfArrow2 = ElCLib::Value( ElCLib::Parameter( SecondLin, OffsetPoint ), SecondLin );
|
||||
|
||||
if (EndOfArrow1.SquareDistance( EndOfArrow2 ) > Precision::Confusion()*Precision::Confusion()) // not null length
|
||||
if (EndOfArrow1.SquareDistance( EndOfArrow2 ) > Precision::SquareConfusion()) // not null length
|
||||
{
|
||||
gp_Dir LengthDir( gp_Vec( EndOfArrow1, EndOfArrow2 ) );
|
||||
if ((FirstArrowLength + SecondArrowLength)*(FirstArrowLength + SecondArrowLength) <
|
||||
@@ -359,7 +359,7 @@ void DsgPrs::ComputeCurvilinearFacesLengthPresentation( const Standard_Real Firs
|
||||
GeomAPI_ProjectPointOnCurve ProjectorOnCurve;
|
||||
Quantity_Parameter U1, V1, U2, V2;
|
||||
Standard_Real LastU, LastV;
|
||||
Standard_Real SquareTolerance = Precision::Confusion()*Precision::Confusion();
|
||||
Standard_Real SquareTolerance = Precision::SquareConfusion();
|
||||
|
||||
ProjectorOnSurface.Init( AttachmentPoint1, SecondSurf );
|
||||
Standard_Integer Index(1);
|
||||
@@ -391,7 +391,7 @@ void DsgPrs::ComputeCurvilinearFacesLengthPresentation( const Standard_Real Firs
|
||||
else
|
||||
DirOfArrow1 = DirAttach;
|
||||
|
||||
if (EndOfArrow2.SquareDistance( AttachmentPoint2 ) > Precision::Confusion()*Precision::Confusion())
|
||||
if (EndOfArrow2.SquareDistance( AttachmentPoint2 ) > Precision::SquareConfusion())
|
||||
{
|
||||
VCurve = SecondSurf->VIso( V1 );
|
||||
ProjectorOnCurve.Init( EndOfArrow2, VCurve );
|
||||
|
@@ -94,7 +94,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
||||
{
|
||||
gp_Vec Vec1( Middle, Point1 );
|
||||
|
||||
if (Vec1.SquareMagnitude() > Precision::Confusion()*Precision::Confusion())
|
||||
if (Vec1.SquareMagnitude() > Precision::SquareConfusion())
|
||||
{
|
||||
Standard_Real Angle = gp_Vec( Middle, Point1 ).Angle( gp_Vec( Middle, Point3 ) );
|
||||
gp_Pnt MidPnt = Point1.Rotated( Plane->Pln().Axis(), Angle*0.5 );
|
||||
|
Reference in New Issue
Block a user