layerset-first setting

This commit is contained in:
Thomas Krijnen
2020-06-07 19:46:10 +02:00
parent 9f2443e01c
commit 86d7205760
6 changed files with 30 additions and 4 deletions
+4 -2
View File
@@ -108,6 +108,7 @@ private:
double ifc_planeangle_unit;
double modelling_precision;
double dimensionality;
double layerset_first;
#ifndef NO_CACHE
Cache cache;
@@ -146,7 +147,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;
}
@@ -181,7 +182,8 @@ public:
// Default: 0.00001 (obtained from IfcGeometricRepresentationContext if available)
GV_PRECISION,
// Whether to process shapes of type Face or higher (1) Wire or lower (-1) or all (0)
GV_DIMENSIONALITY
GV_DIMENSIONALITY,
GV_LAYERSET_FIRST
};
bool convert_wire_to_face(const TopoDS_Wire& wire, TopoDS_Face& face);
+7 -1
View File
@@ -1084,6 +1084,9 @@ void IfcGeom::Kernel::setValue(GeomValue var, double value) {
case GV_DIMENSIONALITY:
dimensionality = value;
break;
case GV_LAYERSET_FIRST:
layerset_first = value;
break;
default:
assert(!"never reach here");
}
@@ -1115,6 +1118,9 @@ double IfcGeom::Kernel::getValue(GeomValue var) const {
case GV_DIMENSIONALITY:
return dimensionality;
break;
case GV_LAYERSET_FIRST:
return layerset_first;
break;
}
assert(!"never reach here");
return 0;
@@ -1422,7 +1428,7 @@ const IfcSchema::IfcMaterial* IfcGeom::Kernel::get_single_material_association(c
// 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();
+6
View File
@@ -712,6 +712,12 @@ namespace IfcGeom {
kernel.setValue(IfcGeom::Kernel::GV_MAX_FACES_TO_SEW, settings.get(IteratorSettings::SEW_SHELLS) ? 1000 : -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
@@ -84,8 +84,10 @@ namespace IfcGeom
SITE_LOCAL_PLACEMENT = 1 << 15,
///
BUILDING_LOCAL_PLACEMENT = 1 << 16,
/// Assigns the first layer material to the entire product
LAYERSET_FIRST = 1 << 17,
/// Number of different setting flags.
NUM_SETTINGS = 16
NUM_SETTINGS = 17
};
/// Used to store logical OR combination of setting flags.
typedef unsigned SettingField;