mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Retrieve length unit info from underlying mapping in iterator #6355
This commit is contained in:
@@ -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_;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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_; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user