@@ -391,7 +391,7 @@ int main(int argc, char** argv)
391391 std::string output_extension = output_filename.substr (output_filename.size ()-4 );
392392 boost::to_lower (output_extension);
393393
394- Logger::SetOutput (&std::cout, &log_stream);
394+
395395 if (output_extension == " .xml" ) {
396396 int exit_code = 1 ;
397397 try {
@@ -412,7 +412,7 @@ int main(int argc, char** argv)
412412 return exit_code;
413413 }
414414
415- SerializerSettings settings;
415+ SerializerSettings settings;
416416 // / @todo Make APPLY_DEFAULT_MATERIALS configurable? Quickly tested setting this to false and using obj exporter caused the program to crash and burn.
417417 settings.set (IfcGeom::IteratorSettings::APPLY_DEFAULT_MATERIALS, true );
418418 settings.set (IfcGeom::IteratorSettings::USE_WORLD_COORDS, use_world_coords);
@@ -428,7 +428,6 @@ int main(int argc, char** argv)
428428 settings.set (IfcGeom::IteratorSettings::APPLY_LAYERSETS, enable_layerset_slicing);
429429 settings.set (IfcGeom::IteratorSettings::NO_NORMALS, no_normals);
430430 settings.set (IfcGeom::IteratorSettings::GENERATE_UVS, generate_uvs);
431- settings.set (IfcGeom::IteratorSettings::TRAVERSE, traverse);
432431
433432 settings.set (SerializerSettings::USE_ELEMENT_NAMES, use_element_names);
434433 settings.set (SerializerSettings::USE_ELEMENT_GUIDS, use_element_guids);
@@ -483,34 +482,16 @@ int main(int argc, char** argv)
483482
484483 IfcGeom::Iterator<real_t > context_iterator (settings, input_filename);
485484
486- try {
487- if (include_entities) {
488- context_iterator.includeEntities (entities);
489- } else {
490- context_iterator.excludeEntities (entities);
491- }
492- } catch (const IfcParse::IfcException& e) {
493- std::cout << " [Error] " << e.what () << std::endl;
494- return 1 ;
495- }
496-
497- if (include_names) {
498- context_iterator.include_entity_names (names);
499- } else {
500- context_iterator.exclude_entity_names (names);
501- }
502-
503- if (include_guids) {
504- context_iterator.include_entity_guids (guids);
505- } else {
506- context_iterator.exclude_entity_guids (guids);
485+ try {
486+ context_iterator.filter_entities (include_entities, entities, traverse);
487+ } catch (const IfcParse::IfcException& e) {
488+ std::cout << " [Error] " << e.what () << std::endl;
489+ return 1 ;
507490 }
508491
509- if (include_layers) {
510- context_iterator.include_layer_names (layers);
511- } else {
512- context_iterator.exclude_layer_names (layers);
513- }
492+ context_iterator.filter_entity_names (include_names, names, traverse);
493+ context_iterator.filter_entity_guids (include_guids, guids, traverse);
494+ context_iterator.filter_layer_names (include_layers, layers, traverse);
514495
515496 if (!serializer->ready ()) {
516497 write_log ();
@@ -570,7 +551,7 @@ int main(int argc, char** argv)
570551 // geometrical entities are available. None of these functions throw
571552 // exceptions, neither for parsing errors or geometrical errors. Upon
572553 // calling next() the entity to be returned has already been processed, a
573- // true return value guarantees that a successfully processed product is
554+ // non-null return value guarantees that a successfully processed product is
574555 // available.
575556 size_t num_created = 0 ;
576557
0 commit comments