--force-space-transparency option in IfcConvert

This commit is contained in:
Thomas Krijnen
2020-09-27 10:43:11 +02:00
parent 44306b036d
commit f489487a20
2 changed files with 13 additions and 2 deletions
+7 -1
View File
@@ -197,7 +197,7 @@ int main(int argc, char** argv) {
typedef char char_t; typedef char char_t;
#endif #endif
double deflection_tolerance, angular_tolerance; double deflection_tolerance, angular_tolerance, force_space_transparency;
inclusion_filter include_filter; inclusion_filter include_filter;
inclusion_traverse_filter include_traverse_filter; inclusion_traverse_filter include_traverse_filter;
exclusion_filter exclude_filter; exclusion_filter exclude_filter;
@@ -326,6 +326,8 @@ int main(int argc, char** argv) {
"model in other modelling application in any case.") "model in other modelling application in any case.")
("deflection-tolerance", po::value<double>(&deflection_tolerance)->default_value(1e-3), ("deflection-tolerance", po::value<double>(&deflection_tolerance)->default_value(1e-3),
"Sets the deflection tolerance of the mesher, 1e-3 by default if not specified.") "Sets the deflection tolerance of the mesher, 1e-3 by default if not specified.")
("force-space-transparency", po::value<double>(&force_space_transparency),
"Overrides transparency of spaces in geometry output.")
("angular-tolerance", po::value<double>(&angular_tolerance)->default_value(0.5), ("angular-tolerance", po::value<double>(&angular_tolerance)->default_value(0.5),
"Sets the angular tolerance of the mesher in radians 0.5 by default if not specified.") "Sets the angular tolerance of the mesher in radians 0.5 by default if not specified.")
("generate-uvs", ("generate-uvs",
@@ -718,6 +720,10 @@ int main(int argc, char** argv) {
settings.set_angular_tolerance(angular_tolerance); settings.set_angular_tolerance(angular_tolerance);
settings.precision = precision; settings.precision = precision;
if (vmap.count("force-space-transparency")) {
settings.force_space_transparency(force_space_transparency);
}
boost::shared_ptr<GeometrySerializer> serializer; /**< @todo use std::unique_ptr when possible */ boost::shared_ptr<GeometrySerializer> serializer; /**< @todo use std::unique_ptr when possible */
if (output_extension == OBJ) { if (output_extension == OBJ) {
// Do not use temp file for MTL as it's such a small file. // Do not use temp file for MTL as it's such a small file.
+6 -1
View File
@@ -108,6 +108,7 @@ namespace IfcGeom
/// Note that this is independent of the IFC length unit, one millimeter by default. /// Note that this is independent of the IFC length unit, one millimeter by default.
double deflection_tolerance() const { return deflection_tolerance_; } double deflection_tolerance() const { return deflection_tolerance_; }
double angular_tolerance() const { return angular_tolerance_; } double angular_tolerance() const { return angular_tolerance_; }
double force_space_transparency() const { return force_space_transparency_; }
void set_deflection_tolerance(double value) void set_deflection_tolerance(double value)
{ {
@@ -124,6 +125,10 @@ namespace IfcGeom
angular_tolerance_ = value; angular_tolerance_ = value;
} }
void force_space_transparency(double value) {
force_space_transparency_ = value;
}
/// Get boolean value for a single settings or for a combination of settings. /// Get boolean value for a single settings or for a combination of settings.
bool get(SettingField setting) const bool get(SettingField setting) const
{ {
@@ -149,7 +154,7 @@ namespace IfcGeom
protected: protected:
SettingField settings_; SettingField settings_;
double deflection_tolerance_, angular_tolerance_; double deflection_tolerance_, angular_tolerance_, force_space_transparency_;
}; };
class IFC_GEOM_API ElementSettings : public IteratorSettings class IFC_GEOM_API ElementSettings : public IteratorSettings