mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-22 12:48:37 +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:
@@ -1061,9 +1061,6 @@ const TopoDS_Vertex& BRepPrim_GWedge::Vertex(const BRepPrim_Direction d1,
|
||||
|
||||
bool BRepPrim_GWedge::IsDegeneratedShape()
|
||||
{
|
||||
if ((XMax - XMin <= Precision::Confusion()) || (YMax - YMin <= Precision::Confusion())
|
||||
|| (ZMax - ZMin <= Precision::Confusion()) || (Z2Max - Z2Min < 0) || (X2Max - X2Min < 0))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return (XMax - XMin <= Precision::Confusion()) || (YMax - YMin <= Precision::Confusion())
|
||||
|| (ZMax - ZMin <= Precision::Confusion()) || (Z2Max - Z2Min < 0) || (X2Max - X2Min < 0);
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ const TopoDS_Face& BRepPrim_OneAxis::EndFace()
|
||||
// For equal heights with open meridian (not closed), AxisEdge is skipped.
|
||||
// Note: For closed meridian, areHeightsEqual() may be true but we don't change
|
||||
// the wire structure, so don't apply equal heights reversal.
|
||||
if (!isHeightInverted() && !(areHeightsEqual() && !MeridianClosed()))
|
||||
if (!isHeightInverted() && (!areHeightsEqual() || MeridianClosed()))
|
||||
{
|
||||
myBuilder.ReverseFace(myFaces[FEND]);
|
||||
}
|
||||
@@ -737,7 +737,7 @@ const TopoDS_Wire& BRepPrim_OneAxis::StartWire()
|
||||
if (!MeridianClosed() && !heightsEqual)
|
||||
{
|
||||
if (!VMaxInfinite() || !VMinInfinite())
|
||||
myBuilder.AddWireEdge(myWires[WSTART], AxisEdge(), isInverted ? true : false);
|
||||
myBuilder.AddWireEdge(myWires[WSTART], AxisEdge(), isInverted);
|
||||
}
|
||||
|
||||
if (HasTop())
|
||||
@@ -803,7 +803,7 @@ const TopoDS_Wire& BRepPrim_OneAxis::EndWire()
|
||||
{
|
||||
if (!VMaxInfinite() || !VMinInfinite())
|
||||
{
|
||||
myBuilder.AddWireEdge(myWires[WEND], AxisEdge(), isInverted ? false : true);
|
||||
myBuilder.AddWireEdge(myWires[WEND], AxisEdge(), !isInverted);
|
||||
}
|
||||
}
|
||||
if (HasBottom())
|
||||
@@ -877,12 +877,9 @@ const TopoDS_Edge& BRepPrim_OneAxis::AxisEdge()
|
||||
const double yMin = MeridianValue(myVMin).Y();
|
||||
|
||||
if (!VMaxInfinite())
|
||||
myBuilder.AddEdgeVertex(myEdges[EAXIS], AxisTopVertex(), yMax, isInverted ? true : false);
|
||||
myBuilder.AddEdgeVertex(myEdges[EAXIS], AxisTopVertex(), yMax, isInverted);
|
||||
if (!VMinInfinite())
|
||||
myBuilder.AddEdgeVertex(myEdges[EAXIS],
|
||||
AxisBottomVertex(),
|
||||
yMin,
|
||||
isInverted ? false : true);
|
||||
myBuilder.AddEdgeVertex(myEdges[EAXIS], AxisBottomVertex(), yMin, !isInverted);
|
||||
}
|
||||
|
||||
myBuilder.CompleteEdge(myEdges[EAXIS]);
|
||||
|
||||
Reference in New Issue
Block a user