MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / _classify

Method _classify

src/ShapeFactory.cc:631–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629
630
631void ShapeClassifier::_classify(IShapeNameAccessor* obj, TopAbs_ShapeEnum shapeType)
632{
633 TopTools_IndexedMapOfShape newShapeMap;
634 TopExp::MapShapes(this->m_newShape, shapeType, newShapeMap);
635
636 TopTools_IndexedMapOfShape map;
637 TopExp::MapShapes(obj->shape(), shapeType, map);
638
639 for (int i = 0; i < map.Extent(); i++) {
640 const TopoDS_Shape& current = map.FindKey(i + 1);
641
642 int counterG = 0;
643 int counterM = 0;
644 const TopTools_ListOfShape& generatedShapes = m_tool->getGenerated(current);
645 {
646 TopTools_ListIteratorOfListOfShape it(generatedShapes);
647 for (; it.More(); it.Next()) {
648 TopoDS_Shape& newShape = it.Value();
649 if (!newShapeMap.Contains(newShape)) { continue; }
650 if (this->m_processedSubShapes.Contains(newShape)) {
651 continue; // already processed
652 }
653 registerShape(GENERATED, obj, current, newShape, counterG++);
654 }
655 }
656 const TopTools_ListOfShape& modifiedShapes = m_tool->getModified(current);
657 {
658 TopTools_ListIteratorOfListOfShape it(modifiedShapes);
659 for (; it.More(); it.Next()) {
660 TopoDS_Shape& newShape = it.Value();
661 if (!newShapeMap.Contains(newShape)) { continue; }
662 if (this->m_processedSubShapes.Contains(newShape)) {
663 continue; // already processed
664 }
665 registerShape(MODIFIED, obj, current, newShape, counterM++);
666 }
667 }
668 if ((counterG + counterM == 0) && !m_tool->getDeleted(current)) {
669 if (!newShapeMap.Contains(current)) { continue; }
670 registerShape(IDENTICAL, obj, current, current, -1);
671 }
672 }
673
674}
675
676void ShapeClassifier::_classifyRemainingSubShape(TopAbs_ShapeEnum shapeType)
677{

Callers

nothing calls this directly

Calls 1

getDeletedMethod · 0.45

Tested by

no test coverage detected