diff --git a/src/ifcgeom/AbstractKernel.h b/src/ifcgeom/AbstractKernel.h index 7f64b2bc25..c8f12cc2b2 100644 --- a/src/ifcgeom/AbstractKernel.h +++ b/src/ifcgeom/AbstractKernel.h @@ -91,7 +91,7 @@ namespace { template <> struct dispatch_conversion { - static bool dispatch(ifcopenshell::geometry::kernels::AbstractKernel*, ifcopenshell::geometry::taxonomy::kinds item_kind, const ifcopenshell::geometry::taxonomy::ptr item, IfcGeom::ConversionResults&) { + static bool dispatch(ifcopenshell::geometry::kernels::AbstractKernel*, ifcopenshell::geometry::taxonomy::kinds, const ifcopenshell::geometry::taxonomy::ptr item, IfcGeom::ConversionResults&) { Logger::Error("No conversion for " + std::to_string(item->kind())); return false; } diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h index 5cfd3d0bc2..b0c5bbb12e 100644 --- a/src/ifcgeom/IfcGeomRepresentation.h +++ b/src/ifcgeom/IfcGeomRepresentation.h @@ -70,7 +70,7 @@ namespace IfcGeom { bool calculate_surface_area(double&) const; bool calculate_projected_surface_area(const ifcopenshell::geometry::taxonomy::matrix4& ax, double& along_x, double& along_y, double& along_z) const; - int size() const { return shapes_.size(); } + int size() const { return (int) shapes_.size(); } const IfcGeom::ConversionResultShape* item(int i) const; int item_id(int i) const; }; diff --git a/src/ifcgeom/Iterator.h b/src/ifcgeom/Iterator.h index d348f24dfc..ee017ea787 100644 --- a/src/ifcgeom/Iterator.h +++ b/src/ifcgeom/Iterator.h @@ -231,7 +231,7 @@ namespace IfcGeom { task_result_index_ = 0; done = 0; - total = tasks_.size(); + total = (int) tasks_.size(); if (num_threads_ != 1) { init_future_ = std::async(std::launch::async, [this]() { process_concurrently(); }); diff --git a/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp b/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp index 0947129b57..1cb9b301c7 100644 --- a/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp +++ b/src/ifcgeom/kernels/cgal/CgalConversionResult.cpp @@ -168,7 +168,7 @@ void ifcopenshell::geometry::CgalShape::Triangulate(ifcopenshell::geometry::Sett vidx = it->second; } - vertexidx[i++] = vidx; + vertexidx[i++] = (int) vidx; ++num_vertices; ++current_halfedge; @@ -216,7 +216,7 @@ double ifcopenshell::geometry::CgalShape::bounding_box(void *& b) const { } int ifcopenshell::geometry::CgalShape::num_vertices() const { - return static_cast(*this).size_of_vertices(); + return (int) static_cast(*this).size_of_vertices(); } void ifcopenshell::geometry::CgalShape::set_box(void * b) { @@ -228,14 +228,14 @@ void ifcopenshell::geometry::CgalShape::set_box(void * b) { int ifcopenshell::geometry::CgalShape::surface_genus() const { to_poly(); - int nv = shape_->size_of_vertices(); - int ne = shape_->size_of_halfedges() / 2; - int nf = shape_->size_of_facets(); + auto nv = shape_->size_of_vertices(); + auto ne = shape_->size_of_halfedges() / 2; + auto nf = shape_->size_of_facets(); - const int euler = nv - ne + nf; - const int genus = (2 - euler) / 2; + auto euler = nv - ne + nf; + auto genus = (2 - euler) / 2; - return genus; + return (int) genus; } bool ifcopenshell::geometry::CgalShape::is_manifold() const { @@ -247,18 +247,18 @@ bool ifcopenshell::geometry::CgalShape::is_manifold() const { int ifcopenshell::geometry::CgalShape::num_edges() const { to_poly(); - return shape_->size_of_halfedges() / 2; + return (int) shape_->size_of_halfedges() / 2; } int ifcopenshell::geometry::CgalShape::num_faces() const { #ifndef IFOPSH_SIMPLE_KERNEL if (nef_) { - return nef_->number_of_facets(); + return (int) nef_->number_of_facets(); } else #endif if (shape_) { - return shape_->size_of_facets(); + return (int) shape_->size_of_facets(); } else { return 0; } @@ -537,11 +537,11 @@ ConversionResultShape* ifcopenshell::geometry::CgalShape::moved(ifcopenshell::ge return new CgalShape(s, convex_tag_); } -void ifcopenshell::geometry::CgalShape::map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to) { +void ifcopenshell::geometry::CgalShape::map(OpaqueCoordinate<4>&, OpaqueCoordinate<4>&) { throw std::runtime_error("Not implemented"); } -void ifcopenshell::geometry::CgalShape::map(const std::vector>& from, const std::vector>& to) { +void ifcopenshell::geometry::CgalShape::map(const std::vector>&, const std::vector>&) { throw std::runtime_error("Not implemented"); } diff --git a/src/ifcgeom/kernels/cgal/nef_to_halfspace_tree.h b/src/ifcgeom/kernels/cgal/nef_to_halfspace_tree.h index 30765969ce..fa410a84f9 100644 --- a/src/ifcgeom/kernels/cgal/nef_to_halfspace_tree.h +++ b/src/ifcgeom/kernels/cgal/nef_to_halfspace_tree.h @@ -252,12 +252,13 @@ enum tree_type { TT_NARY_BRANCH, TT_PLANE }; template class halfspace_tree { public: - virtual CGAL::Nef_polyhedron_3 evaluate(int level = 0) const = 0; + virtual CGAL::Nef_polyhedron_3 evaluate() const = 0; virtual void accumulate(std::list&) const = 0; virtual std::unique_ptr map(const plane_map&) const = 0; virtual std::string dump(int level = 0) const = 0; virtual tree_type kind() const = 0; virtual void merge(CGAL::Nef_polyhedron_3&) const = 0; + virtual ~halfspace_tree() {} }; // Halfspace tree component as n-ary operands @@ -291,18 +292,18 @@ public: ss << std::string(level * 2, ' ') << ")" << std::endl; return ss.str(); } - virtual CGAL::Nef_polyhedron_3 evaluate(int level) const { + virtual CGAL::Nef_polyhedron_3 evaluate() const { CGAL::Nef_polyhedron_3 result; if (operation_ == OP_SUBTRACTION) { if (operands_.size() != 2) { throw std::runtime_error(""); } - result = operands_.front()->evaluate(level + 1) - operands_.back()->evaluate(level + 1); + result = operands_.front()->evaluate() - operands_.back()->evaluate(); } else if (operation_ == OP_UNION) { CGAL::Nef_nary_union_3> builder; for (auto& op : operands_) { - builder.add_polyhedron(op->evaluate(level + 1)); + builder.add_polyhedron(op->evaluate()); } result = builder.get_union(); } else if (operation_ == OP_INTERSECTION) { @@ -320,7 +321,7 @@ public: bool first = true; for (auto& op : operands_) { if (first) { - result = op->evaluate(level + 1); + result = op->evaluate(); first = false; } else { op->merge(result); @@ -329,7 +330,7 @@ public: } else { CGAL::Nef_nary_intersection_3> builder; for (auto& op : operands_) { - builder.add_polyhedron(op->evaluate(level + 1)); + builder.add_polyhedron(op->evaluate()); } result = builder.get_intersection(); } @@ -339,11 +340,11 @@ public: bool first = true; for (auto& op : operands_) { if (first) { - r = op->evaluate(level + 1); + r = op->evaluate(); first = false; continue; } - r = r * op->evaluate(level + 1); + r = r * op->evaluate(); } return r; */ @@ -451,7 +452,7 @@ public: ss << std::string(level * 2, ' ') << "p " << std::setprecision(15) << plane_ << std::endl; return ss.str(); } - virtual CGAL::Nef_polyhedron_3 evaluate(int level) const { + virtual CGAL::Nef_polyhedron_3 evaluate() const { if constexpr(CGAL::Is_extended_kernel::value_type::value) { throw std::runtime_error("Not implemented yet"); // typename Kernel::Plane_3 plane(plane_.a().exact(), plane_.b().exact(), plane_.c().exact(), plane_.d().exact()); diff --git a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp index 0bedee7355..8f3193469b 100644 --- a/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp +++ b/src/ifcgeom/kernels/opencascade/OpenCascadeConversionResult.cpp @@ -430,10 +430,10 @@ ConversionResultShape* ifcopenshell::geometry::OpenCascadeShape::moved(ifcopensh return new OpenCascadeShape(IfcGeom::util::apply_transformation(shape_, *t)); } -void ifcopenshell::geometry::OpenCascadeShape::map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to) { +void ifcopenshell::geometry::OpenCascadeShape::map(OpaqueCoordinate<4>&, OpaqueCoordinate<4>&) { throw std::runtime_error("Not implemented"); } -void ifcopenshell::geometry::OpenCascadeShape::map(const std::vector>& from, const std::vector>& to) { +void ifcopenshell::geometry::OpenCascadeShape::map(const std::vector>&, const std::vector>&) { throw std::runtime_error("Not implemented"); } diff --git a/src/ifcgeom/taxonomy.h b/src/ifcgeom/taxonomy.h index 7a5d7f1d32..6d130e9953 100644 --- a/src/ifcgeom/taxonomy.h +++ b/src/ifcgeom/taxonomy.h @@ -289,7 +289,7 @@ typedef item const* ptr; boost::hash_combine(h, std::hash()(elem)); } } - return h; + return (uint32_t) h; } }; @@ -741,7 +741,8 @@ typedef item const* ptr; for (auto& c : children) { boost::hash_combine(h, c->hash()); } - return h; + // @todo should we really use uint32_t instead of size_t for hashes? + return (uint32_t) h; } };