From c51c5651b222b51e402e7e5f8a14fb10fda40fa2 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 18 Dec 2021 16:16:44 +0100 Subject: [PATCH] Small changes to iterator settings --- src/ifcconvert/IfcConvert.cpp | 2 +- src/ifcgeom/IfcGeomIteratorImplementation.h | 2 +- src/ifcgeom/IfcGeomIteratorSettings.h | 36 ++++++++++++++------- src/serializers/HdfSerializer.cpp | 2 +- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index c4790253f9..a8765b06ea 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -796,7 +796,7 @@ int main(int argc, char** argv) { settings.set(IfcGeom::IteratorSettings::NO_NORMALS, no_normals); settings.set(IfcGeom::IteratorSettings::GENERATE_UVS, generate_uvs); settings.set(IfcGeom::IteratorSettings::EDGE_ARROWS, edge_arrows); - settings.set(IfcGeom::IteratorSettings::SEARCH_FLOOR, use_element_hierarchy || output_extension == SVG); + settings.set(IfcGeom::IteratorSettings::ELEMENT_HIERARCHY, use_element_hierarchy || output_extension == SVG); settings.set(IfcGeom::IteratorSettings::SITE_LOCAL_PLACEMENT, site_local_placement); settings.set(IfcGeom::IteratorSettings::BUILDING_LOCAL_PLACEMENT, building_local_placement); settings.set(IfcGeom::IteratorSettings::VALIDATE_QUANTITIES, validate); diff --git a/src/ifcgeom/IfcGeomIteratorImplementation.h b/src/ifcgeom/IfcGeomIteratorImplementation.h index 6e06cc275c..cf11b2274f 100644 --- a/src/ifcgeom/IfcGeomIteratorImplementation.h +++ b/src/ifcgeom/IfcGeomIteratorImplementation.h @@ -956,7 +956,7 @@ namespace IfcGeom { } // If we want to organize the element considering their hierarchy - if (settings.get(IteratorSettings::SEARCH_FLOOR)) + if (settings.get(IteratorSettings::ELEMENT_HIERARCHY)) { // We are going to build a vector with the element parents. // First, create the parent vector diff --git a/src/ifcgeom/IfcGeomIteratorSettings.h b/src/ifcgeom/IfcGeomIteratorSettings.h index a1469d4143..c60c6539af 100644 --- a/src/ifcgeom/IfcGeomIteratorSettings.h +++ b/src/ifcgeom/IfcGeomIteratorSettings.h @@ -62,7 +62,8 @@ namespace IfcGeom /// Disables the triangulation of the topological representations. Useful if /// the client application understands Open Cascade's native format. DISABLE_TRIANGULATION = 1 << 6, - /// Applies default materials to entity instances without a surface style. + /// Applies default materials to entity instances without a surface style or + /// product-level material association. APPLY_DEFAULT_MATERIALS = 1 << 7, /// Specifies whether to include subtypes of IfcCurve. INCLUDE_CURVES = 1 << 8, @@ -75,27 +76,40 @@ namespace IfcGeom /// Generates UVs by using simple box projection. Requires normals. /// Applicable for OBJ and DAE output. GENERATE_UVS = 1 << 11, - /// Specifies whether to slice representations according to associated IfcLayerSets. + /// Specifies whether to slice representations according to associated + /// IfcMaterialLayerSets. APPLY_LAYERSETS = 1 << 12, - /// Search for a parent of type IfcBuildingStorey for each representation - SEARCH_FLOOR = 1 << 13, - /// + /// Emit the relative placements from IFC instead of a flat listing of + /// absolute placements. + ELEMENT_HIERARCHY = 1 << 13, + /// Emit placements relative to the IfcSite. Useful if the IfcSite itself + /// introduces a placement with a large geospatial offset that inhibits + /// rendering. SITE_LOCAL_PLACEMENT = 1 << 14, - /// + /// Emit placements relative to the IfcBuilding. Useful if the IfcBuilding + /// itself introduces a placement with a large geospatial offset that + /// inhibits rendering. BUILDING_LOCAL_PLACEMENT = 1 << 15, - /// + /// After geometry interpretation, lookup an IfcOpenShell-specific quantity set + /// and compare values for validation. VALIDATE_QUANTITIES = 1 << 16, /// Assigns the first layer material to the entire product LAYERSET_FIRST = 1 << 17, - /// Adds arrow heads to edge segments to signify edge direction + /// Adds arrow heads to edge segments to signify edge direction. Useful as a + /// debugging mechanism for face orientation or advanced brep IfcOrientedEdge. EDGE_ARROWS = 1 << 18, /// Disables the evaluation of IfcBooleanResult and simply returns FirstOperand DISABLE_BOOLEAN_RESULT = 1 << 19, - // Disables wire intersection checks + /// Disables wire intersection checks. These checks are done on faces to prevent + /// self-intersections of face bounds. Self-intersections reduce the reliability + /// of boolean operations and may lead to crashes. NO_WIRE_INTERSECTION_CHECK = 1 << 20, - // Set wire intersection tolerance to 0 + /// Set wire intersection tolerance to 0. By default the above check is done + /// using a tolerance criterium. So that when a vertex is a certain epsilon + /// distance away from an edge this is flagged as an intersection. NO_WIRE_INTERSECTION_TOLERANCE = 1 << 21, - // Sets kernel precision factor to 1 + /// Strictly use the tolerance from the IFC model. Typically this value is + /// increased 10-fold to have more reliable boolean subtraction results. STRICT_TOLERANCE = 1 << 22, /// Number of different setting flags. NUM_SETTINGS = 23, diff --git a/src/serializers/HdfSerializer.cpp b/src/serializers/HdfSerializer.cpp index 6dfdcae054..44798f1c74 100644 --- a/src/serializers/HdfSerializer.cpp +++ b/src/serializers/HdfSerializer.cpp @@ -325,7 +325,7 @@ IfcGeom::Element* HdfSerializer::read(IfcParse::IfcFile& f, const std::string& g IfcGeom::IteratorSettings::WELD_VERTICES | IfcGeom::IteratorSettings::NO_NORMALS | IfcGeom::IteratorSettings::GENERATE_UVS | IfcGeom::IteratorSettings::EDGE_ARROWS | // Is applied in the serializer - IfcGeom::IteratorSettings::SEARCH_FLOOR; + IfcGeom::IteratorSettings::ELEMENT_HIERARCHY; auto stored_settings = read_scalar_attribute(brepDataset, "settings"); auto requested_settings = settings_.get_raw();