[TechDraw] Use templates instead of duplicate code: toGp

This commit is contained in:
Benjamin Bræstrup Sayoc
2024-10-08 00:35:25 +02:00
parent e8d466ea98
commit 9f8f6b1f56
13 changed files with 63 additions and 76 deletions

View File

@@ -327,8 +327,8 @@ TechDraw::BaseGeomPtr CenterLine::scaledAndRotatedGeometry(TechDraw::DrawViewPar
TopoDS_Edge newEdge;
if (getType() == CLTYPE::FACE ) {
gp_Pnt gp1(DU::togp_Pnt(p1));
gp_Pnt gp2(DU::togp_Pnt(p2));
gp_Pnt gp1(DU::to<gp_Pnt>(p1));
gp_Pnt gp2(DU::to<gp_Pnt>(p2));
TopoDS_Edge e = BRepBuilderAPI_MakeEdge(gp1, gp2);
// Mirror shape in Y and scale
TopoDS_Shape s = ShapeUtils::mirrorShape(e, gp_Pnt(0.0, 0.0, 0.0), scale);
@@ -337,8 +337,8 @@ TechDraw::BaseGeomPtr CenterLine::scaledAndRotatedGeometry(TechDraw::DrawViewPar
newEdge = TopoDS::Edge(s);
} else if (getType() == CLTYPE::EDGE ||
getType() == CLTYPE::VERTEX) {
gp_Pnt gp1(DU::togp_Pnt(DU::invertY(p1 * scale)));
gp_Pnt gp2(DU::togp_Pnt(DU::invertY(p2 * scale)));
gp_Pnt gp1(DU::to<gp_Pnt>(DU::invertY(p1 * scale)));
gp_Pnt gp2(DU::to<gp_Pnt>(DU::invertY(p2 * scale)));
newEdge = BRepBuilderAPI_MakeEdge(gp1, gp2);
}