mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Workarounds for unstyled elements in tree and wrapper #4924
This commit is contained in:
@@ -1976,11 +1976,11 @@ namespace IfcGeom {
|
||||
TopoDS_Iterator it(compound);
|
||||
for (; it.More(); it.Next(), ++git) {
|
||||
// Assumption is that the number of styles is small, so the linear lookup time is not significant.
|
||||
auto sit = std::find(styles_.begin(), styles_.end(), git->Style());
|
||||
auto sit = std::find(styles_.begin(), styles_.end(), git->StylePtr());
|
||||
size_t index;
|
||||
if (sit == styles_.end()) {
|
||||
index = styles_.size();
|
||||
styles_.push_back(git->Style());
|
||||
styles_.push_back(git->StylePtr());
|
||||
} else {
|
||||
index = std::distance(styles_.begin(), sit);
|
||||
}
|
||||
@@ -2058,7 +2058,7 @@ namespace IfcGeom {
|
||||
enable_face_styles_ = b;
|
||||
}
|
||||
|
||||
const std::vector<ifcopenshell::geometry::taxonomy::style>& styles() const {
|
||||
const std::vector<ifcopenshell::geometry::taxonomy::style::ptr>& styles() const {
|
||||
return styles_;
|
||||
}
|
||||
|
||||
@@ -2066,7 +2066,7 @@ namespace IfcGeom {
|
||||
typedef TopTools_DataMapOfShapeInteger face_style_map_t;
|
||||
|
||||
face_style_map_t face_styles_;
|
||||
std::vector<ifcopenshell::geometry::taxonomy::style> styles_;
|
||||
std::vector<ifcopenshell::geometry::taxonomy::style::ptr> styles_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -575,13 +575,13 @@ void ifcopenshell::geometry::taxonomy::colour::print(std::ostream& o, int indent
|
||||
|
||||
void ifcopenshell::geometry::taxonomy::style::print(std::ostream& o, int indent) const {
|
||||
o << std::string(indent, ' ') << "style" << std::endl;
|
||||
o << std::string(indent, ' ') << " " << "name" << (name) << std::endl;
|
||||
o << std::string(indent, ' ') << " " << "name " << (name) << std::endl;
|
||||
if (diffuse.components_) {
|
||||
o << std::string(indent, ' ') << " " << "diffuse" << (name) << std::endl;
|
||||
o << std::string(indent, ' ') << " " << "diffuse" << std::endl;
|
||||
diffuse.print(o, indent + 5 + 7);
|
||||
}
|
||||
if (specular.components_) {
|
||||
o << std::string(indent, ' ') << " " << "specular" << (name) << std::endl;
|
||||
o << std::string(indent, ' ') << " " << "specular" << std::endl;
|
||||
specular.print(o, indent + 5 + 8);
|
||||
}
|
||||
// @todo
|
||||
|
||||
Reference in New Issue
Block a user