MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / next

Method next

src/ifcgeom/Iterator.cpp:493–533  ·  view source on GitHub ↗

Moves to the next shape representation, create its geometry, and returns the associated product. Use get() to retrieve the created geometry.

Source from the content-addressed store, hash-verified

491/// Moves to the next shape representation, create its geometry, and returns the associated product.
492/// Use get() to retrieve the created geometry.
493const IfcUtil::IfcBaseClass* IfcGeom::Iterator::next() {
494 using std::chrono::high_resolution_clock;
495 validate_iterator_state();
496
497 if (*native_task_result_iterator_ != *task_result_iterator_) {
498 delete* native_task_result_iterator_;
499 }
500 delete* task_result_iterator_;
501
502 if (num_threads_ != 1) {
503 if (!wait_for_element()) {
504 Logger::SetProduct(boost::none);
505 time_points[3] = high_resolution_clock::now();
506 log_timepoints();
507 task_result_ptr_exhausted = true;
508 return nullptr;
509 }
510
511 task_result_iterator_++;
512 native_task_result_iterator_++;
513
514 return (*task_result_iterator_)->product();
515 } else {
516 // Increment the iterator over the list of products using the current
517 // shape representation
518 if (task_result_iterator_ == --all_processed_elements_.end()) {
519 if (!create()) {
520 Logger::SetProduct(boost::none);
521 time_points[3] = high_resolution_clock::now();
522 log_timepoints();
523 task_result_ptr_exhausted = true;
524 return nullptr;
525 }
526 }
527
528 task_result_iterator_++;
529 native_task_result_iterator_++;
530
531 return (*task_result_iterator_)->product();
532 }
533}
534
535/// Gets the representation of the current geometrical entity.
536IfcGeom::Element* IfcGeom::Iterator::get()

Callers 15

add_collision_objectsMethod · 0.45
build_facet_edge_graphFunction · 0.45
newellFunction · 0.45
are_facets_coplanarFunction · 0.45
lengthMethod · 0.45
edgesMethod · 0.45
orthogonal_edge_lengthFunction · 0.45
add_fileMethod · 0.45
mainFunction · 0.45
ParseMethod · 0.45
DoImportMethod · 0.45

Calls 3

productMethod · 0.80
createFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected