Merge branch 'master' into v0.6.0

This commit is contained in:
Thomas Krijnen
2020-06-07 20:23:00 +02:00
9 changed files with 42 additions and 7 deletions
+3 -2
View File
@@ -221,7 +221,8 @@ private:
double ifc_planeangle_unit;
double modelling_precision;
double dimensionality;
double layerset_first;
#ifndef NO_CACHE
MAKE_TYPE_NAME(Cache) cache;
#endif
@@ -259,7 +260,7 @@ public:
setValue(GV_PLANEANGLE_UNIT, other.getValue(GV_PLANEANGLE_UNIT));
setValue(GV_PRECISION, other.getValue(GV_PRECISION));
setValue(GV_DIMENSIONALITY, other.getValue(GV_DIMENSIONALITY));
setValue(GV_DEFLECTION_TOLERANCE, other.getValue(GV_DEFLECTION_TOLERANCE));
setValue(GV_LAYERSET_FIRST, other.getValue(GV_LAYERSET_FIRST));
return *this;
}
+8 -3
View File
@@ -1317,6 +1317,9 @@ void IfcGeom::Kernel::setValue(GeomValue var, double value) {
case GV_MAX_FACES_TO_ORIENT:
max_faces_to_orient = value;
break;
case GV_LAYERSET_FIRST:
layerset_first = value;
break;
default:
throw std::runtime_error("Invalid setting");
}
@@ -1342,6 +1345,8 @@ double IfcGeom::Kernel::getValue(GeomValue var) const {
return dimensionality;
case GV_MAX_FACES_TO_ORIENT:
return max_faces_to_orient;
case GV_LAYERSET_FIRST:
return layerset_first;
}
throw std::runtime_error("Invalid setting");
}
@@ -1644,11 +1649,11 @@ const IfcSchema::IfcMaterial* IfcGeom::Kernel::get_single_material_association(c
IfcSchema::IfcMaterialSelect* associated_material = (*associated_materials->begin())->RelatingMaterial();
single_material = associated_material->as<IfcSchema::IfcMaterial>();
// NB: Single-layer layersets are also considered, regardless of --enable-layerset-slicing, this
// in accordance with other viewers.
// NB: IfcMaterialLayerSets are also considered, regardless of --enable-layerset-slicing. Picking
// the first material (in accordance with other viewers) when layerset-slicing is disabled.
if (!single_material && associated_material->as<IfcSchema::IfcMaterialLayerSetUsage>()) {
IfcSchema::IfcMaterialLayerSet* layerset = associated_material->as<IfcSchema::IfcMaterialLayerSetUsage>()->ForLayerSet();
if (layerset->MaterialLayers()->size() == 1) {
if (getValue(GV_LAYERSET_FIRST) > 0.0 ? layerset->MaterialLayers()->size() >= 1 : layerset->MaterialLayers()->size() == 1) {
IfcSchema::IfcMaterialLayer* layer = (*layerset->MaterialLayers()->begin());
if (layer->hasMaterial()) {
single_material = layer->Material();
@@ -971,6 +971,12 @@ namespace IfcGeom {
kernel.setValue(IfcGeom::Kernel::GV_MAX_FACES_TO_ORIENT, settings.get(IteratorSettings::SEW_SHELLS) ? std::numeric_limits<double>::infinity() : -1);
kernel.setValue(IfcGeom::Kernel::GV_DIMENSIONALITY, (settings.get(IteratorSettings::INCLUDE_CURVES)
? (settings.get(IteratorSettings::EXCLUDE_SOLIDS_AND_SURFACES) ? -1. : 0.) : +1.));
kernel.setValue(IfcGeom::Kernel::GV_LAYERSET_FIRST,
settings.get(IteratorSettings::LAYERSET_FIRST)
? +1.0
: -1.0
);
if (settings.get(IteratorSettings::BUILDING_LOCAL_PLACEMENT)) {
if (settings.get(IteratorSettings::SITE_LOCAL_PLACEMENT)) {
Logger::Message(Logger::LOG_WARNING, "building-local-placement takes precedence over site-local-placement");
+3 -1
View File
@@ -86,8 +86,10 @@ namespace IfcGeom
BUILDING_LOCAL_PLACEMENT = 1 << 16,
///
VALIDATE_QUANTITIES = 1 << 17,
/// Assigns the first layer material to the entire product
LAYERSET_FIRST = 1 << 18,
/// Number of different setting flags.
NUM_SETTINGS = 17
NUM_SETTINGS = 18
};
/// Used to store logical OR combination of setting flags.
typedef unsigned SettingField;