mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Adding --surface-color in conversion settings to force the use of surface color instead of diffuse color. Issue #5075
This commit is contained in:
+11
-2
@@ -305,8 +305,10 @@ typedef item const* ptr;
|
||||
|
||||
std::string name;
|
||||
colour diffuse;
|
||||
colour surface;
|
||||
colour specular;
|
||||
double specularity, transparency;
|
||||
bool use_surface_color;
|
||||
|
||||
void print(std::ostream& o, int indent = 0) const;
|
||||
|
||||
@@ -321,8 +323,15 @@ typedef item const* ptr;
|
||||
// @todo equality implementation based on values?
|
||||
bool operator==(const style& other) const { return instance == other.instance; }
|
||||
|
||||
style() : specularity(std::numeric_limits<double>::quiet_NaN()), transparency(std::numeric_limits<double>::quiet_NaN()) {}
|
||||
style(const std::string& name) : name(name), specularity(std::numeric_limits<double>::quiet_NaN()), transparency(std::numeric_limits<double>::quiet_NaN()) {}
|
||||
style() : specularity(std::numeric_limits<double>::quiet_NaN()), transparency(std::numeric_limits<double>::quiet_NaN()), use_surface_color(false) {}
|
||||
style(const std::string& name) : name(name), specularity(std::numeric_limits<double>::quiet_NaN()), transparency(std::numeric_limits<double>::quiet_NaN()), use_surface_color(false) {}
|
||||
|
||||
colour get_color() const {
|
||||
if (use_surface_color && surface) {
|
||||
return surface;
|
||||
}
|
||||
return diffuse;
|
||||
}
|
||||
|
||||
bool has_specularity() const {
|
||||
return !std::isnan(specularity);
|
||||
|
||||
Reference in New Issue
Block a user