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

Method registerShape

src/ShapeFactory.cc:739–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739void ShapeClassifier::registerShape(ORIGIN org, IShapeNameAccessor* nameAccessor, const TopoDS_Shape& originalShape, const TopoDS_Shape& newShape, int counter)
740{
741
742 std::string original_name = nameAccessor->getShapeName(originalShape);
743
744 std::stringstream s;
745
746 std::string op;
747 switch (org) {
748 case GENERATED:
749 op = "g";
750 break;
751 case MODIFIED:
752 op = "m";
753 break;
754 case IDENTICAL:
755 break;
756 }
757
758 s << op;
759 bool wantSep = false;
760 if (nameAccessor->operand() >= 0) {
761 wantSep = true;
762 s << nameAccessor->operand();
763 }
764 if (wantSep) {
765 s << ":";
766 }
767 s << original_name;
768 if (counter >= 0) {
769 s << ":" << counter;
770 }
771 s << std::ends;
772
773 std::string newName = s.str();
774
775 m_processedSubShapes.Add(newShape);
776 m_nameSetter->setShapeName(newShape, newName.c_str());
777
778}
779
780class BRepAlgoAPI_BooleanOperation_Adaptor : public IShapeClassifierTool
781{

Callers

nothing calls this directly

Calls 3

getShapeNameMethod · 0.80
operandMethod · 0.80
setShapeNameMethod · 0.80

Tested by

no test coverage detected