Silence final compiler warnings

Generated with the assistance of an AI coding tool.
This commit is contained in:
Thomas Krijnen
2026-08-09 10:03:41 +02:00
parent a441757080
commit e9fffc221b
8 changed files with 12 additions and 46 deletions
+3 -2
View File
@@ -186,6 +186,7 @@ namespace {
Approx_Curve3d approx(hcc, precision_, GeomAbs_C0, 10, 10);
return approx.Curve();
}
throw std::runtime_error("Unexpected curve evaluation");
}
Handle(Geom_Surface) operator()(const taxonomy::extrusion::ptr& e) {
@@ -257,7 +258,7 @@ namespace {
}
Handle(Geom_Surface) open_cascade_kernel::convert_surface(const taxonomy::ptr surface) {
surface_creation_visitor v{ this };
surface_creation_visitor v{ this, {} };
if (dispatch_surface_creation<surface_creation_visitor, 0>::dispatch(surface, v)) {
return v.result;
} else {
@@ -281,7 +282,7 @@ bool open_cascade_kernel::convert(const taxonomy::face::ptr face, TopoDS_Shape&
}
const size_t num_bounds = face->children.size();
int num_outer_bounds = 0;
std::size_t num_outer_bounds = 0;
for (auto& bound : face->children) {
if (bound->external.value_or(false)) {
+5 -6
View File
@@ -290,7 +290,6 @@ bool open_cascade_kernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape&
// potentially incorrect as there is no guarantee that the wires for
// subsequently placed profiles are traversed from an equivalent start vertex.
for (auto it = shps.begin(); it < shps.end() - 1; ++it) {
auto ii = std::distance(shps.begin(), it);
auto jt = it + 1;
std::array<std::vector<TopoDS_Shape>::const_iterator, 2> fa = { it, jt };
std::vector<std::array<TopoDS_Wire, 2>> ws;
@@ -335,7 +334,7 @@ bool open_cascade_kernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape&
for (size_t i = 0; i < 2; ++i) {
NCollection_IndexedDataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher> ancestors;
const auto& wire = wp[i];
auto& result = profile_points[i];
auto& points = profile_points[i];
TopExp::MapShapesAndAncestors(
wire,
@@ -347,7 +346,7 @@ bool open_cascade_kernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape&
TopExp::Vertices(wire, v0, vn);
TopoDS_Vertex curr = v0;
result.push_back(BRep_Tool::Pnt(curr));
points.push_back(BRep_Tool::Pnt(curr));
while (true) {
if (curr.IsSame(vn)) {
@@ -356,8 +355,8 @@ bool open_cascade_kernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape&
const NCollection_List<TopoDS_Shape>& incidentEdges = ancestors.FindFromKey(curr);
for (NCollection_List<TopoDS_Shape>::Iterator it(incidentEdges); it.More(); it.Next()) {
const TopoDS_Edge& e = TopoDS::Edge(it.Value());
for (NCollection_List<TopoDS_Shape>::Iterator edge_it(incidentEdges); edge_it.More(); edge_it.Next()) {
const TopoDS_Edge& e = TopoDS::Edge(edge_it.Value());
TopoDS_Vertex ev0, ev1;
TopExp::Vertices(e, ev0, ev1);
@@ -368,7 +367,7 @@ bool open_cascade_kernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape&
} else {
previous = curr;
curr = other_on_edge;
result.push_back(BRep_Tool::Pnt(curr));
points.push_back(BRep_Tool::Pnt(curr));
break;
}
}
+1 -1
View File
@@ -222,7 +222,7 @@ namespace {
}
open_cascade_kernel::curve_creation_visitor_result_type open_cascade_kernel::convert_curve(const taxonomy::ptr curve) {
curve_creation_visitor v{ this };
curve_creation_visitor v{ this, {} };
if (dispatch_curve_creation<curve_creation_visitor, 0>::dispatch(curve, v)) {
return v.result;
} else {
+1 -6
View File
@@ -961,10 +961,6 @@ class curve_segment_evaluator {
auto cos_start_angle = cos(start_angle);
auto sin_start_angle = sin(start_angle);
// point on the parent curve
auto pcStartX = R * cos_start_angle + pcCenterX;
auto pcStartY = R * sin_start_angle + pcCenterY;
auto pcStartDx = -sign_l * sin_start_angle;
auto pcStartDy = sign_l * cos_start_angle;
@@ -1198,8 +1194,7 @@ class curve_segment_evaluator {
m.col(3) = Eigen::Vector4d(X, Y, 0.0, 1.0);
return m;
},
[start = start_, lu = length_unit_, coeffX, coeffY, convert_u](double u) -> Eigen::Matrix4d {
auto x = convert_u(u + start); // find x for u
[coeffY](double) -> Eigen::Matrix4d {
Eigen::Matrix4d c = Eigen::Matrix4d::Zero();
c(3, 0) = coeffY[2]; // this may need a unit conversion (also assume there is only 3 coefficients)
return c;
@@ -30,8 +30,6 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcEllipseProfileDef& inst) {
return nullptr;
}
const bool rotated = ry > rx;
taxonomy::matrix4::ptr m4;
bool has_position = true;
#ifdef SCHEMA_IfcParameterizedProfileDef_Position_IS_OPTIONAL
@@ -36,25 +36,6 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcFixedReferenceSweptAreaSolid
// @todo currently only the case is handled where directrix returns a piecewise_function
if (auto fn = std::dynamic_pointer_cast<taxonomy::function_item>(dir)) {
function_item_evaluator evaluator(settings_, fn);
double start = 0;
double end = fn->length();
#ifdef SCHEMA_HAS_IfcDirectrixCurveSweptAreaSolid
// IfcDirectrixCurveSweptAreaSolid introduced in 4.3 changed attribute type
// from optional IfcParamValue to optional IfcCurveMeasureSelect.
// Invocation of mapping on pre-4.3 models can never result in a piecewise_function.
if (inst.StartParam() && inst.StartParam().as<IfcSchema::IfcLengthMeasure>()) {
double s = inst.StartParam().as<IfcSchema::IfcLengthMeasure>();
if (s > start) {
start = s;
}
}
if (inst.EndParam() && inst.EndParam().as<IfcSchema::IfcLengthMeasure>()) {
double e = inst.EndParam().as<IfcSchema::IfcLengthMeasure>();
if (e < end) {
end = e;
}
}
#endif
auto evaluation_points = evaluator.evaluation_points();
for (const auto& dist_along : evaluation_points) {
auto m4 = evaluator.evaluate(dist_along);
@@ -86,10 +67,10 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcFixedReferenceSweptAreaSolid
Eigen::Vector3d tangent = m4.col(0).head<3>().normalized();
Eigen::Vector3d proj = (ref->components() - tangent * tangent.dot(ref->components()));
proj.normalize();
auto ref = proj.cross(tangent);
auto binormal = proj.cross(tangent);
m4b.col(0).head<3>() = proj;
m4b.col(1).head<3>() = ref;
m4b.col(1).head<3>() = binormal;
m4b.col(2).head<3>() = tangent;
m4b.col(3).head<3>() = pos;
@@ -28,8 +28,6 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcIShapeProfileDef& inst) {
#ifdef SCHEMA_IfcIShapeProfileDef_HAS_FlangeEdgeRadius
const bool doFlangeEdgeRadius = !!inst.FlangeEdgeRadius();
const bool hasSlope = !!inst.FlangeSlope();
#else
const bool doFlangeEdgeRadius = false;
#endif
const double x1 = inst.OverallWidth() / 2.0f * length_unit_;
-6
View File
@@ -44,11 +44,5 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMappedItem& inst) {
collection->children.push_back(shapes);
collection->matrix = taxonomy::make<taxonomy::matrix4>(res);
if (shapes != nullptr) {
for (auto& c : taxonomy::cast<taxonomy::collection>(shapes)->children) {
// @todo previously style was also copied.
}
}
return collection;
}