Retrieve length unit info from underlying mapping in iterator #6355

This commit is contained in:
Thomas Krijnen
2025-03-20 13:57:30 +01:00
parent 4d5a3ec633
commit 58a5f881e6
3 changed files with 6 additions and 6 deletions
+4 -6
View File
@@ -150,10 +150,6 @@ namespace IfcGeom {
int done;
int total;
// @todo these appear uninitialized?
std::string unit_name_;
double unit_magnitude_;
ifcopenshell::geometry::taxonomy::point3 bounds_min_;
ifcopenshell::geometry::taxonomy::point3 bounds_max_;
@@ -166,8 +162,8 @@ namespace IfcGeom {
public:
void set_cache(GeometrySerializer* cache) { cache_ = cache; }
const std::string& unit_name() const { return unit_name_; }
double unit_magnitude() const { return unit_magnitude_; }
const std::string& unit_name() const { return converter_->mapping()->get_length_unit_name(); }
double unit_magnitude() const { return converter_->mapping()->get_length_unit(); }
// Check if error occurred during iterator initialization or iteration over elements.
bool had_error_processing_elements() const { return had_error_processing_elements_; }
@@ -903,6 +899,8 @@ namespace IfcGeom {
for (auto& p : all_processed_elements_) {
delete p;
}
delete converter_;
}
};
}
+1
View File
@@ -45,6 +45,7 @@ namespace geometry {
virtual const IfcUtil::IfcBaseEntity* get_product_type(const IfcUtil::IfcBaseEntity*) = 0;
virtual const IfcUtil::IfcBaseEntity* get_single_material_association(const IfcUtil::IfcBaseEntity*) = 0;
virtual double get_length_unit() const = 0;
virtual const std::string& get_length_unit_name() const = 0;
virtual IfcUtil::IfcBaseEntity* representation_of(const IfcUtil::IfcBaseEntity* product) = 0;
const Settings& settings() const { return settings_; }
+1
View File
@@ -86,6 +86,7 @@ namespace geometry {
virtual std::map<std::string, IfcUtil::IfcBaseEntity*> get_layers(IfcUtil::IfcBaseEntity*);
virtual void initialize_settings();
virtual double get_length_unit() const { return length_unit_; }
virtual const std::string& get_length_unit_name() const { return length_unit_name_; }
virtual aggregate_of_instance::ptr find_openings(const IfcUtil::IfcBaseEntity*);
virtual IfcUtil::IfcBaseEntity* representation_of(const IfcUtil::IfcBaseEntity* product);