static */ get TopoDS_Face(iface) from DVP TODO: DVP can serve these up ready to use
| 535 | //! get TopoDS_Face(iface) from DVP |
| 536 | //! TODO: DVP can serve these up ready to use |
| 537 | TopoDS_Face DrawGeomHatch::extractFace(DrawViewPart* source, int iface ) |
| 538 | { |
| 539 | std::vector<TopoDS_Wire> faceWires = source->getWireForFace(iface); |
| 540 | |
| 541 | //build face(s) from geometry |
| 542 | gp_Pnt gOrg(0.0, 0.0, 0.0); |
| 543 | gp_Dir gDir(0.0, 0.0, 1.0); |
| 544 | gp_Pln plane(gOrg, gDir); |
| 545 | |
| 546 | BRepBuilderAPI_MakeFace mkFace(plane, faceWires.front(), true); |
| 547 | std::vector<TopoDS_Wire>::iterator itWire = ++faceWires.begin(); //starting with second wire |
| 548 | for (; itWire != faceWires.end(); itWire++) { |
| 549 | mkFace.Add(*itWire); |
| 550 | } |
| 551 | if (!mkFace.IsDone()) { |
| 552 | return TopoDS_Face(); |
| 553 | } |
| 554 | TopoDS_Face face = mkFace.Face(); |
| 555 | |
| 556 | TopoDS_Shape temp; |
| 557 | try { |
| 558 | // mirror about the Y axis |
| 559 | gp_Trsf mirrorTransform; |
| 560 | mirrorTransform.SetMirror( gp_Ax2(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0, 1, 0)) ); |
| 561 | BRepBuilderAPI_Transform mkTrf(face, mirrorTransform); |
| 562 | temp = mkTrf.Shape(); |
| 563 | } |
| 564 | catch (...) { |
| 565 | return TopoDS_Face(); |
| 566 | } |
| 567 | return TopoDS::Face(temp); |
| 568 | } |
| 569 | |
| 570 | //! get a translated label string from the context (ex TaskActiveView), the base name (ex ActiveView) and |
| 571 | //! the unique name within the document (ex ActiveView001), and use it to update the Label property. |
nothing calls this directly
no test coverage detected