diff --git a/src/bonsaiviewer/modules/models/Commands.cpp b/src/bonsaiviewer/modules/models/Commands.cpp index a6243ac662..243cd6a305 100644 --- a/src/bonsaiviewer/modules/models/Commands.cpp +++ b/src/bonsaiviewer/modules/models/Commands.cpp @@ -685,7 +685,7 @@ void convertIfcToDatabase(SessionState& session, QWidget& host) { throw ifcopenshell::exception("RDB serializer does not support streaming from an input filename"); } - boost::shared_ptr serializer = registry.create("rdb", context); + std::shared_ptr serializer = registry.create("rdb", context); serializer->finalize(); } catch (const std::exception& e) { *error_message = QString::fromUtf8(e.what()); @@ -791,7 +791,7 @@ void exportGeometryDatabase(SessionState& session, QWidget& host) { throw ifcopenshell::exception("RDB serializer does not support streaming from an input filename"); } - boost::shared_ptr serializer = registry.create("rdb", context); + std::shared_ptr serializer = registry.create("rdb", context); serializer->finalize(); serializer.reset(); diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index f2459850fb..dc903d0a6f 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -41,7 +41,7 @@ #include "../ifcparse/utils.h" #include -#include +#include #include #include @@ -616,7 +616,7 @@ int main(int argc, char** argv) { context.schema_name = ifc_file ? ifc_file->schema()->name() : document_serializer_info->schema_name; context.stream = use_input_filename; - boost::shared_ptr serializer = document_serializer_registry.create(output_extension_utf8, context); + std::shared_ptr serializer = document_serializer_registry.create(output_extension_utf8, context); if (serializer->is_streaming() != use_input_filename) { throw ifcopenshell::exception("Selected document serializer streaming mode does not match its registry metadata"); } @@ -750,7 +750,7 @@ int main(int argc, char** argv) { settings }; - boost::shared_ptr serializer; /**< @todo use std::unique_ptr when possible */ + std::shared_ptr serializer; /**< @todo use std::unique_ptr when possible */ try { geometry_serializer_registry.configure(output_extension_utf8, serializer_context); serializer = geometry_serializer_registry.create(output_extension_utf8, serializer_context); @@ -1405,7 +1405,7 @@ void fix_quantities(ifcopenshell::file& f, bool no_progress, bool quiet, bool st express::base quantity; std::vector objects; - boost::shared_ptr previous_geometry_pointer; + std::shared_ptr previous_geometry_pointer; for (;; ++num_created) { bool has_more = true; diff --git a/src/ifcgeom/converter.cpp b/src/ifcgeom/converter.cpp index 7e546c484b..86cc0b6272 100644 --- a/src/ifcgeom/converter.cpp +++ b/src/ifcgeom/converter.cpp @@ -280,7 +280,7 @@ ifcopenshell::geom::brep_element* ifcopenshell::geom::converter::create_brep_for guid, context_string, place, - boost::shared_ptr(shape), + std::shared_ptr(shape), product ); diff --git a/src/ifcgeom/converter.h b/src/ifcgeom/converter.h index 0776723a3c..3c0df1985a 100644 --- a/src/ifcgeom/converter.h +++ b/src/ifcgeom/converter.h @@ -10,12 +10,13 @@ #include "../ifcgeom/element.h" #include +#include namespace ifcopenshell { namespace geom { class IFC_GEOM_API converter { public: - typedef boost::shared_ptr brep_ptr; + typedef std::shared_ptr brep_ptr; private: ifcopenshell::geom::abstract_mapping* mapping_; std::unique_ptr kernel_; diff --git a/src/ifcgeom/element.h b/src/ifcgeom/element.h index a939a0663b..a56ed8ed56 100644 --- a/src/ifcgeom/element.h +++ b/src/ifcgeom/element.h @@ -160,12 +160,12 @@ namespace ifcopenshell::geom { class brep_element : public element { private: - boost::shared_ptr _geometry; + std::shared_ptr _geometry; public: - const boost::shared_ptr& geometry_pointer() const { return _geometry; } + const std::shared_ptr& geometry_pointer() const { return _geometry; } const ifcopenshell::geom::Representation::brep& geometry() const { return *_geometry; } brep_element(int id, int parent_id, const std::string& name, const std::string& type, const std::string& guid, - const std::string& context, const ifcopenshell::geom::taxonomy::matrix4::ptr& trsf, const boost::shared_ptr& geometry, + const std::string& context, const ifcopenshell::geom::taxonomy::matrix4::ptr& trsf, const std::shared_ptr& geometry, const express::entity& product) : element(geometry->settings(), id, parent_id, name, type, guid, context, trsf, product) , _geometry(geometry) @@ -182,15 +182,15 @@ namespace ifcopenshell::geom { class triangulation_element : public element { private: - boost::shared_ptr< ifcopenshell::geom::Representation::triangulation > _geometry; + std::shared_ptr< ifcopenshell::geom::Representation::triangulation > _geometry; public: const ifcopenshell::geom::Representation::triangulation& geometry() const { return *_geometry; } - const boost::shared_ptr< ifcopenshell::geom::Representation::triangulation>& geometry_pointer() const { return _geometry; } + const std::shared_ptr< ifcopenshell::geom::Representation::triangulation>& geometry_pointer() const { return _geometry; } triangulation_element(const ifcopenshell::geom::brep_element& shape_model) : element(shape_model) - , _geometry(boost::shared_ptr(new ifcopenshell::geom::Representation::triangulation(shape_model.geometry()))) + , _geometry(std::make_shared(shape_model.geometry())) {} - triangulation_element(const ifcopenshell::geom::element& source, const boost::shared_ptr& geometry) + triangulation_element(const ifcopenshell::geom::element& source, const std::shared_ptr& geometry) : element(source) , _geometry(geometry) {} @@ -202,12 +202,12 @@ namespace ifcopenshell::geom { class serialized_element : public element { private: - boost::shared_ptr _geometry; + std::shared_ptr _geometry; public: const ifcopenshell::geom::Representation::serialization& geometry() const { return *_geometry; } serialized_element(const brep_element& shape_model) : element(shape_model) - , _geometry(boost::shared_ptr(new ifcopenshell::geom::Representation::serialization(shape_model.geometry()))) + , _geometry(std::make_shared(shape_model.geometry())) {} serialized_element(const serialized_element& other) = default; private: diff --git a/src/ifcgeom/kernels/opencascade/opencascade_kernel.cpp b/src/ifcgeom/kernels/opencascade/opencascade_kernel.cpp index f773bea85d..ecd189b6f9 100644 --- a/src/ifcgeom/kernels/opencascade/opencascade_kernel.cpp +++ b/src/ifcgeom/kernels/opencascade/opencascade_kernel.cpp @@ -551,7 +551,7 @@ bool ifcopenshell::geom::open_cascade_kernel::convert_impl(const taxonomy::revol // guid, // context_string, // trsf, -// boost::shared_ptr(shape), +// std::shared_ptr(shape), // product // ); // diff --git a/src/ifcparse/argument.h b/src/ifcparse/argument.h index 530969c94d..7706b84c14 100644 --- a/src/ifcparse/argument.h +++ b/src/ifcparse/argument.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/src/ifcparse/express.h b/src/ifcparse/express.h index 2e4c0fca78..9052135872 100644 --- a/src/ifcparse/express.h +++ b/src/ifcparse/express.h @@ -26,7 +26,7 @@ #include "utils.h" #include -#include +#include class aggregate_of_instance; diff --git a/src/ifcparse/file.h b/src/ifcparse/file.h index 837400da58..03d85c7243 100644 --- a/src/ifcparse/file.h +++ b/src/ifcparse/file.h @@ -390,7 +390,7 @@ public: /// /// Attention when running remove_entity inside a loop over a list of entities to be removed. /// This invalidates the iterator. A workaround is to reverse the loop: - /// boost::shared_ptr entities = ...; + /// std::shared_ptr entities = ...; /// for (auto it = entities->end() - 1; it >= entities->begin(); --it) { /// ifcopenshell::IfcBaseClass *const inst = *it; /// model->remove_entity(inst); diff --git a/src/ifcparse/instance_data.h b/src/ifcparse/instance_data.h index 7792a9eb02..96737cdeac 100644 --- a/src/ifcparse/instance_data.h +++ b/src/ifcparse/instance_data.h @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include diff --git a/src/ifcparse/parse.cpp b/src/ifcparse/parse.cpp index a253ce0483..efd5db6f9b 100644 --- a/src/ifcparse/parse.cpp +++ b/src/ifcparse/parse.cpp @@ -2750,7 +2750,7 @@ void file::remove_entity(const express::base& entity) { // Attention when running remove_entity inside a loop over a list of entities to be removed. // This invalidates the iterator. A workaround is to reverse the loop: - // boost::shared_ptr entities = ...; + // std::shared_ptr entities = ...; // for (auto it = entities->end() - 1; it >= entities->begin(); --it) { // express::base *const inst = *it; // model->remove_entity(inst); diff --git a/src/ifcparse/parse.h b/src/ifcparse/parse.h index 50736b302a..1289f98a39 100644 --- a/src/ifcparse/parse.h +++ b/src/ifcparse/parse.h @@ -36,7 +36,7 @@ #include "storage.h" #include -#include +#include #include #include #include diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 95e5a8785a..604cae153f 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -442,7 +442,7 @@ public: } private: - boost::shared_ptr serializer_; + std::shared_ptr serializer_; }; %} diff --git a/src/serializers/document_rdb_plugin.cpp b/src/serializers/document_rdb_plugin.cpp index f99a659403..25e05db9ff 100644 --- a/src/serializers/document_rdb_plugin.cpp +++ b/src/serializers/document_rdb_plugin.cpp @@ -23,15 +23,15 @@ #ifdef IFOPSH_WITH_ROCKSDB #include -#include +#include namespace { -boost::shared_ptr create_serializer(const ifcopenshell::serializers::document_serializer_context& context) { +std::shared_ptr create_serializer(const ifcopenshell::serializers::document_serializer_context& context) { if (context.input_filename.empty()) { throw ifcopenshell::exception("RocksDB document serializer requires an input filename"); } - return boost::make_shared(context.input_filename, context.output_filename, context.skip_supertypes); + return std::make_shared(context.input_filename, context.output_filename, context.skip_supertypes); } } diff --git a/src/serializers/document_serializer_plugin.cpp b/src/serializers/document_serializer_plugin.cpp index b19b4bc19a..1db0871179 100644 --- a/src/serializers/document_serializer_plugin.cpp +++ b/src/serializers/document_serializer_plugin.cpp @@ -125,7 +125,7 @@ const ifcopenshell::serializers::document_serializer_info* ifcopenshell::seriali return entry ? &entry->info_ : nullptr; } -boost::shared_ptr ifcopenshell::serializers::document_serializer_registry::create(const std::string& format, const document_serializer_context& context) const { +std::shared_ptr ifcopenshell::serializers::document_serializer_registry::create(const std::string& format, const document_serializer_context& context) const { const auto schema_name = !context.schema_name.empty() ? context.schema_name : (context.file ? context.file->schema()->name() : std::string()); auto* registry = const_cast(this); diff --git a/src/serializers/document_serializer_plugin.h b/src/serializers/document_serializer_plugin.h index 9db27f2f1d..b79c4c1f9c 100644 --- a/src/serializers/document_serializer_plugin.h +++ b/src/serializers/document_serializer_plugin.h @@ -26,7 +26,7 @@ #include "../plugin/plugin.h" #include -#include +#include #include #include @@ -64,11 +64,11 @@ struct SERIALIZERS_API document_serializer_context { class SERIALIZERS_API document_serializer_registry { public: - typedef boost::function(const document_serializer_context&)> create_fn; + typedef boost::function(const document_serializer_context&)> create_fn; void bind(const document_serializer_info& info, create_fn create, const ifcopenshell::plugin::module& module = ifcopenshell::plugin::module()); const document_serializer_info* find(const std::string& format, const std::string& schema_name = std::string()) const; - boost::shared_ptr create(const std::string& format, const document_serializer_context& context) const; + std::shared_ptr create(const std::string& format, const document_serializer_context& context) const; std::vector serializers() const; private: diff --git a/src/serializers/geometry_dae_plugin.cpp b/src/serializers/geometry_dae_plugin.cpp index 1c430d71c2..ea5dfb7dec 100644 --- a/src/serializers/geometry_dae_plugin.cpp +++ b/src/serializers/geometry_dae_plugin.cpp @@ -23,7 +23,7 @@ #include "geometry_serializer_plugin.h" #include -#include +#include namespace ifcopenshell { namespace serializers { @@ -37,8 +37,8 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("dae"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { - return boost::make_shared(context.output_temp_filename, context.settings); +std::shared_ptr create_serializer(const geometry_serializer_context& context) { + return std::make_shared(context.output_temp_filename, context.settings); } void register_plugin(geometry_serializer_registry& registry, const plugin::module& module) { diff --git a/src/serializers/geometry_glb_plugin.cpp b/src/serializers/geometry_glb_plugin.cpp index c877ac3b80..f5b1d7fc3f 100644 --- a/src/serializers/geometry_glb_plugin.cpp +++ b/src/serializers/geometry_glb_plugin.cpp @@ -23,7 +23,7 @@ #include "gltf_serializer.h" #include -#include +#include namespace ifcopenshell { namespace serializers { @@ -37,8 +37,8 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("glb"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { - return boost::make_shared(context.output_temp_filename, context.settings); +std::shared_ptr create_serializer(const geometry_serializer_context& context) { + return std::make_shared(context.output_temp_filename, context.settings); } void register_plugin(geometry_serializer_registry& registry, const plugin::module& module) { diff --git a/src/serializers/geometry_igs_plugin.cpp b/src/serializers/geometry_igs_plugin.cpp index 9fec3c5a53..abaa82689f 100644 --- a/src/serializers/geometry_igs_plugin.cpp +++ b/src/serializers/geometry_igs_plugin.cpp @@ -23,7 +23,7 @@ #include "iges_serializer.h" #include -#include +#include #include @@ -43,11 +43,11 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("igs"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { +std::shared_ptr create_serializer(const geometry_serializer_context& context) { #if OCC_VERSION_HEX < 0x60900 IGESControl_Controller::Init(); #endif - return boost::make_shared(context.output_temp_filename, context.settings); + return std::make_shared(context.output_temp_filename, context.settings); } void configure_serializer(geometry_serializer_context& context) { diff --git a/src/serializers/geometry_obj_plugin.cpp b/src/serializers/geometry_obj_plugin.cpp index 74d43e4138..82ffc63b4b 100644 --- a/src/serializers/geometry_obj_plugin.cpp +++ b/src/serializers/geometry_obj_plugin.cpp @@ -23,7 +23,7 @@ #include "../ifcparse/utils.h" #include -#include +#include #include @@ -49,7 +49,7 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("obj"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { +std::shared_ptr create_serializer(const geometry_serializer_context& context) { if (context.output_temp_stream || context.output_stream) { stream_or_filename obj_filename = context.output_temp_stream ? *context.output_temp_stream @@ -57,10 +57,10 @@ boost::shared_ptr create_serializer(const geometry_serializ stream_or_filename mtl_filename = context.output_stream ? *context.output_stream : stream_or_filename(obj_mtl_filename(context.output_filename)); - return boost::make_shared( + return std::make_shared( obj_filename, mtl_filename, context.settings); } - return boost::make_shared(context.output_temp_filename, obj_mtl_filename(context.output_filename), context.settings); + return std::make_shared(context.output_temp_filename, obj_mtl_filename(context.output_filename), context.settings); } void configure_serializer(geometry_serializer_context& context) { diff --git a/src/serializers/geometry_serializer_plugin.cpp b/src/serializers/geometry_serializer_plugin.cpp index 4e118482d0..bbacca56ac 100644 --- a/src/serializers/geometry_serializer_plugin.cpp +++ b/src/serializers/geometry_serializer_plugin.cpp @@ -130,7 +130,7 @@ void ifcopenshell::serializers::geometry_serializer_registry::configure(const st } } -boost::shared_ptr ifcopenshell::serializers::geometry_serializer_registry::create(const std::string& extension, const geometry_serializer_context& context) const { +std::shared_ptr ifcopenshell::serializers::geometry_serializer_registry::create(const std::string& extension, const geometry_serializer_context& context) const { const auto key = geometry_serializer_key(extension); if (entries_.find(key) == entries_.end()) { load_geometry_serializer_plugin(const_cast(*this), extension); diff --git a/src/serializers/geometry_serializer_plugin.h b/src/serializers/geometry_serializer_plugin.h index 5f424cb032..938b504074 100644 --- a/src/serializers/geometry_serializer_plugin.h +++ b/src/serializers/geometry_serializer_plugin.h @@ -25,7 +25,7 @@ #include "../plugin/plugin.h" #include -#include +#include #include #include @@ -61,14 +61,14 @@ struct SERIALIZERS_API geometry_serializer_context { class SERIALIZERS_API geometry_serializer_registry { public: - typedef boost::function(const geometry_serializer_context&)> create_fn; + typedef boost::function(const geometry_serializer_context&)> create_fn; typedef boost::function configure_fn; void bind(const geometry_serializer_info& info, create_fn create, configure_fn configure = configure_fn(), const ifcopenshell::plugin::module& module = ifcopenshell::plugin::module()); bool has(const std::string& extension) const; const geometry_serializer_info* find(const std::string& extension) const; void configure(const std::string& extension, geometry_serializer_context& context) const; - boost::shared_ptr create(const std::string& extension, const geometry_serializer_context& context) const; + std::shared_ptr create(const std::string& extension, const geometry_serializer_context& context) const; std::vector serializers() const; private: diff --git a/src/serializers/geometry_stp_plugin.cpp b/src/serializers/geometry_stp_plugin.cpp index 95176eb992..755471b213 100644 --- a/src/serializers/geometry_stp_plugin.cpp +++ b/src/serializers/geometry_stp_plugin.cpp @@ -23,7 +23,7 @@ #include "step_serializer.h" #include -#include +#include namespace ifcopenshell { namespace serializers { @@ -37,8 +37,8 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("stp"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { - return boost::make_shared(context.output_temp_filename, context.settings); +std::shared_ptr create_serializer(const geometry_serializer_context& context) { + return std::make_shared(context.output_temp_filename, context.settings); } void configure_serializer(geometry_serializer_context& context) { diff --git a/src/serializers/geometry_svg_plugin.cpp b/src/serializers/geometry_svg_plugin.cpp index 502ecaa747..469e5f871d 100644 --- a/src/serializers/geometry_svg_plugin.cpp +++ b/src/serializers/geometry_svg_plugin.cpp @@ -23,7 +23,7 @@ #include "svg_serializer.h" #include -#include +#include namespace ifcopenshell { namespace serializers { @@ -37,12 +37,12 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("svg"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { +std::shared_ptr create_serializer(const geometry_serializer_context& context) { if (context.output_temp_stream) { - return boost::make_shared( + return std::make_shared( *context.output_temp_stream, context.settings); } - return boost::make_shared(context.output_temp_filename, context.settings); + return std::make_shared(context.output_temp_filename, context.settings); } void configure_serializer(geometry_serializer_context& context) { diff --git a/src/serializers/geometry_ttl_plugin.cpp b/src/serializers/geometry_ttl_plugin.cpp index b40fa3906d..26c976de6a 100644 --- a/src/serializers/geometry_ttl_plugin.cpp +++ b/src/serializers/geometry_ttl_plugin.cpp @@ -21,7 +21,7 @@ #include "ttl_wkt_serializer.h" #include -#include +#include namespace ifcopenshell { namespace serializers { @@ -35,12 +35,12 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("ttl"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { +std::shared_ptr create_serializer(const geometry_serializer_context& context) { if (context.output_temp_stream) { - return boost::make_shared( + return std::make_shared( *context.output_temp_stream, context.settings); } - return boost::make_shared(context.output_temp_filename, context.settings); + return std::make_shared(context.output_temp_filename, context.settings); } void configure_serializer(geometry_serializer_context& context) { diff --git a/src/serializers/geometry_usd_plugin.cpp b/src/serializers/geometry_usd_plugin.cpp index 2522476714..8b6b88b2ac 100644 --- a/src/serializers/geometry_usd_plugin.cpp +++ b/src/serializers/geometry_usd_plugin.cpp @@ -23,7 +23,7 @@ #include "usd_serializer.h" #include -#include +#include namespace ifcopenshell { namespace serializers { @@ -37,8 +37,8 @@ plugin::metadata plugin_metadata() { return geometry_serializer_plugin_metadata("usd"); } -boost::shared_ptr create_serializer(const geometry_serializer_context& context) { - return boost::make_shared(context.output_filename, context.settings); +std::shared_ptr create_serializer(const geometry_serializer_context& context) { + return std::make_shared(context.output_filename, context.settings); } void register_plugin(geometry_serializer_registry& registry, const plugin::module& module) { diff --git a/src/serializers/json_serializer.h b/src/serializers/json_serializer.h index 5aa1c45520..57c3aceb9a 100644 --- a/src/serializers/json_serializer.h +++ b/src/serializers/json_serializer.h @@ -9,7 +9,7 @@ #include "../serializers/serializers_api.h" #include "../serializers/document_serializer_plugin.h" -#include +#include class json_serializer : public ifcopenshell::geom::serializer { public: @@ -17,7 +17,7 @@ class json_serializer : public ifcopenshell::geom::serializer { JSON_DIALECT_CREOOX }; private: - boost::shared_ptr implementation_; + std::shared_ptr implementation_; protected: std::string json_filename; diff --git a/src/serializers/schema_dependent/json_plugin.cpp b/src/serializers/schema_dependent/json_plugin.cpp index e3eebb30a5..7016593163 100644 --- a/src/serializers/schema_dependent/json_plugin.cpp +++ b/src/serializers/schema_dependent/json_plugin.cpp @@ -25,12 +25,12 @@ #include "../../ifcparse/macros.h" #include -#include +#include namespace { -boost::shared_ptr create_serializer(const ifcopenshell::serializers::document_serializer_context& context) { - return boost::make_shared( +std::shared_ptr create_serializer(const ifcopenshell::serializers::document_serializer_context& context) { + return std::make_shared( context.file, context.output_filename, static_cast(context.dialect)); diff --git a/src/serializers/schema_dependent/xml_plugin.cpp b/src/serializers/schema_dependent/xml_plugin.cpp index 07d109e512..957b3b388b 100644 --- a/src/serializers/schema_dependent/xml_plugin.cpp +++ b/src/serializers/schema_dependent/xml_plugin.cpp @@ -23,12 +23,12 @@ #include "../../ifcparse/macros.h" #include -#include +#include namespace { -boost::shared_ptr create_serializer(const ifcopenshell::serializers::document_serializer_context& context) { - return boost::make_shared(context.file, context.output_filename); +std::shared_ptr create_serializer(const ifcopenshell::serializers::document_serializer_context& context) { + return std::make_shared(context.file, context.output_filename); } } diff --git a/src/serializers/svg_serializer.h b/src/serializers/svg_serializer.h index bbb82d2f0a..7b2424eb3f 100644 --- a/src/serializers/svg_serializer.h +++ b/src/serializers/svg_serializer.h @@ -557,7 +557,7 @@ typedef prefiltered_hlr hlr_engine; class SERIALIZERS_API svg_serializer : public ifcopenshell::geom::write_only_geometry_serializer { public: typedef std::pair > path_object; - typedef std::vector< boost::shared_ptr > float_item_list; + typedef std::vector< std::shared_ptr > float_item_list; enum storey_height_display_types { SH_NONE, SH_FULL, SH_LEFT }; @@ -668,9 +668,9 @@ public: { apply_settings(); } - void addXCoordinate(const boost::shared_ptr& fi) { xcoords.push_back(fi); } - void addYCoordinate(const boost::shared_ptr& fi) { ycoords.push_back(fi); } - void addSizeComponent(const boost::shared_ptr& fi) { radii.push_back(fi); } + void addXCoordinate(const std::shared_ptr& fi) { xcoords.push_back(fi); } + void addYCoordinate(const std::shared_ptr& fi) { ycoords.push_back(fi); } + void addSizeComponent(const std::shared_ptr& fi) { radii.push_back(fi); } void growBoundingBox(double x, double y) { if (x < xmin) xmin = x; if (x > xmax) xmax = x; if (y < ymin) ymin = y; if (y > ymax) ymax = y; } void writeHeader(); void doWriteHeader(); diff --git a/src/serializers/util.cpp b/src/serializers/util.cpp index e04e214ec2..cbc01dd7cc 100644 --- a/src/serializers/util.cpp +++ b/src/serializers/util.cpp @@ -24,19 +24,19 @@ using namespace util; -boost::shared_ptr string_buffer::add(const std::string& s) { - boost::shared_ptr i = boost::shared_ptr(new string_item(s)); +std::shared_ptr string_buffer::add(const std::string& s) { + auto i = std::make_shared(s); items.push_back(i); return i; } -boost::shared_ptr string_buffer::add(const double& d) { - boost::shared_ptr i = boost::shared_ptr(new float_item(d)); +std::shared_ptr string_buffer::add(const double& d) { + auto i = std::make_shared(d); items.push_back(i); return i; } std::string string_buffer::str() const { std::stringstream ss; - for (std::vector< boost::shared_ptr >::const_iterator it = items.begin(); it != items.end(); ++it) { + for (std::vector< std::shared_ptr >::const_iterator it = items.begin(); it != items.end(); ++it) { ss << (**it).str(); } return ss.str(); diff --git a/src/serializers/util.h b/src/serializers/util.h index 24ffd9485b..37384e3922 100644 --- a/src/serializers/util.h +++ b/src/serializers/util.h @@ -25,7 +25,7 @@ #include #include -#include +#include namespace util { class string_buffer { @@ -56,12 +56,12 @@ namespace util { virtual ~float_item() {}; }; private: - std::vector< boost::shared_ptr > items; + std::vector< std::shared_ptr > items; void clear(); - void assign(const std::vector< boost::shared_ptr >& other); + void assign(const std::vector< std::shared_ptr >& other); public: - boost::shared_ptr add(const std::string& s); - boost::shared_ptr add(const double& d); + std::shared_ptr add(const std::string& s); + std::shared_ptr add(const double& d); bool empty() const { return items.empty(); } std::string str() const; }; diff --git a/src/serializers/xml_serializer.h b/src/serializers/xml_serializer.h index 359d69d2f5..bee5338e9d 100644 --- a/src/serializers/xml_serializer.h +++ b/src/serializers/xml_serializer.h @@ -9,11 +9,11 @@ #include "../plugin/plugin.h" #include "../serializers/document_serializer_plugin.h" -#include +#include class xml_serializer : public ifcopenshell::geom::serializer { private: - boost::shared_ptr implementation_; + std::shared_ptr implementation_; protected: std::string xml_filename; diff --git a/src/svgfill/src/arrange_polygons.cpp b/src/svgfill/src/arrange_polygons.cpp index 8eb0461841..ce205f6eb4 100644 --- a/src/svgfill/src/arrange_polygons.cpp +++ b/src/svgfill/src/arrange_polygons.cpp @@ -31,10 +31,8 @@ #if CGAL_VERSION_NR >= 1060000000 #define variant_get std::get_if -#define my_shared_ptr std::shared_ptr #else #define variant_get boost::get -#define my_shared_ptr boost::shared_ptr #endif typedef CGAL::Exact_predicates_exact_constructions_kernel K; @@ -102,25 +100,31 @@ std::vector create_and_convert_offset_polygon(double offset_distance, remove_close_points(polygon); - // Create the offset polygons using Epick kernel - // create_exterior_skeleton_and_offset_polygons_2() - std::vector>> offset_polygons; + // Copy each generated offset polygon out of CGAL's version-dependent + // pointer type, then convert it back to the Epeck kernel. + std::vector exact_offset_polygons; + const auto append_polygons = [&exact_offset_polygons](const auto& offset_polygons, bool exterior) { + auto begin = offset_polygons.begin(); + if (exterior) { + // The first polygon is the outer frame. + ++begin; + } + for (auto it = begin; it != offset_polygons.end(); ++it) { + auto inexact_poly = **it; + if (exterior && it == begin) { + inexact_poly.reverse_orientation(); + } + remove_close_points(inexact_poly); + exact_offset_polygons.push_back(convert_polygon(inexact_poly)); + } + }; if (offset_distance >= 0.) { - offset_polygons = CGAL::create_exterior_skeleton_and_offset_polygons_2(offset_distance, polygon); - // erase the first outer frame - offset_polygons.erase(offset_polygons.begin()); - offset_polygons.front()->reverse_orientation(); + const auto offset_polygons = CGAL::create_exterior_skeleton_and_offset_polygons_2(offset_distance, polygon); + append_polygons(offset_polygons, true); } else { - offset_polygons = CGAL::create_interior_skeleton_and_offset_polygons_2(-offset_distance, polygon); - } - - // Convert each offset polygon back to the Epeck kernel - std::vector exact_offset_polygons; - for (auto& inexact_poly_ptr : offset_polygons) { - remove_close_points(*inexact_poly_ptr); - Polygon_2 exact_poly = convert_polygon(*inexact_poly_ptr); - exact_offset_polygons.push_back(exact_poly); + const auto offset_polygons = CGAL::create_interior_skeleton_and_offset_polygons_2(-offset_distance, polygon); + append_polygons(offset_polygons, false); } return exact_offset_polygons;