mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Implement shape serialization for cgal, possibility to supply geometry library to iterator in py
This commit is contained in:
@@ -102,6 +102,12 @@ void ifcopenshell::geometry::CgalShape::Triangulate(const IfcGeom::IteratorSetti
|
||||
|
||||
}
|
||||
|
||||
void ifcopenshell::geometry::CgalShape::Serialize(std::string& r) const {
|
||||
std::stringstream sstream;
|
||||
sstream << shape_;
|
||||
r = sstream.str();
|
||||
}
|
||||
|
||||
#include <CGAL/Polygon_mesh_processing/bbox.h>
|
||||
|
||||
double ifcopenshell::geometry::CgalShape::bounding_box(void *& b) const {
|
||||
|
||||
@@ -96,9 +96,7 @@ namespace ifcopenshell { namespace geometry {
|
||||
|
||||
virtual void Triangulate(const IfcGeom::IteratorSettings& settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int surface_style_id) const;
|
||||
|
||||
virtual void Serialize(std::string&) const {
|
||||
throw std::runtime_error("Not implemented");
|
||||
}
|
||||
virtual void Serialize(std::string&) const;
|
||||
|
||||
virtual IfcGeom::ConversionResultShape* clone() const {
|
||||
return new CgalShape(shape_);
|
||||
|
||||
@@ -217,6 +217,12 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(const IfcGeom::Iterat
|
||||
BRepTools::Clean(shape_);
|
||||
}
|
||||
|
||||
void ifcopenshell::geometry::OpenCascadeShape::Serialize(std::string& r) const {
|
||||
std::stringstream sstream;
|
||||
BRepTools::Write(shape_, sstream);
|
||||
r = sstream.str();
|
||||
}
|
||||
|
||||
int ifcopenshell::geometry::OpenCascadeShape::surface_genus() const {
|
||||
throw std::runtime_error("Not implemented");
|
||||
}
|
||||
|
||||
@@ -49,9 +49,7 @@ namespace ifcopenshell {
|
||||
|
||||
virtual void Triangulate(const IfcGeom::IteratorSettings& settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int surface_style_id) const;
|
||||
|
||||
virtual void Serialize(std::string&) const {
|
||||
throw std::runtime_error("Not implemented");
|
||||
}
|
||||
virtual void Serialize(std::string&) const;
|
||||
|
||||
virtual IfcGeom::ConversionResultShape* clone() const {
|
||||
return new OpenCascadeShape(shape_);
|
||||
|
||||
Reference in New Issue
Block a user