Returns ID for the object depending on the used setting.
| 163 | |
| 164 | /// Returns ID for the object depending on the used setting. |
| 165 | virtual std::string object_id(const IfcGeom::Element* o) |
| 166 | { |
| 167 | if (settings_.get<ifcopenshell::geometry::settings::UseElementGuids>().get()) return o->guid(); |
| 168 | if (settings_.get<ifcopenshell::geometry::settings::UseElementNames>().get()) return o->name(); |
| 169 | if (settings_.get<ifcopenshell::geometry::settings::UseElementStepIds>().get()) return "id-" + boost::lexical_cast<std::string>(o->id()); |
| 170 | return o->unique_id(); |
| 171 | } |
| 172 | |
| 173 | protected: |
| 174 | ifcopenshell::geometry::Settings geometry_settings_; |