mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-21 04:32:23 +00:00
Address compiler warnings
This commit is contained in:
@@ -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<cgal_shape_t>(*this).size_of_vertices();
|
||||
return (int) static_cast<cgal_shape_t>(*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<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to) {
|
||||
void ifcopenshell::geometry::CgalShape::map(const std::vector<OpaqueCoordinate<4>>&, const std::vector<OpaqueCoordinate<4>>&) {
|
||||
throw std::runtime_error("Not implemented");
|
||||
}
|
||||
|
||||
|
||||
@@ -252,12 +252,13 @@ enum tree_type { TT_NARY_BRANCH, TT_PLANE };
|
||||
template <typename Kernel>
|
||||
class halfspace_tree {
|
||||
public:
|
||||
virtual CGAL::Nef_polyhedron_3<Kernel> evaluate(int level = 0) const = 0;
|
||||
virtual CGAL::Nef_polyhedron_3<Kernel> evaluate() const = 0;
|
||||
virtual void accumulate(std::list<typename Kernel::Plane_3>&) const = 0;
|
||||
virtual std::unique_ptr<halfspace_tree> map(const plane_map<Kernel>&) const = 0;
|
||||
virtual std::string dump(int level = 0) const = 0;
|
||||
virtual tree_type kind() const = 0;
|
||||
virtual void merge(CGAL::Nef_polyhedron_3<Kernel>&) 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<Kernel> evaluate(int level) const {
|
||||
virtual CGAL::Nef_polyhedron_3<Kernel> evaluate() const {
|
||||
CGAL::Nef_polyhedron_3<Kernel> 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<CGAL::Nef_polyhedron_3<Kernel>> 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<CGAL::Nef_polyhedron_3<Kernel>> 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<Kernel> evaluate(int level) const {
|
||||
virtual CGAL::Nef_polyhedron_3<Kernel> evaluate() const {
|
||||
if constexpr(CGAL::Is_extended_kernel<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());
|
||||
|
||||
@@ -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<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to) {
|
||||
void ifcopenshell::geometry::OpenCascadeShape::map(const std::vector<OpaqueCoordinate<4>>&, const std::vector<OpaqueCoordinate<4>>&) {
|
||||
throw std::runtime_error("Not implemented");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user