All: Reformat according to new standard

This commit is contained in:
pre-commit-ci[bot]
2025-11-11 13:49:01 +01:00
committed by Kacper Donat
parent eafd18dac0
commit 25c3ba7338
2390 changed files with 154630 additions and 115818 deletions

View File

@@ -77,8 +77,8 @@ void ShapeValidator::checkEdge(const TopoDS_Shape& shape)
Standard_Real u0; // contains output
Standard_Real u1; // contains output
Handle(Geom_Curve) c_geom = BRep_Tool::Curve(etmp, heloc, u0, u1); // The geometric curve
Handle(Geom_BezierCurve) bez_geom =
Handle(Geom_BezierCurve)::DownCast(c_geom); // Try to get Bezier curve
Handle(Geom_BezierCurve) bez_geom = Handle(Geom_BezierCurve)::DownCast(c_geom); // Try to get
// Bezier curve
// if not a Bezier then try to create a B-spline surface from the edges
if (bez_geom.IsNull()) {
@@ -98,9 +98,11 @@ void ShapeValidator::checkAndAdd(const TopoDS_Shape& shape, Handle(ShapeExtend_W
}
}
void ShapeValidator::checkAndAdd(const Part::TopoShape& ts,
const char* subName,
Handle(ShapeExtend_WireData) * aWD)
void ShapeValidator::checkAndAdd(
const Part::TopoShape& ts,
const char* subName,
Handle(ShapeExtend_WireData) * aWD
)
{
try {
if (subName && *subName != '\0') {
@@ -181,7 +183,8 @@ App::DocumentObjectExecReturn* GeomFillSurface::execute()
}
catch (StdFail_NotDone&) {
return new App::DocumentObjectExecReturn(
"A curve was not a B-spline and could not be converted into one.");
"A curve was not a B-spline and could not be converted into one."
);
}
catch (Standard_Failure& e) {
return new App::DocumentObjectExecReturn(e.GetMessageString());
@@ -197,8 +200,7 @@ GeomFill_FillingStyle GeomFillSurface::getFillingStyle()
case GeomFill_CurvedStyle:
return static_cast<GeomFill_FillingStyle>(FillType.getValue());
default:
Standard_Failure::Raise(
"Filling style must be 0 (Stretch), 1 (Coons), or 2 (Curved).\n");
Standard_Failure::Raise("Filling style must be 0 (Stretch), 1 (Coons), or 2 (Curved).\n");
return GeomFill_StretchStyle; // this is to shut up the compiler
}
}
@@ -217,8 +219,7 @@ bool GeomFillSurface::getWire(TopoDS_Wire& aWire)
for (const auto& set : boundary) {
if (set.first->isDerivedFrom<Part::Feature>()) {
for (const auto& jt : set.second) {
const Part::TopoShape& ts =
static_cast<Part::Feature*>(set.first)->Shape.getShape();
const Part::TopoShape& ts = static_cast<Part::Feature*>(set.first)->Shape.getShape();
validator.checkAndAdd(ts, jt.c_str(), &aWD);
}
}
@@ -279,8 +280,8 @@ void GeomFillSurface::createBezierSurface(TopoDS_Wire& aWire)
const TopoDS_Edge hedge = TopoDS::Edge(anExp.Current());
TopLoc_Location heloc; // this will be output
Handle(Geom_Curve) c_geom = BRep_Tool::Curve(hedge, heloc, u1, u2); // The geometric curve
Handle(Geom_BezierCurve) bezier =
Handle(Geom_BezierCurve)::DownCast(c_geom); // Try to get Bezier curve
Handle(Geom_BezierCurve) bezier = Handle(Geom_BezierCurve)::DownCast(c_geom); // Try to get
// Bezier curve
if (!bezier.IsNull()) {
bezier->Segment(u1, u2); // DownCast(c_geom) will not trim bezier, so DIY
@@ -330,8 +331,9 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire)
const TopoDS_Edge& edge = TopoDS::Edge(anExp.Current());
TopLoc_Location heloc; // this will be output
Handle(Geom_Curve) c_geom = BRep_Tool::Curve(edge, heloc, u1, u2); // The geometric curve
Handle(Geom_BSplineCurve) bspline =
Handle(Geom_BSplineCurve)::DownCast(c_geom); // Try to get BSpline curve
Handle(Geom_BSplineCurve) bspline = Handle(Geom_BSplineCurve)::DownCast(
c_geom
); // Try to get BSpline curve
gp_Trsf transf = heloc.Transformation();
if (!bspline.IsNull()) {
@@ -355,11 +357,12 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire)
else {
// GeomConvert failed, try ShapeConstruct_Curve now
ShapeConstruct_Curve scc;
Handle(Geom_BSplineCurve) spline =
scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion());
Handle(Geom_BSplineCurve) spline
= scc.ConvertToBSpline(c_geom, u1, u2, Precision::Confusion());
if (spline.IsNull()) {
Standard_Failure::Raise(
"A curve was not a B-spline and could not be converted into one.");
"A curve was not a B-spline and could not be converted into one."
);
}
spline->Transform(transf); // apply original transformation to control points
curves.push_back(spline);