// (Sqrt(5.0) - 1.0) / 4.0
static const Standard_Real aSinCoeff = 0.30901699437494742410229341718282;
static const Standard_Integer aMaxPntCoeff = 15;
-
+static const Standard_Real Epsilon1 = Epsilon(1.);
//=======================================================================
//function : EvalCurv
NCollection_Sequence<Standard_Integer>& theInds,
const Standard_Boolean ChkCurv)
{
- const Standard_Real eps = Epsilon(1.);
Standard_Integer anInd1 = theInds(theI);
Standard_Integer anInd = theInds(theI - 1);
//
//mp *= 2.; //P(j,i) = -P(i,j);
//
Standard_Real m1m2 = m1*m2;
- if(m1m2 > eps)
- {
- sina = mp/m1m2;
- }
- else
- {
- sina = 0.;
- }
- sina = Sqrt(sina);
-
+ sina = (m1m2 > Epsilon1 ? Sqrt (mp / m1m2) : 0.);
if(sina > aSinCoeff)
{
theInds.InsertBefore(theI, mid);
//
if (iFlag1 == 1) {
iFlag1 = !myContext->ComputePE(aP1, aRealTol, aSp, aTx, aDist);
- if(iFlag1)
- {
- if (theTolNew < aDist)
- theTolNew = aDist;
- }
+ if (iFlag1 && theTolNew < aDist)
+ theTolNew = aDist;
}
//
if (iFlag2 == 1) {
iFlag2 = !myContext->ComputePE(aP2, aRealTol, aSp, aTx, aDist);
- if(iFlag2)
- {
- if (theTolNew < aDist)
- theTolNew = aDist;
- }
+ if (iFlag2 && theTolNew < aDist)
+ theTolNew = aDist;
}
//
if (iFlag1 && iFlag2) {
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
+static const Standard_Real Epsilon1 = Epsilon(1.);
+
//=======================================================================
//function : UIntegrationOrder
//purpose :
Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const
{
Bnd_Box2d aBox;
- const Standard_Real eps = Epsilon(1.);
BndLib_Add2dCurve::Add(myCurve, 1.e-7, aBox);
Standard_Real aXmin, aXmax, aYmin, aYmax;
Standard_Real aVmax = mySurface.LastVParameter();
Standard_Real dv = (aVmax-aVmin);
- Standard_Real anR = 1.;
- if(dv > eps)
- {
- anR = (aYmax-aYmin) / dv;
- anR = Min(anR, 1.);
- }
+ Standard_Real anR = (dv > Epsilon1 ? Min ((aYmax - aYmin) / dv, 1.) : 1.);
// Standard_Integer anRInt = Max(RealToInt(Ceiling(SVIntSubs()*anR)), 2);
Standard_Integer anRInt = RealToInt(Ceiling(SVIntSubs()*anR));
if(Precision::IsInfinite(p1.X()) || Precision::IsInfinite(p1.Y()) ||
Precision::IsInfinite(p1.Z()))
{
- samerange = Standard_False;
- B.SameRange(newEdge, samerange);
+ B.SameRange(newEdge, Standard_False);
return;
}
p2 = myAC3d.Value(lastPar).Transformed(myLocation);
if(Precision::IsInfinite(p2.X()) || Precision::IsInfinite(p2.Y()) ||
Precision::IsInfinite(p2.Z()))
{
- samerange = Standard_False;
- B.SameRange(newEdge, samerange);
+ B.SameRange(newEdge, Standard_False);
return;
}
Standard_Real fact = myAC3d.LastParameter() - myAC3d.FirstParameter();
if(Precision::IsInfinite(p1.X()) || Precision::IsInfinite(p1.Y()) ||
Precision::IsInfinite(p1.Z()))
{
- samerange = Standard_False;
- B.SameRange(newEdge, samerange);
+ B.SameRange(newEdge, Standard_False);
return;
}
p2 = myCurve->Value(lastPar);
if(Precision::IsInfinite(p2.X()) || Precision::IsInfinite(p2.Y()) ||
Precision::IsInfinite(p2.Z()))
{
- samerange = Standard_False;
- B.SameRange(newEdge, samerange);
+ B.SameRange(newEdge, Standard_False);
return;
}
Standard_Real fact = myLast - myFirst;
Standard_Integer aNbNodes;
MeshVS_EntityType aEntType;
+ TColStd_Array1OfReal aCoords(1, 3);
+ aCoords.Init (0.);
TColStd_MapIteratorOfPackedMapOfInteger anIter( anAllIDs );
for ( ; anIter.More(); anIter.Next() )
{
- TColStd_Array1OfReal aCoords(1, 3);
- aCoords(1) = 0.;
- aCoords(2) = 0.;
- aCoords(3) = 0.;
Standard_Boolean IsValidData = Standard_False;
if (anIsElement)
IsValidData = aMesh->GetDataSource()->GetNormal(anIter.Key(), 3, aCoords.ChangeValue(1), aCoords.ChangeValue(2), aCoords.ChangeValue(3));
math_Vector InvLengthMax(1, Ninc); // Pour bloquer les pas a 1/4 du domaine
math_IntegerVector aConstraints(1, Ninc); // Pour savoir sur quels bord on se trouve
for (i = 1; i <= Ninc ; i++) {
- // modified by NIZHNY-MKK Mon Oct 3 18:03:50 2005
- // InvLengthMax(i) = 1. / Max(Abs(SupBound(i) - InfBound(i))/4, 1.e-9);
- Standard_Real SupBound = theSupBound(i), InfBound = theInfBound(i);
- if(Precision::IsNegativeInfinite(SupBound))
- {
- SupBound = -Precision::Infinite();
- }
- else if(Precision::IsPositiveInfinite(SupBound))
- {
- SupBound = Precision::Infinite();
- }
- if(Precision::IsNegativeInfinite(InfBound))
- {
- InfBound = -Precision::Infinite();
- }
- else if(Precision::IsPositiveInfinite(InfBound))
- {
- InfBound = Precision::Infinite();
- }
-
+ Standard_Real SupBound = Min (theSupBound(i), Precision::Infinite());
+ Standard_Real InfBound = Max (theInfBound(i), -Precision::Infinite());
InvLengthMax(i) = 1. / Max((SupBound - InfBound)/4, 1.e-9);
}