| 674 | } |
| 675 | |
| 676 | void ShapeClassifier::_classifyRemainingSubShape(TopAbs_ShapeEnum shapeType) |
| 677 | { |
| 678 | TopTools_IndexedMapOfShape oldShapeMap1; |
| 679 | TopExp::MapShapes(m_nameAccessor1->shape(), shapeType, oldShapeMap1); |
| 680 | TopTools_IndexedMapOfShape oldShapeMap2; |
| 681 | if (m_nameAccessor2) { |
| 682 | TopExp::MapShapes(m_nameAccessor2->shape(), shapeType, oldShapeMap2); |
| 683 | } |
| 684 | |
| 685 | TopTools_IndexedMapOfShape map; |
| 686 | TopExp::MapShapes(m_newShape, shapeType, map); |
| 687 | for (int i = 0; i < map.Extent(); i++) { |
| 688 | const TopoDS_Shape& current = map.FindKey(i + 1); |
| 689 | |
| 690 | if (this->m_processedSubShapes.Contains(current)) { |
| 691 | continue; // already processed |
| 692 | } |
| 693 | if (this->m_tool->getDeleted(current)) { |
| 694 | continue; |
| 695 | } |
| 696 | if (oldShapeMap1.Contains(current)) { |
| 697 | // reuse name of old shape |
| 698 | registerShape(IDENTICAL, m_nameAccessor1, current, current, -1); |
| 699 | } |
| 700 | else if (oldShapeMap2.Contains(current)) { |
| 701 | // reuse name of old shape |
| 702 | registerShape(IDENTICAL, m_nameAccessor2, current, current, -1); |
| 703 | } |
| 704 | else { |
| 705 | // provide a default name based on hashCode |
| 706 | std::stringstream s; |
| 707 | s << shapeType << "tmp" << current.HashCode(std::numeric_limits<int>::max()); |
| 708 | s << std::ends; |
| 709 | m_nameSetter->setShapeName(current, s.str().c_str()); |
| 710 | } |
| 711 | } |
| 712 | } |
| 713 | void ShapeClassifier::classify() |
| 714 | { |
| 715 | _classify(m_nameAccessor1, TopAbs_FACE); |
nothing calls this directly
no test coverage detected