diff --git a/src/ifcgeom/kernels/opencascade/face.cpp b/src/ifcgeom/kernels/opencascade/face.cpp index 4031315fa3..7c9a0de256 100644 --- a/src/ifcgeom/kernels/opencascade/face.cpp +++ b/src/ifcgeom/kernels/opencascade/face.cpp @@ -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::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)) { diff --git a/src/ifcgeom/kernels/opencascade/loft.cpp b/src/ifcgeom/kernels/opencascade/loft.cpp index e69755088b..e3d612debe 100644 --- a/src/ifcgeom/kernels/opencascade/loft.cpp +++ b/src/ifcgeom/kernels/opencascade/loft.cpp @@ -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::const_iterator, 2> fa = { it, jt }; std::vector> 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, 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& incidentEdges = ancestors.FindFromKey(curr); - for (NCollection_List::Iterator it(incidentEdges); it.More(); it.Next()) { - const TopoDS_Edge& e = TopoDS::Edge(it.Value()); + for (NCollection_List::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; } } diff --git a/src/ifcgeom/kernels/opencascade/loop.cpp b/src/ifcgeom/kernels/opencascade/loop.cpp index f89a9d93cc..e43d1ae939 100644 --- a/src/ifcgeom/kernels/opencascade/loop.cpp +++ b/src/ifcgeom/kernels/opencascade/loop.cpp @@ -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::dispatch(curve, v)) { return v.result; } else { diff --git a/src/ifcgeom/mapping/IfcCurveSegment.cpp b/src/ifcgeom/mapping/IfcCurveSegment.cpp index 5923f54fa5..849e0a0888 100644 --- a/src/ifcgeom/mapping/IfcCurveSegment.cpp +++ b/src/ifcgeom/mapping/IfcCurveSegment.cpp @@ -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; diff --git a/src/ifcgeom/mapping/IfcEllipseProfileDef.cpp b/src/ifcgeom/mapping/IfcEllipseProfileDef.cpp index 77d5eca129..788668db0f 100644 --- a/src/ifcgeom/mapping/IfcEllipseProfileDef.cpp +++ b/src/ifcgeom/mapping/IfcEllipseProfileDef.cpp @@ -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 diff --git a/src/ifcgeom/mapping/IfcFixedReferenceSweptAreaSolid.cpp b/src/ifcgeom/mapping/IfcFixedReferenceSweptAreaSolid.cpp index 90322ddbcf..b0f43bdf39 100644 --- a/src/ifcgeom/mapping/IfcFixedReferenceSweptAreaSolid.cpp +++ b/src/ifcgeom/mapping/IfcFixedReferenceSweptAreaSolid.cpp @@ -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(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()) { - double s = inst.StartParam().as(); - if (s > start) { - start = s; - } - } - if (inst.EndParam() && inst.EndParam().as()) { - double e = inst.EndParam().as(); - 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; diff --git a/src/ifcgeom/mapping/IfcIShapeProfileDef.cpp b/src/ifcgeom/mapping/IfcIShapeProfileDef.cpp index 78747f5b0e..145ccff869 100644 --- a/src/ifcgeom/mapping/IfcIShapeProfileDef.cpp +++ b/src/ifcgeom/mapping/IfcIShapeProfileDef.cpp @@ -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_; diff --git a/src/ifcgeom/mapping/IfcMappedItem.cpp b/src/ifcgeom/mapping/IfcMappedItem.cpp index b4d8a4e1cc..b9703803b4 100644 --- a/src/ifcgeom/mapping/IfcMappedItem.cpp +++ b/src/ifcgeom/mapping/IfcMappedItem.cpp @@ -44,11 +44,5 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcMappedItem& inst) { collection->children.push_back(shapes); collection->matrix = taxonomy::make(res); - if (shapes != nullptr) { - for (auto& c : taxonomy::cast(shapes)->children) { - // @todo previously style was also copied. - } - } - return collection; }