diff --git a/src/ifcparse/alignment_helper.h b/src/ifcparse/alignment_helper.h index 2fd1fc8d8f..8fffee9ef8 100644 --- a/src/ifcparse/alignment_helper.h +++ b/src/ifcparse/alignment_helper.h @@ -41,19 +41,19 @@ // // creates a horizontal alignment from a list of PI points and curve radii. if include_geometry is true, the geometric representations are created, otherwise only business logic is created -IFC_PARSE_API Ifc4x3_add2::IfcAlignment addHorizontalAlignment(hierarchy_helper& file, const std::string& alignment_name, const std::vector>& points, const std::vector& radii,bool include_geometry = true); +IFC_PARSE_API Ifc4x3_add2::IfcAlignment addHorizontalAlignment(hierarchy_helper& model, const std::string& alignment_name, const std::vector>& points, const std::vector& radii, bool include_geometry = true); // creates a horizontal and vertical alignment from a list of PI points, curve radii, and VPI points and vertical curve lengths. if include_geometry is true, the geometric representations are created, otherwise only business logic is created -IFC_PARSE_API Ifc4x3_add2::IfcAlignment addAlignment(hierarchy_helper& file, const std::string& alignment_name, const std::vector>& points, const std::vector& radii, const std::vector>& vpoints, const std::vector& vclength, bool include_geometry = true); +IFC_PARSE_API Ifc4x3_add2::IfcAlignment addAlignment(hierarchy_helper& model, const std::string& alignment_name, const std::vector>& points, const std::vector& radii, const std::vector>& vertical_points, const std::vector& vertical_curve_lengths, bool include_geometry = true); // Maps horizontal alignment business logic to geometry. // Bloss curves have two geometry elements for one horizontal alignment segment. That is the reason for returning a pair. // Typically the first element of the pair will have the geometry and the second element will be nullptr -IFC_PARSE_API std::pair mapAlignmentSegment(hierarchy_helper& file, const Ifc4x3_add2::IfcAlignmentSegment& segment); -IFC_PARSE_API std::pair mapAlignmentHorizontalSegment(hierarchy_helper& file, const Ifc4x3_add2::IfcAlignmentHorizontalSegment& segment); -IFC_PARSE_API std::pair mapAlignmentVerticalSegment(hierarchy_helper& file, const Ifc4x3_add2::IfcAlignmentVerticalSegment& segment); -IFC_PARSE_API std::pair mapAlignmentCantSegment(hierarchy_helper& file, const Ifc4x3_add2::IfcAlignmentCantSegment& segment); +IFC_PARSE_API std::pair mapAlignmentSegment(hierarchy_helper& model, const Ifc4x3_add2::IfcAlignmentSegment& segment); +IFC_PARSE_API std::pair mapAlignmentHorizontalSegment(hierarchy_helper& model, const Ifc4x3_add2::IfcAlignmentHorizontalSegment& segment); +IFC_PARSE_API std::pair mapAlignmentVerticalSegment(hierarchy_helper& model, const Ifc4x3_add2::IfcAlignmentVerticalSegment& segment); +IFC_PARSE_API std::pair mapAlignmentCantSegment(hierarchy_helper& model, const Ifc4x3_add2::IfcAlignmentCantSegment& segment); #endif -#endif \ No newline at end of file +#endif diff --git a/src/ifcparse/argument.h b/src/ifcparse/argument.h index b919436403..530969c94d 100644 --- a/src/ifcparse/argument.h +++ b/src/ifcparse/argument.h @@ -31,10 +31,10 @@ namespace ifcopenshell { -IFC_PARSE_API const char* argument_type_to_string(argument_type argument_type); +IFC_PARSE_API const char* argument_type_to_string(argument_type type); /// Returns false when the string `s` contains character outside of {'0', '1'} -IFC_PARSE_API bool valid_binary_string(const std::string& string); +IFC_PARSE_API bool valid_binary_string(const std::string& binary_string); } // namespace ifcopenshell diff --git a/src/ifcparse/argument_type.h b/src/ifcparse/argument_type.h index 1db6993585..064d49e8e1 100644 --- a/src/ifcparse/argument_type.h +++ b/src/ifcparse/argument_type.h @@ -52,8 +52,8 @@ enum argument_type { Argument_UNKNOWN }; -IFC_PARSE_API argument_type from_parameter_type(const ifcopenshell::parameter_type*); -IFC_PARSE_API argument_type make_aggregate(argument_type elem_type); +IFC_PARSE_API argument_type from_parameter_type(const ifcopenshell::parameter_type* parameter_type); +IFC_PARSE_API argument_type make_aggregate(argument_type element_type); } // namespace ifcopenshell #endif diff --git a/src/ifcparse/character_decoder.h b/src/ifcparse/character_decoder.h index 2a24fd8b13..f49a1bc40a 100644 --- a/src/ifcparse/character_decoder.h +++ b/src/ifcparse/character_decoder.h @@ -62,7 +62,7 @@ class IFC_PARSE_API character_decoder { operator std::string(); // Gets a decoded string representation at the offset provided, // does not mutate the underlying token stream read pointer. - std::string get(size_t&); + std::string get(size_t& offset); }; } // namespace ifcopenshell diff --git a/src/ifcparse/exception.h b/src/ifcparse/exception.h index 55304461dc..2b9f56eb10 100644 --- a/src/ifcparse/exception.h +++ b/src/ifcparse/exception.h @@ -49,8 +49,8 @@ class IFC_PARSE_API exception : public std::exception { class IFC_PARSE_API attribute_out_of_range_exception : public exception { public: - attribute_out_of_range_exception(const std::string& exception) - : exception(exception) {} + attribute_out_of_range_exception(const std::string& message) + : exception(message) {} ~attribute_out_of_range_exception() override; }; diff --git a/src/ifcparse/express.h b/src/ifcparse/express.h index 2eef8d8270..a42ae158ba 100644 --- a/src/ifcparse/express.h +++ b/src/ifcparse/express.h @@ -81,26 +81,26 @@ class IFC_PARSE_API Base { typename std::enable_if< (!std::is_base_of_v || std::is_same_v), void>::type - set_attribute_value(size_t i, const T& t); + set_attribute_value(size_t attribute_index, const T& value); template typename std::enable_if< (!std::is_base_of_v || std::is_same_v), void>::type - set_attribute_value(const std::string& name, const T& t); + set_attribute_value(const std::string& attribute_name, const T& value); - void set_attribute_value(size_t i, const express::Base& p); - void set_attribute_value(const std::string& name, const express::Base& p); + void set_attribute_value(size_t attribute_index, const express::Base& value); + void set_attribute_value(const std::string& attribute_name, const express::Base& value); - void unset_attribute_value(size_t i); + void unset_attribute_value(size_t attribute_index); - attribute_value get_attribute_value(size_t index) const; + attribute_value get_attribute_value(size_t attribute_index) const; uint32_t identity() const; uint32_t id() const; - void to_string(std::ostream&, bool upper = false) const; + void to_string(std::ostream& stream, bool uppercase = false) const; template T as() const { @@ -135,15 +135,15 @@ class IFC_PARSE_API Entity : public Base { Entity() {} Entity(const std::weak_ptr& data) : Base(data) {} - attribute_value get(const std::string& name) const; + attribute_value get(const std::string& attribute_name) const; template - T get_value(const std::string& name) const; + T get_value(const std::string& attribute_name) const; template - T get_value(const std::string& name, const T& default_value) const; + T get_value(const std::string& attribute_name, const T& default_value) const; - std::vector get_inverse(const std::string& name) const; + std::vector get_inverse(const std::string& attribute_name) const; }; class IFC_PARSE_API Select : public Base { @@ -173,15 +173,15 @@ namespace std { template <> struct hash { - std::size_t operator()(const express::Base& c) const noexcept { - return std::hash{}(c.identity()); + std::size_t operator()(const express::Base& value) const noexcept { + return std::hash{}(value.identity()); } }; template <> struct hash { - std::size_t operator()(const express::Entity& c) const noexcept { - return std::hash{}(c.identity()); + std::size_t operator()(const express::Entity& value) const noexcept { + return std::hash{}(value.identity()); } }; @@ -191,15 +191,15 @@ namespace boost { template <> struct hash { - std::size_t operator()(const express::Base& c) const noexcept { - return std::hash{}(c.identity()); + std::size_t operator()(const express::Base& value) const noexcept { + return std::hash{}(value.identity()); } }; template <> struct hash { - std::size_t operator()(const express::Entity& c) const noexcept { - return std::hash{}(c.identity()); + std::size_t operator()(const express::Entity& value) const noexcept { + return std::hash{}(value.identity()); } }; @@ -230,27 +230,27 @@ typename std::conditional_t< is_std_vector::value, std::vector>, std::vector> -cast_vector(const std::vector& vs) { +cast_vector(const std::vector& values) { if constexpr (is_std_vector::value) { using V = typename U::value_type; std::vector> result; - result.reserve(vs.size()); - for (const auto& v : vs) { - result.push_back(cast_vector(v)); + result.reserve(values.size()); + for (const auto& value : values) { + result.push_back(cast_vector(value)); } return result; } else { std::vector result; - for (const auto& v : vs) { + for (const auto& value : values) { if constexpr (std::is_base_of_v) { // For a base or identity transform we can just rely on static cast - result.push_back(v); + result.push_back(value); } else if constexpr (std::is_base_of_v && std::is_same_v) { // From a select to concrete we simply call the appropriate method - result.push_back(v.concrete()); + result.push_back(value.concrete()); } else { - if (auto u = v.template as()) { - result.push_back(u); + if (auto cast_value = value.template as()) { + result.push_back(cast_value); } } } diff --git a/src/ifcparse/file.h b/src/ifcparse/file.h index 4e01a58ebf..f0f74583ad 100644 --- a/src/ifcparse/file.h +++ b/src/ifcparse/file.h @@ -86,7 +86,7 @@ enum filetype { FT_AUTODETECT }; -IFC_PARSE_API filetype guess_file_type(const std::string& fn); +IFC_PARSE_API filetype guess_file_type(const std::string& path); template > class IFC_PARSE_API instance_streamer { @@ -151,19 +151,19 @@ private: size_t semicolon_count() const; - void push_page(const std::string& page); + void push_page(const std::string& page_data); - instance_streamer(ifcopenshell::file* f = nullptr); + instance_streamer(ifcopenshell::file* owner_file = nullptr); - instance_streamer(const std::string& fn, bool mmap = false, ifcopenshell::file* f = nullptr); + instance_streamer(const std::string& path, bool use_mmap = false, ifcopenshell::file* owner_file = nullptr); - instance_streamer(void* data, int length, ifcopenshell::file* f = nullptr); + instance_streamer(void* data, int data_size, ifcopenshell::file* owner_file = nullptr); - instance_streamer(Reader* stream, ifcopenshell::file* f = nullptr); + instance_streamer(Reader* stream, ifcopenshell::file* owner_file = nullptr); void bypass_types(const std::set& type_names); - void yield_header_instances(bool value) { yield_header_instances_ = value; } + void yield_header_instances(bool enabled) { yield_header_instances_ = enabled; } const ifcopenshell::schema_definition* schema() const { return schema_; } @@ -237,7 +237,7 @@ public: /// /// UTF-8 file path to an IFC-SPF file /// Whether to use memory-mapped I/O - file(const std::string& path, bool mmap); + file(const std::string& path, bool use_mmap); #endif /// /// Constructs an file object from a file path, supports IFC-SPF and the IfcOpenShell-specific RocksDB format. @@ -245,17 +245,17 @@ public: /// UTF-8 file path to an IFC-SPF file or RocksDB database directory /// File type of the path /// Whether to open in read-only mode, only supported on RocksDB databases - file(const std::string& path, filetype ty=FT_AUTODETECT, bool readonly=false); + file(const std::string& path, filetype type = FT_AUTODETECT, bool read_only = false); /// /// Constructs an file object from a stream containing IFC-SPF data. /// - file(std::istream& stream, int length); + file(std::istream& stream, int data_size); /// /// Constructs an file object from a memory buffer containing IFC-SPF data. /// - file(void* data, int length); + file(void* data, int data_size); /// /// Constructs an file object with the specified schema, file type, and file path. @@ -264,16 +264,16 @@ public: /// Pointer to the schema definition to use. Defaults to the IFC4 schema if not specified. /// The file type to use for the file. Defaults to FT_AUTODETECT. /// The file system path to the IFC file. Defaults to an empty string. - file(const ifcopenshell::schema_definition* schema = ifcopenshell::schema_by_name("IFC4"), filetype ty = FT_AUTODETECT, const std::string& path = ""); + file(const ifcopenshell::schema_definition* schema = ifcopenshell::schema_by_name("IFC4"), filetype type = FT_AUTODETECT, const std::string& path = ""); /// /// Constructs an unitialized file object. Call initialize() later on. Allows to specify which types to bypass during load. /// - file(const uninitialized_tag&); + file(const uninitialized_tag& tag); - bool initialize(const std::string& path, filetype ty = FT_AUTODETECT, bool readonly = false); + bool initialize(const std::string& path, filetype type = FT_AUTODETECT, bool read_only = false); #ifdef USE_MMAP - bool initialize(const std::string& path, bool mmap); + bool initialize(const std::string& path, bool use_mmap); #endif /// @brief Bypass loading of all instances of the specified type name. Only applies to parsed IFC-SPF files. @@ -325,36 +325,36 @@ public: /// Returns all entities in the file that match the positional argument. /// NOTE: This also returns subtypes of the requested type, for example: /// IfcWall will also return IfcWallStandardCase entities - std::vector instances_by_type(const ifcopenshell::declaration*); + std::vector instances_by_type(const ifcopenshell::declaration* declaration); /// Returns all entities in the file that match the positional argument. - std::vector instances_by_type_excl_subtypes(const ifcopenshell::declaration*); + std::vector instances_by_type_excl_subtypes(const ifcopenshell::declaration* declaration); /// Returns all entities in the file that match the positional argument. /// NOTE: This also returns subtypes of the requested type, for example: /// IfcWall will also return IfcWallStandardCase entities - std::vector instances_by_type(const std::string& type); + std::vector instances_by_type(const std::string& type_name); /// Returns all entities in the file that match the positional argument. - std::vector instances_by_type_excl_subtypes(const std::string& type); + std::vector instances_by_type_excl_subtypes(const std::string& type_name); /// Returns all entities in the file that reference the id - std::vector instances_by_reference(int id); + std::vector instances_by_reference(int reference_id); /// Returns the entity with the specified id - express::Base instance_by_id(int id); + express::Base instance_by_id(int instance_id); /// Returns the entity with the specified GlobalId - express::Base instance_by_guid(const std::string& guid); + express::Base instance_by_guid(const std::string& global_id); /// Performs a depth-first traversal, returning all entity instance /// attributes as a flat list. NB: includes the root instance specified /// in the first function argument. - static std::vector traverse(const express::Base& instance, int max_level = -1); + static std::vector traverse(const express::Base& instance, int max_depth = -1); /// Same as traverse() but maintains topological order by using a /// breadth-first search - static std::vector traverse_breadth_first(const express::Base& instance, int max_level = -1); + static std::vector traverse_breadth_first(const express::Base& instance, int max_depth = -1); /// Get the attribute indices corresponding to the list of entity instances /// returned by get_inverse(). @@ -365,7 +365,7 @@ public: return get_inverse(instance_id, &T::Class(), attribute_index)->template as(); } - std::vector get_inverse(int instance_id, const ifcopenshell::declaration* type, int attribute_index); + std::vector get_inverse(int instance_id, const ifcopenshell::declaration* declaration, int attribute_index); size_t get_total_inverses(int instance_id); @@ -377,7 +377,7 @@ public: void recalculate_id_counter(); - express::Base add_entity(const express::Base& entity, int id = -1); + express::Base add_entity(const express::Base& entity, int instance_id = -1); /// Removes entity instance from file and unsets references. /// @@ -401,16 +401,16 @@ public: void build_inverses(); - void register_inverse(unsigned, const ifcopenshell::entity* from_entity, int inst_id, int attribute_index); - void unregister_inverse(unsigned, const ifcopenshell::entity* from_entity, const express::Base&, int attribute_index); + void register_inverse(unsigned referenced_id, const ifcopenshell::entity* from_entity, int instance_id, int attribute_index); + void unregister_inverse(unsigned referenced_id, const ifcopenshell::entity* from_entity, const express::Base& entity, int attribute_index); entity_instance_by_guid_t internal_guid_map() { return byguid_; }; void add_type_ref(const express::Base& new_entity); void remove_type_ref(const express::Base& new_entity); - void process_deletion_inverse(const express::Base& inst); + void process_deletion_inverse(const express::Base& entity); - void build_inverses_(const express::Base&); + void build_inverses_(const express::Base& entity); // @nb this does not support id assignment template @@ -423,11 +423,11 @@ public: } template - T create(int id = -1) { - return create(&T::Class(), id).template as(); + T create(int instance_id = -1) { + return create(&T::Class(), instance_id).template as(); } - express::Base create(const ifcopenshell::declaration* decl, int id = -1); + express::Base create(const ifcopenshell::declaration* declaration, int instance_id = -1); void batch() { batch_mode_ = true; diff --git a/src/ifcparse/file_reader.h b/src/ifcparse/file_reader.h index 707852e5d3..1fce946efd 100644 --- a/src/ifcparse/file_reader.h +++ b/src/ifcparse/file_reader.h @@ -72,21 +72,22 @@ public: file_reader() = default; - explicit file_reader(const std::string& fn) + explicit file_reader(const std::string& path) : cursor_(0) { if constexpr (std::is_same_v #ifdef USE_MMAP || std::is_same_v #endif ) { - impl_ = std::make_shared(fn); + impl_ = std::make_shared(path); } else { static_assert(file_reader_dependent_false_v, "This file_reader constructor is not supported for the selected backend"); } } - explicit file_reader(const caller_fed_tag&) + explicit file_reader(const caller_fed_tag& tag) : cursor_(0) { + static_cast(tag); if constexpr (std::is_same_v) { impl_ = std::make_shared(caller_fed_tag{}); } else if constexpr (std::is_same_v) { @@ -96,8 +97,9 @@ public: } } - file_reader(const std::string& content, const caller_fed_tag&) + file_reader(const std::string& content, const caller_fed_tag& tag) : file_reader(caller_fed_tag{}) { + static_cast(tag); if constexpr (std::is_same_v || std::is_same_v) { impl_->push_next_page(content); @@ -106,10 +108,10 @@ public: } } - file_reader(const std::string& fn, size_t page_size, size_t page_capacity) + file_reader(const std::string& path, size_t page_size, size_t page_capacity) : cursor_(0) { if constexpr (std::is_same_v) { - impl_ = std::make_shared(fn, page_size, page_capacity); + impl_ = std::make_shared(path, page_size, page_capacity); } else { static_assert(file_reader_dependent_false_v, "This file_reader constructor is not supported for the selected backend"); } @@ -121,11 +123,11 @@ public: return c; } - void seek(size_t pos) { - if (pos > size()) { + void seek(size_t position) { + if (position > size()) { throw std::out_of_range("seek out of range"); } - cursor_ = pos; + cursor_ = position; } size_t tell() const { return cursor_; } @@ -154,23 +156,23 @@ public: return impl_->get_u32(cursor_); } - void increment(size_t n = 1) { - if (cursor_ + n > size()) { + void increment(size_t count = 1) { + if (cursor_ + count > size()) { throw std::out_of_range("increment past EOF"); } - cursor_ += n; + cursor_ += count; } - void push_next_page(const std::string& data) { - impl_->push_next_page(data); + void push_next_page(const std::string& page_data) { + impl_->push_next_page(page_data); } void drop_pages() { impl_->drop_pages(0); } - void drop_pages(size_t up_to_pos) { - impl_->drop_pages(up_to_pos); + void drop_pages(size_t up_to_position) { + impl_->drop_pages(up_to_position); } bool eof() const { @@ -183,8 +185,8 @@ public: return c; } - char get(size_t offset) const { - return impl_->get(offset); + char get(size_t position) const { + return impl_->get(position); } private: @@ -195,16 +197,16 @@ private: class IFC_PARSE_API full_buffer_impl { public: full_buffer_impl() = default; - explicit full_buffer_impl(const std::string& fn); - explicit full_buffer_impl(const caller_fed_tag&); - full_buffer_impl(const std::string& content, const caller_fed_tag&); + explicit full_buffer_impl(const std::string& path); + explicit full_buffer_impl(const caller_fed_tag& tag); + full_buffer_impl(const std::string& content, const caller_fed_tag& tag); size_t size() const; - char get(size_t pos) const; - uint32_t get_u32(size_t pos) const; - uint64_t get_u64(size_t pos) const; - void push_next_page(const std::string& data); - void drop_pages(size_t pos); + char get(size_t position) const; + uint32_t get_u32(size_t position) const; + uint64_t get_u64(size_t position) const; + void push_next_page(const std::string& page_data); + void drop_pages(size_t up_to_position); private: std::vector buf_; @@ -218,19 +220,19 @@ public: std::list::iterator it; }; - paged_file_impl(const std::string& fn, size_t page_size, size_t cap); + paged_file_impl(const std::string& path, size_t page_size, size_t page_capacity); ~paged_file_impl(); size_t size() const; - char get(size_t pos) const; - uint32_t get_u32(size_t pos) const; - uint64_t get_u64(size_t pos) const; - void push_next_page(const std::string& data); - void drop_pages(size_t pos); + char get(size_t position) const; + uint32_t get_u32(size_t position) const; + uint64_t get_u64(size_t position) const; + void push_next_page(const std::string& page_data); + void drop_pages(size_t up_to_position); private: - const file_reader_page& fetchPage_(size_t idx) const; - void touch_(std::unordered_map::iterator it) const; + const file_reader_page& fetchPage_(size_t page_index) const; + void touch_(std::unordered_map::iterator entry_it) const; void evict_() const; std::string fn_; @@ -245,14 +247,14 @@ private: #ifdef USE_MMAP class IFC_PARSE_API mmap_impl { public: - explicit mmap_impl(const std::string& fn); + explicit mmap_impl(const std::string& path); size_t size() const; - char get(size_t pos) const; - uint32_t get_u32(size_t pos) const; - uint64_t get_u64(size_t pos) const; - void push_next_page(const std::string& data); - void drop_pages(size_t pos); + char get(size_t position) const; + uint32_t get_u32(size_t position) const; + uint64_t get_u64(size_t position) const; + void push_next_page(const std::string& page_data); + void drop_pages(size_t up_to_position); private: boost::iostreams::mapped_file_source map_; @@ -263,11 +265,11 @@ private: class IFC_PARSE_API pushed_sequential_impl { public: size_t size() const; - char get(size_t pos) const; - uint32_t get_u32(size_t pos) const; - uint64_t get_u64(size_t pos) const; - void push_next_page(const std::string& data); - void drop_pages(size_t pos); + char get(size_t position) const; + uint32_t get_u32(size_t position) const; + uint64_t get_u64(size_t position) const; + void push_next_page(const std::string& page_data); + void drop_pages(size_t up_to_position); private: std::deque pages_; diff --git a/src/ifcparse/global_id.h b/src/ifcparse/global_id.h index 7805d5de96..41d80e32a5 100644 --- a/src/ifcparse/global_id.h +++ b/src/ifcparse/global_id.h @@ -37,7 +37,7 @@ class IFC_PARSE_API global_id { public: static const unsigned int length = 22; global_id(); - global_id(const std::string&); + global_id(const std::string& value); operator const std::string&() const; operator const boost::uuids::uuid&() const; const std::string& formatted() const; diff --git a/src/ifcparse/hierarchy_helper.h b/src/ifcparse/hierarchy_helper.h index 08a6d99414..4937852020 100644 --- a/src/ifcparse/hierarchy_helper.h +++ b/src/ifcparse/hierarchy_helper.h @@ -75,287 +75,287 @@ namespace { #ifdef HAS_SCHEMA_2x3 -Ifc2x3::IfcObjectDefinition get_parent_of_relation(const Ifc2x3::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc2x3::IfcObjectDefinition get_parent_of_relation(const Ifc2x3::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc2x3::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc2x3::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc2x3::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc2x3::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc2x3::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc2x3::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc2x3::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc2x3::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4 -Ifc4::IfcObjectDefinition get_parent_of_relation(const Ifc4::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4::IfcObjectDefinition get_parent_of_relation(const Ifc4::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x1 -Ifc4x1::IfcObjectDefinition get_parent_of_relation(const Ifc4x1::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x1::IfcObjectDefinition get_parent_of_relation(const Ifc4x1::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x1::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x1::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x1::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x1::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x1::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x1::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x1::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x2 -Ifc4x2::IfcObjectDefinition get_parent_of_relation(const Ifc4x2::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x2::IfcObjectDefinition get_parent_of_relation(const Ifc4x2::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x2::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x2::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x2::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x2::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x2::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x2::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x2::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3_rc1 -Ifc4x3_rc1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc1::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3_rc1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc1::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3_rc1::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3_rc1::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3_rc1::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_rc1::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc1::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_rc1::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc1::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3_rc2 -Ifc4x3_rc2::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc2::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3_rc2::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc2::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3_rc2::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3_rc2::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3_rc2::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_rc2::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3_rc2::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc2::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_rc2::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc2::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3_rc3 -Ifc4x3_rc3::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc3::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3_rc3::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc3::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3_rc3::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3_rc3::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3_rc3::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_rc3::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3_rc3::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc3::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_rc3::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc3::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3_rc4 -Ifc4x3_rc4::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc4::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3_rc4::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_rc4::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3_rc4::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3_rc4::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3_rc4::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_rc4::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3_rc4::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc4::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_rc4::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_rc4::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3 -Ifc4x3::IfcObjectDefinition get_parent_of_relation(const Ifc4x3::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3::IfcObjectDefinition get_parent_of_relation(const Ifc4x3::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3_tc1 -Ifc4x3_tc1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_tc1::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3_tc1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_tc1::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3_tc1::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3_tc1::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3_tc1::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_tc1::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3_tc1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_tc1::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_tc1::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_tc1::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3_add1 -Ifc4x3_add1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_add1::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3_add1::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_add1::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3_add1::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3_add1::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3_add1::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_add1::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3_add1::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_add1::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_add1::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_add1::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif #ifdef HAS_SCHEMA_4x3_add2 -Ifc4x3_add2::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_add2::IfcRelContainedInSpatialStructure& t) { - return t.RelatingStructure(); +Ifc4x3_add2::IfcObjectDefinition get_parent_of_relation(const Ifc4x3_add2::IfcRelContainedInSpatialStructure& relation) { + return relation.RelatingStructure(); } -std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelContainedInSpatialStructure& t) { - return cast_vector(t.RelatedElements()); +std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelContainedInSpatialStructure& relation) { + return cast_vector(relation.RelatedElements()); } -std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelAggregates& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelAggregates& relation) { + return cast_vector(relation.RelatedObjects()); } -std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelNests& t) { - return cast_vector(t.RelatedObjects()); +std::vector get_children_of_relation(const Ifc4x3_add2::IfcRelNests& relation) { + return cast_vector(relation.RelatedObjects()); } -void set_children_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure& t, std::vector& cs) { - t.setRelatedElements(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_add2::IfcRelContainedInSpatialStructure& relation, std::vector& children) { + relation.setRelatedElements(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_add2::IfcRelAggregates& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_add2::IfcRelAggregates& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } -void set_children_of_relation(Ifc4x3_add2::IfcRelNests& t, std::vector& cs) { - t.setRelatedObjects(cast_vector(cs)); +void set_children_of_relation(Ifc4x3_add2::IfcRelNests& relation, std::vector& children) { + relation.setRelatedObjects(cast_vector(children)); } #endif -express::Base get_parent_of_relation(const express::Base& t) { - return t.as().get("RelatingObject"); +express::Base get_parent_of_relation(const express::Base& relation) { + return relation.as().get("RelatingObject"); } -std::vector get_children_of_relation(const express::Base& t) { - return t.as().get("RelatedElements"); +std::vector get_children_of_relation(const express::Base& relation) { + return relation.as().get("RelatedElements"); } -void set_children_of_relation(express::Base& t, std::vector& cs) { - return t.set_attribute_value("RelatedElements", cs); +void set_children_of_relation(express::Base& relation, std::vector& children) { + return relation.set_attribute_value("RelatedElements", children); } } // namespace template @@ -378,9 +378,9 @@ class IFC_PARSE_API hierarchy_helper : public ifcopenshell::file { } template - T addValue(U v) { + T addValue(U value) { auto measure = create(); - measure.set_attribute_value(0, v); + measure.set_attribute_value(0, value); return measure; } @@ -393,25 +393,25 @@ class IFC_PARSE_API hierarchy_helper : public ifcopenshell::file { return ts.front(); } - typename Schema::IfcAxis2Placement3D addPlacement3d(double ox = 0.0, double oy = 0.0, double oz = 0.0, double zx = 0.0, double zy = 0.0, double zz = 1.0, double xx = 1.0, double xy = 0.0, double xz = 0.0); + typename Schema::IfcAxis2Placement3D addPlacement3d(double origin_x = 0.0, double origin_y = 0.0, double origin_z = 0.0, double z_axis_x = 0.0, double z_axis_y = 0.0, double z_axis_z = 1.0, double x_axis_x = 1.0, double x_axis_y = 0.0, double x_axis_z = 0.0); - typename Schema::IfcAxis2Placement2D addPlacement2d(double ox = 0.0, double oy = 0.0, double xx = 1.0, double xy = 0.0); + typename Schema::IfcAxis2Placement2D addPlacement2d(double origin_x = 0.0, double origin_y = 0.0, double x_axis_x = 1.0, double x_axis_y = 0.0); - typename Schema::IfcLocalPlacement addLocalPlacement(typename Schema::IfcObjectPlacement parent = typename Schema::IfcObjectPlacement{}, - double ox = 0.0, - double oy = 0.0, - double oz = 0.0, - double zx = 0.0, - double zy = 0.0, - double zz = 1.0, - double xx = 1.0, - double xy = 0.0, - double xz = 0.0); + typename Schema::IfcLocalPlacement addLocalPlacement(typename Schema::IfcObjectPlacement parent_placement = typename Schema::IfcObjectPlacement{}, + double origin_x = 0.0, + double origin_y = 0.0, + double origin_z = 0.0, + double z_axis_x = 0.0, + double z_axis_y = 0.0, + double z_axis_z = 1.0, + double x_axis_x = 1.0, + double x_axis_y = 0.0, + double x_axis_z = 0.0); template void addRelatedObject(const typename Schema::IfcObjectDefinition& relating_object, const typename Schema::IfcObjectDefinition& related_object, - typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}) + typename Schema::IfcOwnerHistory owner_history = typename Schema::IfcOwnerHistory{}) { if constexpr (std::is_same_v) { auto li = instances_by_type(); @@ -426,16 +426,16 @@ class IFC_PARSE_API hierarchy_helper : public ifcopenshell::file { } } if (!found) { - if (!owner_hist) { - owner_hist = getSingle(); + if (!owner_history) { + owner_history = getSingle(); } - if (!owner_hist) { - owner_hist = addOwnerHistory(); + if (!owner_history) { + owner_history = addOwnerHistory(); } std::vector related_objects = {related_object.template as()}; auto t = create(); t.setGlobalId(ifcopenshell::global_id()); - t.setOwnerHistory(owner_hist); + t.setOwnerHistory(owner_history); t.setRelatedObjects(related_objects); t.setRelatingType(relating_object.template as()); } @@ -458,11 +458,11 @@ class IFC_PARSE_API hierarchy_helper : public ifcopenshell::file { } } if (!found) { - if (!owner_hist) { - owner_hist = getSingle(); + if (!owner_history) { + owner_history = getSingle(); } - if (!owner_hist) { - owner_hist = addOwnerHistory(); + if (!owner_history) { + owner_history = addOwnerHistory(); } std::vector related_objects; @@ -470,7 +470,7 @@ class IFC_PARSE_API hierarchy_helper : public ifcopenshell::file { T t = create(); t.set_attribute_value(0, (std::string)ifcopenshell::global_id()); - t.set_attribute_value(1, owner_hist); + t.set_attribute_value(1, owner_history); int relating_index = 4; int related_index = 5; if (T::Class().name() == "IfcRelContainedInSpatialStructure" || std::is_base_of::value) { @@ -484,149 +484,150 @@ class IFC_PARSE_API hierarchy_helper : public ifcopenshell::file { } typename Schema::IfcOwnerHistory addOwnerHistory(); - typename Schema::IfcProject addProject(typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); + typename Schema::IfcProject addProject(typename Schema::IfcOwnerHistory owner_history = typename Schema::IfcOwnerHistory{}); void relatePlacements(typename Schema::IfcProduct parent, typename Schema::IfcProduct product); - typename Schema::IfcSite addSite(typename Schema::IfcProject = typename Schema::IfcProject{}, typename Schema::IfcOwnerHistory = typename Schema::IfcOwnerHistory{}); - typename Schema::IfcBuilding addBuilding(typename Schema::IfcSite site = typename Schema::IfcSite{}, typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); + typename Schema::IfcSite addSite(typename Schema::IfcProject project = typename Schema::IfcProject{}, typename Schema::IfcOwnerHistory owner_history = typename Schema::IfcOwnerHistory{}); + typename Schema::IfcBuilding addBuilding(typename Schema::IfcSite site = typename Schema::IfcSite{}, typename Schema::IfcOwnerHistory owner_history = typename Schema::IfcOwnerHistory{}); typename Schema::IfcBuildingStorey addBuildingStorey(typename Schema::IfcBuilding building = typename Schema::IfcBuilding{}, - typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); + typename Schema::IfcOwnerHistory owner_history = typename Schema::IfcOwnerHistory{}); typename Schema::IfcBuildingStorey addBuildingProduct(typename Schema::IfcProduct product, - typename Schema::IfcBuildingStorey storey = typename Schema::IfcBuildingStorey{}, - typename Schema::IfcOwnerHistory owner_hist = typename Schema::IfcOwnerHistory{}); + typename Schema::IfcBuildingStorey storey = typename Schema::IfcBuildingStorey{}, + typename Schema::IfcOwnerHistory owner_history = typename Schema::IfcOwnerHistory{}); - void addExtrudedPolyline(typename Schema::IfcShapeRepresentation rep, const std::vector>& points, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); + void addExtrudedPolyline(typename Schema::IfcShapeRepresentation representation, const std::vector>& points, double height, typename Schema::IfcAxis2Placement2D profile_placement = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D extrusion_placement = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection extrusion_direction = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); - typename Schema::IfcProductDefinitionShape addExtrudedPolyline(const std::vector>& points, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); + typename Schema::IfcProductDefinitionShape addExtrudedPolyline(const std::vector>& points, double height, typename Schema::IfcAxis2Placement2D profile_placement = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D extrusion_placement = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection extrusion_direction = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); - void addBox(typename Schema::IfcShapeRepresentation rep, double w, double d, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); + void addBox(typename Schema::IfcShapeRepresentation representation, double width, double depth, double height, typename Schema::IfcAxis2Placement2D profile_placement = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D extrusion_placement = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection extrusion_direction = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); - typename Schema::IfcProductDefinitionShape addBox(double w, double d, double h, typename Schema::IfcAxis2Placement2D place = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D place2 = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection dir = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); + typename Schema::IfcProductDefinitionShape addBox(double width, double depth, double height, typename Schema::IfcAxis2Placement2D profile_placement = typename Schema::IfcAxis2Placement2D{}, typename Schema::IfcAxis2Placement3D extrusion_placement = typename Schema::IfcAxis2Placement3D{}, typename Schema::IfcDirection extrusion_direction = typename Schema::IfcDirection{}, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); - void addAxis(typename Schema::IfcShapeRepresentation rep, double l, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); + void addAxis(typename Schema::IfcShapeRepresentation representation, double length, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); - typename Schema::IfcProductDefinitionShape addAxisBox(double w, double d, double h, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); + typename Schema::IfcProductDefinitionShape addAxisBox(double width, double depth, double height, typename Schema::IfcRepresentationContext context = typename Schema::IfcRepresentationContext{}); - void clipRepresentation(typename Schema::IfcProductRepresentation shape, - typename Schema::IfcAxis2Placement3D place, - bool agree); + void clipRepresentation(typename Schema::IfcProductRepresentation representation, + typename Schema::IfcAxis2Placement3D placement, + bool sense_agreement); - void clipRepresentation(typename Schema::IfcRepresentation shape, - typename Schema::IfcAxis2Placement3D place, - bool agree); + void clipRepresentation(typename Schema::IfcRepresentation representation, + typename Schema::IfcAxis2Placement3D placement, + bool sense_agreement); - typename Schema::IfcProductDefinitionShape addMappedItem(typename Schema::IfcShapeRepresentation, + typename Schema::IfcProductDefinitionShape addMappedItem(typename Schema::IfcShapeRepresentation source_representation, typename Schema::IfcCartesianTransformationOperator3D transform = typename Schema::IfcCartesianTransformationOperator3D{}, - typename Schema::IfcProductDefinitionShape def = typename Schema::IfcProductDefinitionShape{}); + typename Schema::IfcProductDefinitionShape definition_shape = typename Schema::IfcProductDefinitionShape{}); - typename Schema::IfcProductDefinitionShape addMappedItem(std::vector&, + typename Schema::IfcProductDefinitionShape addMappedItem(std::vector& source_representations, typename Schema::IfcCartesianTransformationOperator3D transform = typename Schema::IfcCartesianTransformationOperator3D{}); - typename Schema::IfcShapeRepresentation addEmptyRepresentation(const std::string& repid = "Body", const std::string& reptype = "SweptSolid"); + typename Schema::IfcShapeRepresentation addEmptyRepresentation(const std::string& representation_identifier = "Body", const std::string& representation_type = "SweptSolid"); - typename Schema::IfcGeometricRepresentationContext getRepresentationContext(const std::string&); + typename Schema::IfcGeometricRepresentationContext getRepresentationContext(const std::string& context_identifier); - typename Schema::IfcGeometricRepresentationSubContext getRepresentationSubContext(const std::string& ident, const std::string& type); + typename Schema::IfcGeometricRepresentationSubContext getRepresentationSubContext(const std::string& context_identifier, const std::string& context_type); private: std::map contexts_; }; #ifdef HAS_SCHEMA_2x3 -IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc2x3::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc2x3::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc2x3::IfcProductRepresentation& shape, const Ifc2x3::IfcPresentationStyleAssignment& style_assignment); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc2x3::IfcRepresentation& shape, const Ifc2x3::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc2x3::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc2x3::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc2x3::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc2x3::IfcProductRepresentation& shape, const Ifc2x3::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc2x3::IfcRepresentation& shape, const Ifc2x3::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4 -IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4::IfcProductRepresentation& shape, const Ifc4::IfcPresentationStyleAssignment& style_assignment); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4::IfcRepresentation& shape, const Ifc4::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4::IfcProductRepresentation& shape, const Ifc4::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4::IfcRepresentation& shape, const Ifc4::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x1 -IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x1::IfcProductRepresentation& shape, const Ifc4x1::IfcPresentationStyleAssignment& style_assignment); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x1::IfcRepresentation& shape, const Ifc4x1::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x1::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x1::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x1::IfcProductRepresentation& shape, const Ifc4x1::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x1::IfcRepresentation& shape, const Ifc4x1::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x2 -IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x2::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x2::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x2::IfcProductRepresentation& shape, const Ifc4x2::IfcPresentationStyleAssignment& style_assignment); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x2::IfcRepresentation& shape, const Ifc4x2::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x2::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x2::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x2::IfcProductRepresentation& shape, const Ifc4x2::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x2::IfcRepresentation& shape, const Ifc4x2::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x3_rc1 -IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc1::IfcProductRepresentation& shape, const Ifc4x3_rc1::IfcPresentationStyleAssignment& style_assignment); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc1::IfcRepresentation& shape, const Ifc4x3_rc1::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc1::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc1::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc1::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc1::IfcProductRepresentation& shape, const Ifc4x3_rc1::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc1::IfcRepresentation& shape, const Ifc4x3_rc1::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x3_rc2 -IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc2::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc2::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc2::IfcProductRepresentation& shape, const Ifc4x3_rc2::IfcPresentationStyleAssignment& style_assignment); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc2::IfcRepresentation& shape, const Ifc4x3_rc2::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc2::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc2::IfcPresentationStyleAssignment setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc2::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc2::IfcProductRepresentation& shape, const Ifc4x3_rc2::IfcPresentationStyleAssignment& style_assignment); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc2::IfcRepresentation& shape, const Ifc4x3_rc2::IfcPresentationStyleAssignment& style_assignment); #endif #ifdef HAS_SCHEMA_4x3_rc3 -IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc3::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc3::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc3::IfcProductRepresentation& shape, const Ifc4x3_rc3::IfcPresentationStyle& style); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc3::IfcRepresentation& shape, const Ifc4x3_rc3::IfcPresentationStyle& style); +IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc3::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc3::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc3::IfcProductRepresentation& shape, const Ifc4x3_rc3::IfcPresentationStyle& style); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc3::IfcRepresentation& shape, const Ifc4x3_rc3::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_rc4 -IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc4::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc4::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc4::IfcProductRepresentation& shape, const Ifc4x3_rc4::IfcPresentationStyle& style); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_rc4::IfcRepresentation& shape, const Ifc4x3_rc4::IfcPresentationStyle& style); +IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc4::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_rc4::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc4::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc4::IfcProductRepresentation& shape, const Ifc4x3_rc4::IfcPresentationStyle& style); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_rc4::IfcRepresentation& shape, const Ifc4x3_rc4::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3 -IFC_PARSE_API Ifc4x3::IfcPresentationStyle addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3::IfcProductRepresentation& shape, const Ifc4x3::IfcPresentationStyle& style); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3::IfcRepresentation& shape, const Ifc4x3::IfcPresentationStyle& style); +IFC_PARSE_API Ifc4x3::IfcPresentationStyle addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3::IfcProductRepresentation& shape, const Ifc4x3::IfcPresentationStyle& style); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3::IfcRepresentation& shape, const Ifc4x3::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_tc1 -IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_tc1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_tc1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_tc1::IfcProductRepresentation& shape, const Ifc4x3_tc1::IfcPresentationStyle& style); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_tc1::IfcRepresentation& shape, const Ifc4x3_tc1::IfcPresentationStyle& style); +IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_tc1::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_tc1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_tc1::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_tc1::IfcProductRepresentation& shape, const Ifc4x3_tc1::IfcPresentationStyle& style); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_tc1::IfcRepresentation& shape, const Ifc4x3_tc1::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_add1 -IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add1::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add1::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add1::IfcProductRepresentation& shape, const Ifc4x3_add1::IfcPresentationStyle& style); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add1::IfcRepresentation& shape, const Ifc4x3_add1::IfcPresentationStyle& style); +IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add1::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_add1::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add1::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add1::IfcProductRepresentation& shape, const Ifc4x3_add1::IfcPresentationStyle& style); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add1::IfcRepresentation& shape, const Ifc4x3_add1::IfcPresentationStyle& style); #endif #ifdef HAS_SCHEMA_4x3_add2 -IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle addStyleAssignment(hierarchy_helper& file, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add2::IfcProductRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add2::IfcRepresentation& shape, double r, double g, double b, double a = 1.0); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add2::IfcProductRepresentation& shape, const Ifc4x3_add2::IfcPresentationStyle& style); -IFC_PARSE_API void setSurfaceColour(hierarchy_helper& file, const Ifc4x3_add2::IfcRepresentation& shape, const Ifc4x3_add2::IfcPresentationStyle& style); +IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle addStyleAssignment(hierarchy_helper& model, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add2::IfcProductRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API Ifc4x3_add2::IfcPresentationStyle setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add2::IfcRepresentation& shape, double red, double green, double blue, double alpha = 1.0); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add2::IfcProductRepresentation& shape, const Ifc4x3_add2::IfcPresentationStyle& style); +IFC_PARSE_API void setSurfaceColour(hierarchy_helper& model, const Ifc4x3_add2::IfcRepresentation& shape, const Ifc4x3_add2::IfcPresentationStyle& style); #endif #endif + diff --git a/src/ifcparse/instance_data.h b/src/ifcparse/instance_data.h index 8f0b049853..a402fa21ec 100644 --- a/src/ifcparse/instance_data.h +++ b/src/ifcparse/instance_data.h @@ -178,105 +178,107 @@ namespace impl { struct is_contiguous_container> : std::true_type {}; template ::value && !is_contiguous_container::value, int>::type = 0> - bool serialize(std::string& val, const T& t) { - auto s = sizeof(typename T::value_type) * t.size(); - val.resize(s + 1); - val[0] = TypeEncoder::encode_type(); - memcpy(val.data() + 1, t.data(), s); + bool serialize(std::string& buffer, const T& value) { + auto byte_count = sizeof(typename T::value_type) * value.size(); + buffer.resize(byte_count + 1); + buffer[0] = TypeEncoder::encode_type(); + memcpy(buffer.data() + 1, value.data(), byte_count); return true; } template ::value&& is_contiguous_container::value, int>::type = 0> - bool serialize(std::string& val, const T& t) { - val = std::string(1, TypeEncoder::encode_type()); - for (auto& tt : t) { - std::string v2; - serialize(v2, tt); - std::string len(sizeof(size_t), 0); - size_t s = v2.size() - 1; - memcpy(len.data(), &s, sizeof(size_t)); + bool serialize(std::string& buffer, const T& value) { + buffer = std::string(1, TypeEncoder::encode_type()); + for (auto& nested_value : value) { + std::string nested_buffer; + serialize(nested_buffer, nested_value); + std::string encoded_length(sizeof(size_t), 0); + size_t payload_size = nested_buffer.size() - 1; + memcpy(encoded_length.data(), &payload_size, sizeof(size_t)); // @todo horribly inefficient // @todo strip off type label? - val += len + v2.substr(1); + buffer += encoded_length + nested_buffer.substr(1); } return true; } template || std::is_floating_point_v, int>::type = 0> - bool serialize(std::string& val, const T& t) { - val.resize(sizeof(T) + 1); - val[0] = TypeEncoder::encode_type(); - memcpy(val.data() + 1, &t, sizeof(T)); + bool serialize(std::string& buffer, const T& value) { + buffer.resize(sizeof(T) + 1); + buffer[0] = TypeEncoder::encode_type(); + memcpy(buffer.data() + 1, &value, sizeof(T)); return true; } - bool serialize(std::string& val, const blank& t); + bool serialize(std::string& buffer, const blank& value); - bool serialize(std::string& val, const derived& t); - bool serialize(std::string& val, const empty_aggregate_t& t); - bool serialize(std::string& val, const empty_aggregate_of_aggregate_t& t); + bool serialize(std::string& buffer, const derived& value); + bool serialize(std::string& buffer, const empty_aggregate_t& value); + bool serialize(std::string& buffer, const empty_aggregate_of_aggregate_t& value); - bool serialize(std::string& val, const boost::logic::tribool& t); + bool serialize(std::string& buffer, const boost::logic::tribool& value); - bool serialize(std::string& val, const boost::dynamic_bitset<>& t); + bool serialize(std::string& buffer, const boost::dynamic_bitset<>& value); - bool serialize(std::string& val, const express::Base& t); + bool serialize(std::string& buffer, const express::Base& value); - bool serialize(std::string& val, const enumeration_reference& v); + bool serialize(std::string& buffer, const enumeration_reference& value); - bool serialize(std::string& val, const std::vector& t); + bool serialize(std::string& buffer, const std::vector& value); - bool serialize(std::string& val, const std::vector>& t); + bool serialize(std::string& buffer, const std::vector>& value); template ::value && !is_contiguous_container::value, int>::type = 0> - bool deserialize(ifcopenshell::impl::rocks_db_file_storage*, const std::string& val, T& t, bool prefixed = true) { - if (prefixed && val[0] != TypeEncoder::encode_type()) { + bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& buffer, T& value, bool has_type_prefix = true) { + static_cast(storage); + if (has_type_prefix && buffer[0] != TypeEncoder::encode_type()) { return false; } - auto s = (val.size() - (prefixed ? 1 : 0)) / sizeof(typename T::value_type); - t.resize(s); - memcpy(t.data(), val.data() + (prefixed ? 1 : 0), s * sizeof(typename T::value_type)); + auto element_count = (buffer.size() - (has_type_prefix ? 1 : 0)) / sizeof(typename T::value_type); + value.resize(element_count); + memcpy(value.data(), buffer.data() + (has_type_prefix ? 1 : 0), element_count * sizeof(typename T::value_type)); return true; } template ::value && is_contiguous_container::value, int>::type = 0> - bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& val, T& t) { + bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& buffer, T& value) { // @todo - auto ptr = val.data(); + auto ptr = buffer.data(); if (*ptr != TypeEncoder::encode_type()) { return false; } ptr++; - t.clear(); - while (ptr < val.data() + val.size()) { - size_t s; - memcpy(&s, ptr, sizeof(size_t)); + value.clear(); + while (ptr < buffer.data() + buffer.size()) { + size_t payload_size; + memcpy(&payload_size, ptr, sizeof(size_t)); // @todo view ptr += sizeof(size_t); - std::string part(ptr, s); - t.emplace_back(); - deserialize(storage, part, t.back(), false); - ptr += s; + std::string part(ptr, payload_size); + value.emplace_back(); + deserialize(storage, part, value.back(), false); + ptr += payload_size; } return true; } template || std::is_floating_point_v, int>::type = 0> - bool deserialize(ifcopenshell::impl::rocks_db_file_storage*, const std::string& val, T & t) { - if (val[0] != TypeEncoder::encode_type()) { + bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& buffer, T& value) { + static_cast(storage); + if (buffer[0] != TypeEncoder::encode_type()) { return false; } - memcpy(&t, val.data() + 1, sizeof(T)); + memcpy(&value, buffer.data() + 1, sizeof(T)); return true; } - bool deserialize(ifcopenshell::impl::rocks_db_file_storage*, const std::string& val, boost::logic::tribool& t); + bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& buffer, boost::logic::tribool& value); - bool deserialize(ifcopenshell::impl::rocks_db_file_storage*, const std::string& val, boost::dynamic_bitset<>& t); + bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& buffer, boost::dynamic_bitset<>& value); - bool deserialize(ifcopenshell::impl::rocks_db_file_storage*, const std::string& val, std::vector& t); + bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& buffer, std::vector& value); - bool deserialize(ifcopenshell::impl::rocks_db_file_storage*, const std::string& val, std::vector>& t); + bool deserialize(ifcopenshell::impl::rocks_db_file_storage* storage, const std::string& buffer, std::vector>& value); } #endif @@ -292,8 +294,8 @@ class IFC_PARSE_API attribute_value { union pointer_type { const in_memory_attribute_storage* storage_ptr; ifcopenshell::impl::rocks_db_file_storage* db_ptr; - pointer_type(ifcopenshell::impl::rocks_db_file_storage* db) : db_ptr(db) {} - pointer_type(const in_memory_attribute_storage* ims) : storage_ptr(ims) {} + pointer_type(ifcopenshell::impl::rocks_db_file_storage* storage) : db_ptr(storage) {} + pointer_type(const in_memory_attribute_storage* storage) : storage_ptr(storage) {} }; private: @@ -306,18 +308,18 @@ public: , array_((const in_memory_attribute_storage*)nullptr) {} - attribute_value(const in_memory_attribute_storage* arr, uint8_t index) + attribute_value(const in_memory_attribute_storage* storage, uint8_t index) : index_(index) , storage_model_(0) - , array_(arr) + , array_(storage) {} - attribute_value(ifcopenshell::impl::rocks_db_file_storage* db, size_t instance_name, const ifcopenshell::declaration* entity_or_type, uint8_t index) + attribute_value(ifcopenshell::impl::rocks_db_file_storage* storage, size_t instance_name, const ifcopenshell::declaration* entity_or_type, uint8_t index) : index_(index) , storage_model_(1) , entity_or_type_(entity_or_type) , instance_name_(instance_name) - , array_(db) + , array_(storage) {} operator int() const; @@ -400,7 +402,7 @@ public: #ifdef IFOPSH_WITH_ROCKSDB // @todo void* is obviously very ugly here template - IFC_PARSE_API void set(void* storage, const ifcopenshell::declaration*, std::size_t identity, std::size_t index, const T& value); + IFC_PARSE_API void set(void* storage, const ifcopenshell::declaration* declaration, std::size_t identity, std::size_t index, const T& value); template IFC_PARSE_API bool has(void* storage, const ifcopenshell::declaration* decl, std::size_t identity, std::size_t index) const; @@ -448,9 +450,10 @@ class IFC_PARSE_API instance_data { populate_derived_(); } - instance_data(ifcopenshell::file* file, const ifcopenshell::declaration* declaration, uint32_t id, rocks_db_attribute_storage&&) + instance_data(ifcopenshell::file* file, const ifcopenshell::declaration* declaration, uint32_t id, rocks_db_attribute_storage&& storage) : file_(file), declaration_(declaration), identity_(counter_++), id_(id), storage_(nullptr) { + static_cast(storage); populate_derived_(); } @@ -462,9 +465,9 @@ class IFC_PARSE_API instance_data { */ // No copy-constructor/-assignment anymore because we need the instance for storage model context - instance_data(const instance_data&) = delete; - instance_data& operator=(const instance_data&) = delete; - instance_data& operator=(instance_data&&) = delete; + instance_data(const instance_data& other) = delete; + instance_data& operator=(const instance_data& other) = delete; + instance_data& operator=(instance_data&& other) = delete; instance_data(instance_data&& other) noexcept = delete; /* @@ -482,33 +485,33 @@ class IFC_PARSE_API instance_data { delete storage_; } - attribute_value get_attribute_value(size_t index) const; + attribute_value get_attribute_value(size_t attribute_index) const; template - void set_attribute_value(std::size_t index, T&& value) { + void set_attribute_value(std::size_t attribute_index, T&& value) { if (storage_) { - storage_->set(index, value); + storage_->set(attribute_index, value); } #ifdef IFOPSH_WITH_ROCKSDB else { - rocks_db_attribute_storage{}.set(get_storage_of_type(), declaration_, identity_, index, value); + rocks_db_attribute_storage{}.set(get_storage_of_type(), declaration_, identity_, attribute_index, value); } #endif } template - bool has_attribute_value(std::size_t index) const { + bool has_attribute_value(std::size_t attribute_index) const { if (storage_) { - return storage_->has(index); + return storage_->has(attribute_index); } #ifdef IFOPSH_WITH_ROCKSDB else { - return rocks_db_attribute_storage{}.has(get_storage_of_type(), declaration_, identity_, index); + return rocks_db_attribute_storage{}.has(get_storage_of_type(), declaration_, identity_, attribute_index); } #endif } - void to_string(std::ostream&, bool upper = false) const; + void to_string(std::ostream& stream, bool uppercase = false) const; }; #endif diff --git a/src/ifcparse/logger.h b/src/ifcparse/logger.h index 92e3f3c4f8..c227c5617b 100644 --- a/src/ifcparse/logger.h +++ b/src/ifcparse/logger.h @@ -69,10 +69,10 @@ class IFC_PARSE_API logger { static void set_product(std::optional product); /// Determines to what stream respectively progress and errors are logged - static void set_output(std::wostream* stream1, std::wostream* stream2); + static void set_output(std::wostream* progress_stream, std::wostream* error_stream); /// Determines to what stream respectively progress and errors are logged - static void set_output(std::ostream* stream1, std::ostream* stream2); + static void set_output(std::ostream* progress_stream, std::ostream* error_stream); /// Determines the types of log messages to get logged static void verbosity(Severity severity); @@ -84,8 +84,8 @@ class IFC_PARSE_API logger { static Format output_format(); /// Log a message to the output stream - static void message(Severity type, const std::string& text, const express::Base& instance = express::Base()); - static void message(Severity type, const std::exception& exception, const express::Base& instance = express::Base()); + static void message(Severity severity, const std::string& text, const express::Base& instance = express::Base()); + static void message(Severity severity, const std::exception& exception, const express::Base& instance = express::Base()); static void notice(const std::string& text, const express::Base& instance = express::Base()) { logger::message(LOG_NOTICE, text, instance); } static void warning(const std::string& text, const express::Base& instance = express::Base()) { logger::message(LOG_WARNING, text, instance); } @@ -95,12 +95,12 @@ class IFC_PARSE_API logger { static void warning(const std::exception& exception, const express::Base& instance = express::Base()) { message(LOG_WARNING, exception, instance); } static void error(const std::exception& exception, const express::Base& instance = express::Base()) { message(LOG_ERROR, exception, instance); } - static void status(const std::string& message, bool new_line = true); + static void status(const std::string& message, bool append_newline = true); - static void progress_bar(int progress); + static void progress_bar(int progress_percent); static std::string get_log(); static void print_performance_stats(); - static void print_performance_stats_on_element(bool b) { print_perf_stats_on_element_ = b; } + static void print_performance_stats_on_element(bool enabled) { print_perf_stats_on_element_ = enabled; } }; #define PERF(x) \ diff --git a/src/ifcparse/map_transformer.h b/src/ifcparse/map_transformer.h index bf6714e69e..6e50f31a91 100644 --- a/src/ifcparse/map_transformer.h +++ b/src/ifcparse/map_transformer.h @@ -47,14 +47,14 @@ public: // read-only constructor with TransformBack=void template ::value, int>::type = 0> - map_transformer(BaseMap* map, Transform transform) - : base_map_(map), transform_(std::move(transform)), transform_back_{} {} + map_transformer(BaseMap* base_map, Transform transform) + : base_map_(base_map), transform_(std::move(transform)), transform_back_{} {} // read-write constructor with TransformBack provided template ::value, int>::type = 0> - map_transformer(BaseMap* map, Transform transform, TB transform_back) - : base_map_(map), transform_(std::move(transform)), transform_back_(std::move(transform_back)) {} + map_transformer(BaseMap* base_map, Transform transform, TB transform_back) + : base_map_(base_map), transform_(std::move(transform)), transform_back_(std::move(transform_back)) {} class iterator { public: @@ -73,8 +73,8 @@ public: public: iterator() : base_it_(), transform_ptr_(nullptr) {} - iterator(base_iterator base_it, Transform* transform_ptr) - : base_it_(base_it), transform_ptr_(transform_ptr) {} + iterator(base_iterator base_iterator, Transform* transform) + : base_it_(base_iterator), transform_ptr_(transform) {} // On dereference, return a pair where the key is unchanged and the mapped value // is the result of applying the transform to the underlying mapped value. @@ -118,15 +118,15 @@ public: return iterator(base_map_->end(), &transform_); } - iterator find(const key_type& k) { - return iterator(base_map_->find(k), &transform_); + iterator find(const key_type& key) { + return iterator(base_map_->find(key), &transform_); } // @todo still not sure if this is a good idea, do we want to insert into the transformed map? - std::pair insert(const value_type& val) { + std::pair insert(const value_type& value) { static_assert(!read_only, "insert() requires TransformBack"); - auto p = base_map_->insert({ val.first, transform_back_(val.second) }); - return { iterator(p.first, &transform_), p.second }; + auto result = base_map_->insert({ value.first, transform_back_(value.second) }); + return { iterator(result.first, &transform_), result.second }; } size_t erase(const key_type& key) { diff --git a/src/ifcparse/map_variant.h b/src/ifcparse/map_variant.h index 0b4b57a0b9..16e8aa3d4c 100644 --- a/src/ifcparse/map_variant.h +++ b/src/ifcparse/map_variant.h @@ -58,8 +58,8 @@ public: iterator() = default; - explicit iterator(underlying_iterator_variant v) - : it_var(std::move(v)) {} + explicit iterator(underlying_iterator_variant iterator_variant) + : it_var(std::move(iterator_variant)) {} iterator(const iterator& other) : it_var(other.it_var), cached_value_ptr_(nullptr) {} @@ -107,7 +107,7 @@ public: variant_map() {} template - variant_map(MapT* m) : map_(m) {} + variant_map(MapT* map) : map_(map) {} iterator begin() const{ return std::visit([](auto m) -> iterator { @@ -160,11 +160,11 @@ public: }, map_); } - std::pair insert(const value_type& val) { - return std::visit([this, &val](auto m) -> std::pair { + std::pair insert(const value_type& value) { + return std::visit([this, &value](auto m) -> std::pair { // @todo is monostate still necessary here? if constexpr (!std::is_same_v, std::monostate>) { - auto result = m->insert(val); + auto result = m->insert(value); return { iterator(result.first), result.second }; } else { return { end(), false }; diff --git a/src/ifcparse/parse.h b/src/ifcparse/parse.h index 6756e4fb4d..c6ee71a7ac 100644 --- a/src/ifcparse/parse.h +++ b/src/ifcparse/parse.h @@ -77,11 +77,11 @@ class IFC_PARSE_API spf_lexer { // void TokenString(size_t offset, std::string& result); }; -IFC_PARSE_API std::vector traverse(const express::Base& instance, int max_level = -1); +IFC_PARSE_API std::vector traverse(const express::Base& instance, int max_depth = -1); -IFC_PARSE_API std::vector traverse_breadth_first(const express::Base& instance, int max_level = -1); +IFC_PARSE_API std::vector traverse_breadth_first(const express::Base& instance, int max_depth = -1); } // namespace ifcopenshell -IFC_PARSE_API std::ostream& operator<<(std::ostream& out, const ifcopenshell::file& file); +IFC_PARSE_API std::ostream& operator<<(std::ostream& stream, const ifcopenshell::file& file); #endif diff --git a/src/ifcparse/rocksdb_map_adapter.h b/src/ifcparse/rocksdb_map_adapter.h index da2346789f..7d0e5a8f63 100644 --- a/src/ifcparse/rocksdb_map_adapter.h +++ b/src/ifcparse/rocksdb_map_adapter.h @@ -46,60 +46,60 @@ struct DefaultCodec; // Specialization for size_t. template <> struct DefaultCodec { - std::string encode(const size_t& v) const { - std::string s(sizeof(v), 0); - memcpy(s.data(), &v, sizeof(v)); - return s; + std::string encode(const size_t& value) const { + std::string encoded(sizeof(value), 0); + memcpy(encoded.data(), &value, sizeof(value)); + return encoded; } - size_t decode(const std::string& s) const { - size_t v = 0; - // @todo take min of sizeof(v), len(s) + size_t decode(const std::string& encoded) const { + size_t value = 0; + // @todo take min of sizeof(value), len(encoded) // @todo unify all serialization primitives - memcpy(&v, s.data(), sizeof(v)); - return v; + memcpy(&value, encoded.data(), sizeof(value)); + return value; } }; // Specialization for uint32_t. template <> struct DefaultCodec { - std::string encode(const uint32_t& v) const { - std::string s(sizeof(v), 0); - memcpy(s.data(), &v, sizeof(v)); - return s; + std::string encode(const uint32_t& value) const { + std::string encoded(sizeof(value), 0); + memcpy(encoded.data(), &value, sizeof(value)); + return encoded; } - uint32_t decode(const std::string& s) const { - uint32_t v = 0; - // @todo take min of sizeof(v), len(s) + uint32_t decode(const std::string& encoded) const { + uint32_t value = 0; + // @todo take min of sizeof(value), len(encoded) // @todo unify all serialization primitives - memcpy(&v, s.data(), sizeof(v)); - return v; + memcpy(&value, encoded.data(), sizeof(value)); + return value; } }; // Specialization for std::vector. template <> struct DefaultCodec> { - std::string encode(const std::vector& vs) const { - std::string s(sizeof(uint32_t) * vs.size(), 0); - memcpy(s.data(), vs.data(), s.size()); - return s; + std::string encode(const std::vector& values) const { + std::string encoded(sizeof(uint32_t) * values.size(), 0); + memcpy(encoded.data(), values.data(), encoded.size()); + return encoded; } - std::vector decode(const std::string& s) const { - std::vector vs(s.size() / sizeof(uint32_t), 0); - memcpy(vs.data(), s.data(), s.size()); - return vs; + std::vector decode(const std::string& encoded) const { + std::vector values(encoded.size() / sizeof(uint32_t), 0); + memcpy(values.data(), encoded.data(), encoded.size()); + return values; } }; // Specialization for std::string (identity) template <> struct DefaultCodec { - std::string encode(const std::string& v) const { - return v; + std::string encode(const std::string& value) const { + return value; } - std::string decode(const std::string& s) const { - return s; + std::string decode(const std::string& encoded) const { + return encoded; } }; @@ -114,22 +114,23 @@ std::string key_to_string(const KeyT& key) { // Convert from a string to a key. For non-string types, we assume numeric keys. template ::value, int>::type = 0> -KeyT key_from_string(const std::string& s) { +KeyT key_from_string(const std::string& key_string) { // @todo tuples if constexpr (std::is_same_v) { - return s; + return key_string; } else if constexpr (std::is_integral_v) { - return static_cast(std::stoll(s)); + return static_cast(std::stoll(key_string)); } else { static_assert(sizeof(KeyT) == 0, "key_from_string not implemented for this type"); } } template -std::string tuple_to_string_impl(const Tuple& t, std::index_sequence) { +std::string tuple_to_string_impl(const Tuple& tuple_value, std::index_sequence indices) { + static_cast(indices); std::ostringstream oss; // Unpack the tuple; add a pipe before each element except the first. - ((oss << (Is == 0 ? "" : "|") << std::to_string(std::get(t))), ...); + ((oss << (Is == 0 ? "" : "|") << std::to_string(std::get(tuple_value))), ...); return oss.str(); } @@ -152,14 +153,15 @@ T convert_string(const std::string& token) { // Helper: Build a tuple from a vector of string tokens. template -TupleT tuple_from_string_impl(const std::vector& tokens, std::index_sequence) { +TupleT tuple_from_string_impl(const std::vector& tokens, std::index_sequence indices) { + static_cast(indices); return std::make_tuple(convert_string>(tokens[Is])...); } template ::value, int>::type = 0> -TupleT key_from_string(const std::string& s) { +TupleT key_from_string(const std::string& key_string) { std::vector tokens; - std::istringstream iss(s); + std::istringstream iss(key_string); std::string token; while (std::getline(iss, token, '|')) { tokens.push_back(token); @@ -216,8 +218,8 @@ public: iterator() : db_(nullptr), prefix_(), codec_(Codec{}), it_(nullptr) {} iterator(rocksdb::DB* db, const std::string& prefix, - std::unique_ptr iter, Codec codec = Codec{}) - : db_(db), prefix_(prefix), codec_(codec), it_(std::move(iter)) + std::unique_ptr iterator, Codec codec = Codec{}) + : db_(db), prefix_(prefix), codec_(codec), it_(std::move(iterator)) { check_valid(); } @@ -341,24 +343,24 @@ public: #endif } - std::pair insert(const value_type& val) { + std::pair insert(const value_type& value) { #ifdef IFOPSH_WITH_ROCKSDB - std::string key_str = key_to_string(val.first); + std::string key_str = key_to_string(value.first); std::string full_key = prefix_ + key_str; std::string existing; rocksdb::Status s = db_->Get(rocksdb::ReadOptions{}, full_key, &existing); if (s.ok()) { // Key already exists. - return { find(val.first), false }; + return { find(value.first), false }; } - std::string encoded = codec_.encode(val.second); + std::string encoded = codec_.encode(value.second); s = db_->Put(rocksdb::WriteOptions{}, full_key, encoded); if (!s.ok()) { return { end(), false }; } #endif - return { find(val.first), true }; + return { find(value.first), true }; } }; -#endif \ No newline at end of file +#endif diff --git a/src/ifcparse/rocksdb_set_view.h b/src/ifcparse/rocksdb_set_view.h index 1f4cd83ca5..971eb43f26 100644 --- a/src/ifcparse/rocksdb_set_view.h +++ b/src/ifcparse/rocksdb_set_view.h @@ -89,8 +89,8 @@ public: iterator() : db_(nullptr), prefix_(), it_(nullptr) {} iterator(rocksdb::DB* db, const std::string& prefix, - std::unique_ptr iter) - : db_(db), prefix_(prefix), it_(std::move(iter)) + std::unique_ptr iterator) + : db_(db), prefix_(prefix), it_(std::move(iterator)) { check_valid(); } @@ -214,9 +214,10 @@ public: } size_t erase(const key_type& key) { + static_cast(key); // @todo return 0; } }; -#endif \ No newline at end of file +#endif diff --git a/src/ifcparse/schema.h b/src/ifcparse/schema.h index 8f56a0474f..1cbc6d05c6 100644 --- a/src/ifcparse/schema.h +++ b/src/ifcparse/schema.h @@ -56,8 +56,8 @@ class IFC_PARSE_API parameter_type { virtual const simple_type* as_simple_type() const { return static_cast(0); } virtual const aggregation_type* as_aggregation_type() const { return static_cast(0); } - virtual bool is(const std::string& /*name*/) const { return false; } - virtual bool is(const ifcopenshell::declaration& /*decl*/) const { return false; } + virtual bool is(const std::string& /*type_name*/) const { return false; } + virtual bool is(const ifcopenshell::declaration& /*declaration*/) const { return false; } }; class IFC_PARSE_API named_type : public parameter_type { @@ -221,14 +221,14 @@ class IFC_PARSE_API enumeration_type : public declaration { return enumeration_items_[i].c_str(); } - size_t lookup_enum_offset(const std::string& string) const { + size_t lookup_enum_offset(const std::string& value_name) const { size_t index = 0; for (auto it = enumeration_items_.begin(); it != enumeration_items_.end(); ++it, ++index) { - if (string == *it) { + if (value_name == *it) { return index; } } - throw ifcopenshell::exception("Unable to find keyword in schema: " + string); + throw ifcopenshell::exception("Unable to find keyword in schema: " + value_name); } virtual const enumeration_type* as_enumeration_type() const { return this; } @@ -308,23 +308,23 @@ class IFC_PARSE_API entity : public declaration { std::string name_; public: - attribute_by_name_cmp(const std::string name) - : name_(name) {} - bool operator()(const attribute* attr) { - return attr->name() == name_; + attribute_by_name_cmp(const std::string attribute_name) + : name_(attribute_name) {} + bool operator()(const attribute* attribute_definition) { + return attribute_definition->name() == name_; } }; - const attribute* attribute_by_index_(size_t& index) const { + const attribute* attribute_by_index_(size_t& attribute_index) const { const attribute* attr = 0; if (supertype_ != nullptr) { - attr = supertype_->attribute_by_index_(index); + attr = supertype_->attribute_by_index_(attribute_index); } if (attr == 0) { - if (index < attributes_.size()) { - attr = attributes_[index]; + if (attribute_index < attributes_.size()) { + attr = attributes_[attribute_index]; } - index -= attributes_.size(); + attribute_index -= attributes_.size(); } return attr; } @@ -395,7 +395,7 @@ class IFC_PARSE_API entity : public declaration { return super_count + attributes_.size(); } - ptrdiff_t attribute_index(const attribute* attr) const { + ptrdiff_t attribute_index(const attribute* attribute_definition) const { const entity* current = this; ptrdiff_t index = -1; do { @@ -403,7 +403,7 @@ class IFC_PARSE_API entity : public declaration { index += current->attributes().size(); } else { std::vector::const_iterator iter; - iter = std::find(current->attributes().begin(), current->attributes().end(), attr); + iter = std::find(current->attributes().begin(), current->attributes().end(), attribute_definition); if (iter != current->attributes().end()) { index = std::distance(current->attributes().begin(), iter); } @@ -448,8 +448,8 @@ class IFC_PARSE_API schema_definition { class declaration_by_name_cmp { public: - bool operator()(const declaration* decl, const std::string& name) { - return decl->name_uc() < name; + bool operator()(const declaration* declaration, const std::string& name) { + return declaration->name_uc() < name; } }; @@ -484,8 +484,8 @@ class IFC_PARSE_API schema_definition { return *iter; } - const declaration* declaration_by_name(size_t name) const { - return declarations_.at(name); + const declaration* declaration_by_name(size_t declaration_index) const { + return declarations_.at(declaration_index); } const std::vector& declarations() const { return declarations_; } @@ -497,11 +497,11 @@ class IFC_PARSE_API schema_definition { const std::string& name() const { return name_; } }; -IFC_PARSE_API const schema_definition* schema_by_name(const std::string&); +IFC_PARSE_API const schema_definition* schema_by_name(const std::string& schema_name); IFC_PARSE_API std::vector schema_names(); -IFC_PARSE_API void register_schema(schema_definition*); +IFC_PARSE_API void register_schema(schema_definition* schema); IFC_PARSE_API void clear_schemas(); } // namespace ifcopenshell diff --git a/src/ifcparse/set_to_map_transformer.h b/src/ifcparse/set_to_map_transformer.h index eccbdfa766..3ec284cc34 100644 --- a/src/ifcparse/set_to_map_transformer.h +++ b/src/ifcparse/set_to_map_transformer.h @@ -38,8 +38,8 @@ private: Transform transform_; public: - set_to_map_transformer(BaseSet* map, Transform transform) - : base_map_(map), transform_(transform) {} + set_to_map_transformer(BaseSet* base_set, Transform transform) + : base_map_(base_set), transform_(transform) {} class iterator { public: @@ -58,8 +58,8 @@ public: public: iterator() : base_it_(), transform_ptr_(nullptr) {} - iterator(base_iterator base_it, Transform* transform_ptr) - : base_it_(base_it), transform_ptr_(transform_ptr) {} + iterator(base_iterator base_iterator, Transform* transform) + : base_it_(base_iterator), transform_ptr_(transform) {} // On dereference, return a pair where the key is the set value and the mapped value // is the result of applying the transform to the underlying value. @@ -102,12 +102,13 @@ public: return iterator(base_map_->end(), &transform_); } - iterator find(const key_type& k) { - return iterator(base_map_->find(k), &transform_); + iterator find(const key_type& key) { + return iterator(base_map_->find(key), &transform_); } - size_t erase(const key_type&) { + size_t erase(const key_type& key) { + static_cast(key); // @todo return 0; } -}; \ No newline at end of file +}; diff --git a/src/ifcparse/si_prefix.h b/src/ifcparse/si_prefix.h index c93b11c606..e2d269f500 100644 --- a/src/ifcparse/si_prefix.h +++ b/src/ifcparse/si_prefix.h @@ -28,7 +28,7 @@ namespace ifcopenshell { IFC_PARSE_API double si_prefix_to_value(const std::string& prefix); template -IFC_PARSE_API double get_SI_equivalent(const typename Schema::IfcNamedUnit&); +IFC_PARSE_API double get_SI_equivalent(const typename Schema::IfcNamedUnit& unit); } // namespace ifcopenshell #endif diff --git a/src/ifcparse/spf_header.h b/src/ifcparse/spf_header.h index dd8b35899a..349ae33dda 100644 --- a/src/ifcparse/spf_header.h +++ b/src/ifcparse/spf_header.h @@ -35,17 +35,17 @@ class IFC_PARSE_API spf_header { std::array, 3> header_entities_; public: - explicit spf_header(ifcopenshell::file* file); + explicit spf_header(ifcopenshell::file* owner_file); ~spf_header(); - void write(std::ostream& out) const; + void write(std::ostream& stream) const; ifcopenshell::file* file() { return file_; } - void file(ifcopenshell::file* file); + void file(ifcopenshell::file* owner_file); - void set_file_description(const std::shared_ptr& data); - void set_file_name(const std::shared_ptr& data); - void set_file_schema(const std::shared_ptr& data); + void set_file_description(const std::shared_ptr& description_data); + void set_file_name(const std::shared_ptr& name_data); + void set_file_schema(const std::shared_ptr& schema_data); const Header_section_schema::file_description file_description() const; const Header_section_schema::file_name file_name() const; diff --git a/src/ifcparse/storage.h b/src/ifcparse/storage.h index 8ceb18936f..5f3b2c1ddf 100644 --- a/src/ifcparse/storage.h +++ b/src/ifcparse/storage.h @@ -57,7 +57,7 @@ public: // Construct from any one of the underlying iterator types. template - variant_iterator(Iterator it) : it_(it) {} + variant_iterator(Iterator iterator) : it_(iterator) {} // Dereference operator. decltype(auto) operator*() const { @@ -161,20 +161,20 @@ namespace ifcopenshell { token() : start_pos(0), type(Token_NONE) {} - token(size_t start, token_type ty, const std::string& str) - : start_pos(start), type(ty), value_string(&str) {} + token(size_t start_position, token_type token_kind, const std::string& string_value) + : start_pos(start_position), type(token_kind), value_string(&string_value) {} - token(size_t start, token_type ty, int i) - : start_pos(start), type(ty), value_int(i) {} + token(size_t start_position, token_type token_kind, int integer_value) + : start_pos(start_position), type(token_kind), value_int(integer_value) {} - token(size_t start, double d) - : start_pos(start), type(Token_FLOAT), value_double(d) {} + token(size_t start_position, double floating_value) + : start_pos(start_position), type(Token_FLOAT), value_double(floating_value) {} - token(size_t start, char op) - : start_pos(start), type(Token_OPERATOR), value_char(op) {} + token(size_t start_position, char operator_character) + : start_pos(start_position), type(Token_OPERATOR), value_char(operator_character) {} - token(size_t start, token_type ty, char c) - : start_pos(start), type(ty), value_char(c) {} + token(size_t start_position, token_type token_kind, char character_value) + : start_pos(start_position), type(token_kind), value_char(character_value) {} bool is_string(); bool is_identifier(); @@ -234,19 +234,19 @@ namespace ifcopenshell { }; ~parse_context(); - parse_context(const parse_context&) = delete; - parse_context& operator=(const parse_context&) = delete; + parse_context(const parse_context& other) = delete; + parse_context& operator=(const parse_context& other) = delete; - parse_context(parse_context&&) = default; - parse_context& operator=(parse_context&&) = default; + parse_context(parse_context&& other) = default; + parse_context& operator=(parse_context&& other) = default; parse_context& push(); - void push(token t); + void push(token next_token); - void push(const express::Base& inst); + void push(const express::Base& instance); - std::shared_ptr construct(ifcopenshell::file* owner, std::optional name, unresolved_references& references_to_resolve, const ifcopenshell::declaration* decl, std::optional expected_size, int resolve_reference_index, bool coerce_attribute_count=true); + std::shared_ptr construct(ifcopenshell::file* owner_file, std::optional instance_name, unresolved_references& references_to_resolve, const ifcopenshell::declaration* declaration, std::optional expected_size, int resolve_reference_index, bool coerce_attribute_count = true); }; struct parse_context_pool { @@ -310,9 +310,9 @@ namespace ifcopenshell { typedef std::map> entities_by_ref_t; typedef entity_instance_by_name_t::iterator iterator; - in_memory_file_storage(ifcopenshell::file* f = nullptr) : file(f), schema(nullptr), byid_read_(&byid_, [this](const std::shared_ptr& d) { return express::Base(d); }) {}; - in_memory_file_storage(const in_memory_file_storage&) = delete; - in_memory_file_storage(const in_memory_file_storage&&) = delete; + in_memory_file_storage(ifcopenshell::file* owner_file = nullptr) : file(owner_file), schema(nullptr), byid_read_(&byid_, [this](const std::shared_ptr& data) { return express::Base(data); }) {}; + in_memory_file_storage(const in_memory_file_storage& other) = delete; + in_memory_file_storage(const in_memory_file_storage&& other) = delete; class type_iterator : public entities_by_type_t::const_iterator { @@ -325,8 +325,8 @@ namespace ifcopenshell { type_iterator() : entities_by_type_t::const_iterator() {}; - type_iterator(const entities_by_type_t::const_iterator& iter) - : entities_by_type_t::const_iterator(iter) {}; + type_iterator(const entities_by_type_t::const_iterator& iterator) + : entities_by_type_t::const_iterator(iterator) {}; entities_by_type_t::key_type const* operator->() const { return &entities_by_type_t::const_iterator::operator->()->first; @@ -356,19 +356,19 @@ namespace ifcopenshell { entity_instance_by_name_t byid_read_; template - void load(ifcopenshell::spf_lexer* tokens, std::optional entity_instance_name, const ifcopenshell::entity* entity, parse_context&, int attribute_index = -1); + void load(ifcopenshell::spf_lexer* tokens, std::optional entity_instance_name, const ifcopenshell::entity* entity, parse_context& context, int attribute_index = -1); template void try_read_semicolon(ifcopenshell::spf_lexer* tokens) const; - void register_inverse(unsigned, const ifcopenshell::entity* from_entity, int inst_id, int attribute_index); - void unregister_inverse(unsigned, const ifcopenshell::entity* from_entity, const express::Base&, int attribute_index); + void register_inverse(unsigned referenced_id, const ifcopenshell::entity* from_entity, int instance_id, int attribute_index); + void unregister_inverse(unsigned referenced_id, const ifcopenshell::entity* from_entity, const express::Base& entity, int attribute_index); template - void read_from_stream(Reader* stream, const ifcopenshell::schema_definition*& schema, unsigned int& max_id, const std::set& typed_to_bypass); + void read_from_stream(Reader* stream, const ifcopenshell::schema_definition*& schema, unsigned int& max_id, const std::set& types_to_bypass); file_open_status good_ = file_open_status::SUCCESS; - express::Base instance_by_id(int id); + express::Base instance_by_id(int instance_id); void add_type_ref(const express::Base& new_entity) { if (auto* ty = new_entity.declaration().as_entity()) { @@ -387,12 +387,12 @@ namespace ifcopenshell { } } - void process_deletion_inverse(const express::Base& inst); + void process_deletion_inverse(const express::Base& entity); template - T create(int id=-1); + T create(int instance_id = -1); - express::Base create(const ifcopenshell::declaration* decl, int id=-1); + express::Base create(const ifcopenshell::declaration* declaration, int instance_id = -1); }; class IFC_PARSE_API rocks_db_file_storage { @@ -449,12 +449,12 @@ namespace ifcopenshell { entities_by_ref_t byref_excl_; // @todo naming - rocks_db_file_storage(const std::string& filepath, ifcopenshell::file* file, bool readonly=false); + rocks_db_file_storage(const std::string& path, ifcopenshell::file* owner_file, bool read_only = false); ~rocks_db_file_storage(); bool read_schema(const ifcopenshell::schema_definition*& schema); - express::Base assert_existance(size_t instanceId, instance_ref r); + express::Base assert_existance(size_t instance_id, instance_ref reference_type); // @todo merge iterators (template?) class IFC_PARSE_API rocksdb_types_iterator { @@ -492,11 +492,11 @@ namespace ifcopenshell { { } - rocksdb_types_iterator(const rocks_db_file_storage* fs) - : storage_(fs) + rocksdb_types_iterator(const rocks_db_file_storage* storage) + : storage_(storage) { #ifdef IFOPSH_WITH_ROCKSDB - state_ = fs->db->NewIterator(rocksdb::ReadOptions()); + state_ = storage->db->NewIterator(rocksdb::ReadOptions()); state_->Seek(prefix_); if (!state_->Valid() || !state_->key().starts_with(prefix_)) { delete state_; @@ -555,21 +555,21 @@ namespace ifcopenshell { // @todo rocksdb_instance_iterator? using const_iterator = entity_instance_by_name_t::iterator; - void register_inverse(unsigned, const ifcopenshell::entity* from_entity, int inst_id, int attribute_index); - void unregister_inverse(unsigned, const ifcopenshell::entity* from_entity, const express::Base&, int attribute_index); + void register_inverse(unsigned referenced_id, const ifcopenshell::entity* from_entity, int instance_id, int attribute_index); + void unregister_inverse(unsigned referenced_id, const ifcopenshell::entity* from_entity, const express::Base& entity, int attribute_index); // @todo a bit hard as a map because of value_type being an aggregate void add_type_ref(const express::Base& new_entity); void remove_type_ref(const express::Base& new_entity); - express::Base instance_by_id(int id); + express::Base instance_by_id(int instance_id); - void process_deletion_inverse(const express::Base& inst); + void process_deletion_inverse(const express::Base& entity); template - T create(int id=-1); + T create(int instance_id = -1); - express::Base create(const ifcopenshell::declaration* decl, int id=-1); + express::Base create(const ifcopenshell::declaration* declaration, int instance_id = -1); }; } } diff --git a/src/ifcparse/utils.h b/src/ifcparse/utils.h index 236c244e36..bd449f6d9f 100644 --- a/src/ifcparse/utils.h +++ b/src/ifcparse/utils.h @@ -27,10 +27,10 @@ namespace ifcopenshell { /// Replaces spaces and potentially other problem causing characters with underscores. -IFC_PARSE_API void sanitate_material_name(std::string& str); +IFC_PARSE_API void sanitate_material_name(std::string& material_name); -IFC_PARSE_API void escape_xml(std::string& str); -IFC_PARSE_API void unescape_xml(std::string& str); +IFC_PARSE_API void escape_xml(std::string& text); +IFC_PARSE_API void unescape_xml(std::string& text); namespace path { @@ -43,13 +43,13 @@ IFC_PARSE_API bool rename_file(const std::string& old_filename, const std::strin IFC_PARSE_API std::string to_utf8(const std::wstring& str); /// Uses windows.h string conversion functions -IFC_PARSE_API std::wstring from_utf8(const std::string& str); +IFC_PARSE_API std::wstring from_utf8(const std::string& value); #else /// Identity operation -IFC_PARSE_API inline std::string to_utf8(const std::string& str) { return str; } +IFC_PARSE_API inline std::string to_utf8(const std::string& value) { return value; } /// Identity operation -IFC_PARSE_API inline std::string from_utf8(const std::string& str) { return str; } +IFC_PARSE_API inline std::string from_utf8(const std::string& value) { return value; } #endif } // namespace path diff --git a/src/ifcparse/variant_array.h b/src/ifcparse/variant_array.h index b06c4af282..69c4adee45 100644 --- a/src/ifcparse/variant_array.h +++ b/src/ifcparse/variant_array.h @@ -153,9 +153,9 @@ public: return *this; } - variant_array(const variant_array&) = delete; - variant_array(const variant_array&&) = delete; - variant_array& operator= (const variant_array&) = delete; + variant_array(const variant_array& other) = delete; + variant_array(const variant_array&& other) = delete; + variant_array& operator= (const variant_array& other) = delete; template, variant_array>>> void set(std::size_t index, T&& value) { @@ -284,23 +284,27 @@ private: } } - void destroy_type_at_index(std::size_t, std::integral_constant) {} + void destroy_type_at_index(std::size_t index, std::integral_constant) { + static_cast(index); + } template - auto apply_visitor_impl(Visitor&& visitor, std::size_t idx, std::integral_constant) const { - if (size_and_indices_[idx + 1] == Index - 1) { + auto apply_visitor_impl(Visitor&& visitor, std::size_t index, std::integral_constant) const { + if (size_and_indices_[index + 1] == Index - 1) { using T = typename std::tuple_element_t>; if constexpr (::impl::is_unique_ptr::value) { - return visitor(**reinterpret_cast(&storage_[idx])); + return visitor(**reinterpret_cast(&storage_[index])); } else { - return visitor(*reinterpret_cast(&storage_[idx])); + return visitor(*reinterpret_cast(&storage_[index])); } } - return apply_visitor_impl(std::forward(visitor), idx, std::integral_constant{}); + return apply_visitor_impl(std::forward(visitor), index, std::integral_constant{}); } template - auto apply_visitor_impl(Visitor&&, std::size_t, std::integral_constant) const { + auto apply_visitor_impl(Visitor&& visitor, std::size_t index, std::integral_constant) const { + static_cast(visitor); + static_cast(index); throw std::runtime_error("Invalid variant index"); if constexpr (!std::is_void_v()(std::declval> &>()))>) { return decltype(std::declval()(std::declval> &>())){}; @@ -308,20 +312,20 @@ private: } template - const char* get_type_name_impl(size_t i) const { + const char* get_type_name_impl(size_t type_index) const { if constexpr (I == 0) { return ""; } else { - if (i == I - 1) { + if (type_index == I - 1) { return typeid(std::tuple_element_t>).name(); } else { - return get_type_name_impl(i); + return get_type_name_impl(type_index); } } } - const char* get_type_name(size_t i) const { - return get_type_name_impl(i); + const char* get_type_name(size_t type_index) const { + return get_type_name_impl(type_index); } };