Format obj and dae output predictably based on rfc notation of GlobalId. As discussed in https://sourceforge.net/p/ifcopenshell/discussion/1782717/thread/cbb0c8ca/

This commit is contained in:
Thomas Krijnen
2015-05-13 14:30:21 +00:00
parent b37a684eb9
commit 9bf9f82b3b
15 changed files with 176 additions and 115 deletions
+6 -3
View File
@@ -57,17 +57,20 @@ namespace IfcGeom {
boost::optional<double> specularity;
public:
SurfaceStyle() {
this->name = "IfcSurfaceStyleShading";
this->name = "surface-style";
}
SurfaceStyle(int id) : id(id) {
std::stringstream sstr;
sstr << "IfcSurfaceStyleShading_" << id;
sstr << "surface-style-" << id;
this->name = sstr.str();
}
SurfaceStyle(const std::string& name) : name(name) {}
SurfaceStyle(int id, const std::string& name) : id(id) {
std::stringstream sstr;
sstr << id << "_" << name;
std::string sanitized = name;
std::transform(sanitized.begin(), sanitized.end(), sanitized.begin(), ::tolower);
std::replace(sanitized.begin(), sanitized.end(), ' ', '-');
sstr << "surface-style-" << id << "-" << sanitized;
this->name = sstr.str();
}