First slice plug-in refactor

This commit is contained in:
Thomas Krijnen
2026-04-14 13:50:23 +02:00
parent 2018bcb3c1
commit aa10784154
31 changed files with 958 additions and 322 deletions
@@ -208,6 +208,13 @@ namespace ifcopenshell { namespace geometry {
operator const cgal_shape_t& () const { to_poly(); return *shape_; }
const cgal_shape_t& poly() const { to_poly(); return *shape_; }
virtual std::string_view backend_id() const {
#ifdef IFOPSH_SIMPLE_KERNEL
return "cgal-simple";
#else
return "cgal";
#endif
}
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id) const;
virtual void Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
@@ -284,6 +291,13 @@ namespace ifcopenshell { namespace geometry {
shape_.reset(new halfspace_tree_plane<Kernel_>(shape));
planes_.push_back(shape);
}
virtual std::string_view backend_id() const {
#ifdef IFOPSH_SIMPLE_KERNEL
return "cgal-simple";
#else
return "cgal";
#endif
}
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id) const;
virtual void Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
@@ -26,6 +26,7 @@ public:
const std::vector<ManifoldPart>& parts() const { return parts_; }
std::optional<manifold::Manifold> as_manifold() const;
virtual std::string_view backend_id() const { return "manifold"; }
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id) const;
virtual void Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
@@ -52,6 +52,7 @@ namespace ifcopenshell {
const TopoDS_Shape& shape() const { return shape_; }
operator const TopoDS_Shape& () { return shape_; }
virtual std::string_view backend_id() const { return "opencascade"; }
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id) const;
virtual void Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
@@ -113,4 +114,4 @@ namespace ifcopenshell {
}
}
#endif
#endif
@@ -22,6 +22,7 @@ public:
explicit PassthroughShape(std::vector<PassthroughPart>&& parts);
const std::vector<PassthroughPart>& parts() const { return parts_; }
virtual std::string_view backend_id() const { return "passthrough"; }
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id) const;
virtual void Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;