mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-12 18:29:35 +08:00
Coding - Apply more flags from Clang-tidy (#977)
- Refactor boolean expressions and improve code readability across multiple files - Simplified boolean expressions by removing unnecessary comparisons to true/false. - Replaced explicit boolean checks with direct variable usage Used flags: readability-static-accessed-through-instance readability-simplify-boolean-expr performance-for-range-copy performance-move-const-arg misc-unused-parameters misc-redundant-expression
This commit is contained in:
@@ -84,7 +84,7 @@ void BRepMesh_CurveTessellator::init()
|
||||
if (myParameters.AdjustMinSize)
|
||||
{
|
||||
aMinSize = std::min(aMinSize,
|
||||
myParameters.RelMinSize()
|
||||
IMeshTools_Parameters::RelMinSize()
|
||||
* GCPnts_AbscissaPoint::Length(myCurve,
|
||||
myCurve.FirstParameter(),
|
||||
myCurve.LastParameter(),
|
||||
|
||||
@@ -1541,10 +1541,7 @@ bool BRepMesh_Delaun::isVertexInsidePolygon(
|
||||
aPrevVertexDir = aCurVertexDir;
|
||||
}
|
||||
|
||||
if (std::abs(std::abs(aTotalAng) - Angle2PI) > Precision::Angular())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return std::abs(std::abs(aTotalAng) - Angle2PI) <= Precision::Angular();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
||||
@@ -82,7 +82,7 @@ bool BRepMesh_FaceDiscret::performInternal(const occ::handle<IMeshData_Model>& t
|
||||
OSD_Parallel::For(0,
|
||||
myModel->FacesNb(),
|
||||
aFunctor,
|
||||
!(myParameters.InParallel && myModel->FacesNb() > 1));
|
||||
!myParameters.InParallel || myModel->FacesNb() <= 1);
|
||||
if (!theRange.More())
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -186,7 +186,7 @@ void BRepMesh_ModelHealer::amplifyEdges()
|
||||
OSD_Parallel::ForEach(aEdgesToUpdate.cbegin(),
|
||||
aEdgesToUpdate.cend(),
|
||||
anEdgeAmplifier,
|
||||
!(myParameters.InParallel && aEdgesToUpdate.Size() > 1),
|
||||
!myParameters.InParallel || aEdgesToUpdate.Size() <= 1,
|
||||
aEdgesToUpdate.Size());
|
||||
|
||||
IMeshData::MapOfIFacePtr aFacesToCheck(1, aTmpAlloc);
|
||||
@@ -203,7 +203,7 @@ void BRepMesh_ModelHealer::amplifyEdges()
|
||||
OSD_Parallel::ForEach(aFacesToCheck.cbegin(),
|
||||
aFacesToCheck.cend(),
|
||||
*this,
|
||||
!(myParameters.InParallel && aFacesToCheck.Size() > 1),
|
||||
!myParameters.InParallel || aFacesToCheck.Size() <= 1,
|
||||
aFacesToCheck.Size());
|
||||
|
||||
aEdgesToUpdate.Clear();
|
||||
|
||||
@@ -301,8 +301,8 @@ void BRepMesh_NURBSRangeSplitter::AdjustRange()
|
||||
const std::pair<double, double>& aRangeU = GetRangeU();
|
||||
const std::pair<double, double>& aRangeV = GetRangeV();
|
||||
|
||||
myIsValid = !(aRangeU.first < -0.5 || aRangeU.second > 1.5 || aRangeV.first < -0.5
|
||||
|| aRangeV.second > 1.5);
|
||||
myIsValid = aRangeU.first >= -0.5 && aRangeU.second <= 1.5 && aRangeV.first >= -0.5
|
||||
&& aRangeV.second <= 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user