diff --git a/src/Mod/TechDraw/App/CenterLine.cpp b/src/Mod/TechDraw/App/CenterLine.cpp index 21a39e2b9b..9c1363f57a 100644 --- a/src/Mod/TechDraw/App/CenterLine.cpp +++ b/src/Mod/TechDraw/App/CenterLine.cpp @@ -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(p1)); + gp_Pnt gp2(DU::to(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(DU::invertY(p1 * scale))); + gp_Pnt gp2(DU::to(DU::invertY(p2 * scale))); newEdge = BRepBuilderAPI_MakeEdge(gp1, gp2); } diff --git a/src/Mod/TechDraw/App/Cosmetic.cpp b/src/Mod/TechDraw/App/Cosmetic.cpp index 6dc50ec5c9..923190c74f 100644 --- a/src/Mod/TechDraw/App/Cosmetic.cpp +++ b/src/Mod/TechDraw/App/Cosmetic.cpp @@ -171,8 +171,8 @@ TechDraw::BaseGeomPtr CosmeticEdge::makeCanonicalLine(DrawViewPart* dvp, Base::V { Base::Vector3d cStart = CosmeticVertex::makeCanonicalPoint(dvp, start); Base::Vector3d cEnd = CosmeticVertex::makeCanonicalPoint(dvp, end); - gp_Pnt gStart = DU::togp_Pnt(cStart); - gp_Pnt gEnd = DU::togp_Pnt(cEnd); + gp_Pnt gStart = DU::to(cStart); + gp_Pnt gEnd = DU::to(cEnd); TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(gStart, gEnd); return TechDraw::BaseGeom::baseFactory(edge); } @@ -180,8 +180,8 @@ TechDraw::BaseGeomPtr CosmeticEdge::makeCanonicalLine(DrawViewPart* dvp, Base::V //! makes an unscaled, unrotated line from two canonical points. TechDraw::BaseGeomPtr CosmeticEdge::makeLineFromCanonicalPoints(Base::Vector3d start, Base::Vector3d end) { - gp_Pnt gStart = DU::togp_Pnt(start); - gp_Pnt gEnd = DU::togp_Pnt(end); + gp_Pnt gStart = DU::to(start); + gp_Pnt gEnd = DU::to(end); TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(gStart, gEnd); return TechDraw::BaseGeom::baseFactory(edge); } diff --git a/src/Mod/TechDraw/App/DimensionGeometry.cpp b/src/Mod/TechDraw/App/DimensionGeometry.cpp index 9483443e4c..44815cd992 100644 --- a/src/Mod/TechDraw/App/DimensionGeometry.cpp +++ b/src/Mod/TechDraw/App/DimensionGeometry.cpp @@ -97,9 +97,9 @@ void pointPair::mapToPage(const DrawViewPart* dvp) gp_Ax3 OXYZ; xOXYZ.SetTransformation(OXYZ, gp_Ax3(dvp->getRotatedCS())); - gp_Vec gvFirst = DU::togp_Vec(m_first).Transformed(xOXYZ); + gp_Vec gvFirst = DU::to(m_first).Transformed(xOXYZ); m_first = DU::toVector3d(gvFirst); - gp_Vec gvSecond = DU::togp_Vec(m_second).Transformed(xOXYZ); + gp_Vec gvSecond = DU::to(m_second).Transformed(xOXYZ); m_second = DU::toVector3d(gvSecond); } @@ -194,7 +194,7 @@ void anglePoints::mapToPage(const DrawViewPart* dvp) gp_Trsf xOXYZ; gp_Ax3 OXYZ; xOXYZ.SetTransformation(OXYZ, gp_Ax3(dvp->getRotatedCS())); - gp_Vec gvVertex = DU::togp_Vec(m_vertex).Transformed(xOXYZ); + gp_Vec gvVertex = DU::to(m_vertex).Transformed(xOXYZ); m_vertex = DU::toVector3d(gvVertex); } @@ -291,17 +291,17 @@ void arcPoints::mapToPage(const DrawViewPart* dvp) gp_Ax3 OXYZ; xOXYZ.SetTransformation(OXYZ, gp_Ax3(dvp->getRotatedCS())); - gp_Vec gvCenter = DU::togp_Vec(center).Transformed(xOXYZ); + gp_Vec gvCenter = DU::to(center).Transformed(xOXYZ); center = DU::toVector3d(gvCenter); - gp_Vec gvOnCurve1 = DU::togp_Vec(onCurve.first()).Transformed(xOXYZ); + gp_Vec gvOnCurve1 = DU::to(onCurve.first()).Transformed(xOXYZ); onCurve.first(DU::toVector3d(gvOnCurve1)); - gp_Vec gvOnCurve2 = DU::togp_Vec(onCurve.second()).Transformed(xOXYZ); + gp_Vec gvOnCurve2 = DU::to(onCurve.second()).Transformed(xOXYZ); onCurve.second(DU::toVector3d(gvOnCurve2)); - gp_Vec gvArcEnds1 = DU::togp_Vec(arcEnds.first()).Transformed(xOXYZ); + gp_Vec gvArcEnds1 = DU::to(arcEnds.first()).Transformed(xOXYZ); arcEnds.first(DU::toVector3d(gvArcEnds1)); - gp_Vec gvArcEnds2 = DU::togp_Vec(arcEnds.second()).Transformed(xOXYZ); + gp_Vec gvArcEnds2 = DU::to(arcEnds.second()).Transformed(xOXYZ); arcEnds.second(DU::toVector3d(gvArcEnds2)); - gp_Vec gvMidArc = DU::togp_Vec(midArc).Transformed(xOXYZ); + gp_Vec gvMidArc = DU::to(midArc).Transformed(xOXYZ); midArc = DU::toVector3d(gvMidArc); } diff --git a/src/Mod/TechDraw/App/DrawBrokenView.cpp b/src/Mod/TechDraw/App/DrawBrokenView.cpp index 840bfdf4b8..e43f4c0a23 100644 --- a/src/Mod/TechDraw/App/DrawBrokenView.cpp +++ b/src/Mod/TechDraw/App/DrawBrokenView.cpp @@ -336,12 +336,12 @@ TopoDS_Shape DrawBrokenView::makeHalfSpace(Base::Vector3d planePoint, Base::Vect // DU::formatVector(planePoint).c_str(), // DU::formatVector(planeNormal).c_str(), // DU::formatVector(pointInSpace).c_str()); - gp_Pnt origin = DU::togp_Pnt(planePoint); - gp_Dir axis = DU::togp_Dir(planeNormal); + gp_Pnt origin = DU::to(planePoint); + gp_Dir axis = DU::to(planeNormal); gp_Pln plane(origin, axis); BRepBuilderAPI_MakeFace mkFace(plane); TopoDS_Face face = mkFace.Face(); - BRepPrimAPI_MakeHalfSpace mkHalf(face, DU::togp_Pnt(pointInSpace)); + BRepPrimAPI_MakeHalfSpace mkHalf(face, DU::to(pointInSpace)); return mkHalf.Solid(); } @@ -966,7 +966,7 @@ Base::Vector3d DrawBrokenView::mapPoint2dFromView(Base::Vector3d point2d) const gp_Ax3 projCS3(getProjectionCS(getCompressedCentroid())); gp_Trsf xTo3d; xTo3d.SetTransformation(projCS3, OXYZ); - auto pseudo3d = DU::toVector3d(DU::togp_Pnt(point2d).Transformed(xTo3d)); + auto pseudo3d = DU::toVector3d(DU::to(point2d).Transformed(xTo3d)); // now shift down and left auto breaksAll = Breaks.getValues(); @@ -1246,7 +1246,7 @@ Base::Vector3d DrawBrokenView::getCompressedCentroid() const //! construct a perpendicular direction in the projection CS Base::Vector3d DrawBrokenView::makePerpendicular(Base::Vector3d inDir) const { - gp_Dir gDir = DU::togp_Dir(inDir); + gp_Dir gDir = DU::to(inDir); gp_Pnt origin(0.0, 0.0, 0.0); auto dir = getProjectionCS().Direction(); gp_Ax1 axis(origin, dir); diff --git a/src/Mod/TechDraw/App/DrawComplexSection.cpp b/src/Mod/TechDraw/App/DrawComplexSection.cpp index adcf0f3baa..b7221afa03 100644 --- a/src/Mod/TechDraw/App/DrawComplexSection.cpp +++ b/src/Mod/TechDraw/App/DrawComplexSection.cpp @@ -796,7 +796,7 @@ std::pair DrawComplexSection::sectionArrowDirs() } gp_Vec gProfileVector = makeProfileVector(profileWire); - gp_Vec gSectionNormal = gp_Vec(DU::togp_Dir(SectionNormal.getValue())); + gp_Vec gSectionNormal = gp_Vec(DU::to(SectionNormal.getValue())); gp_Vec gExtrudeVector = (gSectionNormal.Crossed(gProfileVector)).Normalized(); Base::Vector3d vClosestBasis = DrawUtil::closestBasis(gp_Dir(gExtrudeVector), getSectionCS()); gp_Dir gExtrudeDir = gp_Dir(vClosestBasis.x, vClosestBasis.y, vClosestBasis.z); diff --git a/src/Mod/TechDraw/App/DrawGeomHatch.cpp b/src/Mod/TechDraw/App/DrawGeomHatch.cpp index fe7ffdd696..6bc73810ca 100644 --- a/src/Mod/TechDraw/App/DrawGeomHatch.cpp +++ b/src/Mod/TechDraw/App/DrawGeomHatch.cpp @@ -340,7 +340,7 @@ std::vector DrawGeomHatch::getTrimmedLines(DrawViewPart* source, grid = mkTransRotate.Shape(); } gp_Trsf xGridTranslate; - xGridTranslate.SetTranslation(DrawUtil::togp_Vec(hatchOffset)); + xGridTranslate.SetTranslation(DrawUtil::to(hatchOffset)); BRepBuilderAPI_Transform mkTransTranslate(grid, xGridTranslate, true); grid = mkTransTranslate.Shape(); diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index baabb9237c..3c3c84cec1 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -485,7 +485,8 @@ Base::Vector3d DrawUtil::vertex2Vector(const TopoDS_Vertex& v) return Base::Vector3d(gp.X(), gp.Y(), gp.Z()); } -//TODO: make formatVector using toVector3d +// template specialization +//template <> // GCC BUG 85282, wanting this to be outside class body std::string DrawUtil::formatVector(const Base::Vector3d& v) { std::stringstream builder; @@ -493,53 +494,7 @@ std::string DrawUtil::formatVector(const Base::Vector3d& v) builder << " (" << v.x << ", " << v.y << ", " << v.z << ") "; return builder.str(); } - -std::string DrawUtil::formatVector(const gp_Dir& v) -{ - std::stringstream builder; - builder << std::fixed << std::setprecision(Base::UnitsApi::getDecimals()); - builder << " (" << v.X() << ", " << v.Y() << ", " << v.Z() << ") "; - return builder.str(); -} - -std::string DrawUtil::formatVector(const gp_Dir2d& v) -{ - std::stringstream builder; - builder << std::fixed << std::setprecision(Base::UnitsApi::getDecimals()); - builder << " (" << v.X() << ", " << v.Y() << ") "; - return builder.str(); -} -std::string DrawUtil::formatVector(const gp_Vec& v) -{ - std::stringstream builder; - builder << std::fixed << std::setprecision(Base::UnitsApi::getDecimals()); - builder << " (" << v.X() << ", " << v.Y() << ", " << v.Z() << ") "; - return builder.str(); -} - -std::string DrawUtil::formatVector(const gp_Pnt& v) -{ - std::stringstream builder; - builder << std::fixed << std::setprecision(Base::UnitsApi::getDecimals()); - builder << " (" << v.X() << ", " << v.Y() << ", " << v.Z() << ") "; - return builder.str(); -} - -std::string DrawUtil::formatVector(const gp_Pnt2d& v) -{ - std::stringstream builder; - builder << std::fixed << std::setprecision(Base::UnitsApi::getDecimals()); - builder << " (" << v.X() << ", " << v.Y() << ") "; - return builder.str(); -} - -std::string DrawUtil::formatVector(const QPointF& v) -{ - std::stringstream builder; - builder << std::fixed << std::setprecision(Base::UnitsApi::getDecimals()); - builder << " (" << v.x() << ", " << v.y() << ") "; - return builder.str(); -} +//template std::string DrawUtil::formatVector(const Base::Vector3d &v); //! compare 2 vectors for sorting - true if v1 < v2 //! precision::Confusion() is too strict for vertex - vertex comparisons @@ -669,7 +624,7 @@ Base::Vector3d DrawUtil::vecRotate(Base::Vector3d vec, double angle, Base::Vecto gp_Vec DrawUtil::closestBasis(gp_Vec inVec) { - return gp_Vec(togp_Dir(closestBasis(toVector3d(inVec)))); + return gp_Vec(to(closestBasis(toVector3d(inVec)))); } //! returns stdX, stdY or stdZ. @@ -909,7 +864,7 @@ gp_Vec DrawUtil::maskDirection(gp_Vec inVec, gp_Dir directionToMask) Base::Vector3d DrawUtil::maskDirection(Base::Vector3d inVec, Base::Vector3d directionToMask) { - return toVector3d(maskDirection(togp_Vec(inVec), togp_Vec(directionToMask))); + return toVector3d(maskDirection(to(inVec), to(directionToMask))); } //! get the coordinate of inPoint for the cardinal unit direction. diff --git a/src/Mod/TechDraw/App/DrawUtil.h b/src/Mod/TechDraw/App/DrawUtil.h index bea3539b95..1209f0bd3a 100644 --- a/src/Mod/TechDraw/App/DrawUtil.h +++ b/src/Mod/TechDraw/App/DrawUtil.h @@ -116,13 +116,12 @@ public: static Base::Vector3d vertex2Vector(const TopoDS_Vertex& v); + template + static std::string formatVector(const T& v) + { + return formatVector(toVector3d(v)); + } static std::string formatVector(const Base::Vector3d& v); - static std::string formatVector(const gp_Dir& v); - static std::string formatVector(const gp_Dir2d& v); - static std::string formatVector(const gp_Vec& v); - static std::string formatVector(const gp_Pnt& v); - static std::string formatVector(const gp_Pnt2d& v); - static std::string formatVector(const QPointF& v); static bool vectorLess(const Base::Vector3d& v1, const Base::Vector3d& v2); //!std::map require comparator to be a type not a function @@ -169,36 +168,27 @@ public: static Base::Vector2d Intersect2d(Base::Vector2d p1, Base::Vector2d d1, Base::Vector2d p2, Base::Vector2d d2); - static Base::Vector3d toVector3d(const gp_Pnt gp) + + template + static Base::Vector3d toVector3d(const T& v) { - return Base::Vector3d(gp.X(), gp.Y(), gp.Z()); - } - static Base::Vector3d toVector3d(const gp_Dir gp) - { - return Base::Vector3d(gp.X(), gp.Y(), gp.Z()); - } - static Base::Vector3d toVector3d(const gp_Vec gp) - { - return Base::Vector3d(gp.X(), gp.Y(), gp.Z()); - } - static Base::Vector3d toVector3d(const QPointF gp) - { - return Base::Vector3d(gp.x(), gp.y(), 0.0); + return Base::Vector3d(v.X(), v.Y(), v.Z()); } - static gp_Pnt togp_Pnt(const Base::Vector3d v) + static Base::Vector3d toVector3d(const QPointF& v) { - return gp_Pnt(v.x, v.y, v.z); + return Base::Vector3d(v.x(), v.y(), 0); } - static gp_Dir togp_Dir(const Base::Vector3d v) + + //! To gp_* + // TODO: Would this be relevant to move to Base::Vector3d? Probably + template + static T to(const Base::Vector3d &v) { - return gp_Dir(v.x, v.y, v.z); + return T(v.x, v.y, v.z); } - static gp_Vec togp_Vec(const Base::Vector3d v) - { - return gp_Vec(v.x, v.y, v.z); - } - static QPointF toQPointF(const Base::Vector3d v) + + static QPointF toQPointF(const Base::Vector3d &v) { return QPointF(v.x, v.y); } @@ -294,5 +284,12 @@ public: static void dumpEdges(const char* text, const TopoDS_Shape& s); }; + +// GCC BUG 85282, wanting this to be outside class body. This is only the declaration, the definition .cpp +//template<> std::string DrawUtil::formatVector(const Base::Vector3d &v); + +// GCC BUG 85282, wanting this to be outside class body. This is only the declaration, the definition .cpp +//template<> Base::Vector3d DrawUtil::toVector3d(const QPointF& v); + }//end namespace TechDraw #endif diff --git a/src/Mod/TechDraw/App/DrawViewDimension.cpp b/src/Mod/TechDraw/App/DrawViewDimension.cpp index c0b94bb77d..842c1075c5 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.cpp +++ b/src/Mod/TechDraw/App/DrawViewDimension.cpp @@ -1131,8 +1131,8 @@ arcPoints DrawViewDimension::arcPointsFromEdge(TopoDS_Edge occEdge) if (pts.isArc) { // part of circle gp_Ax1 axis = circle.Axis(); - gp_Vec startVec = DrawUtil::togp_Vec(pts.arcEnds.first() - pts.center); - gp_Vec endVec = DrawUtil::togp_Vec(pts.arcEnds.second() - pts.center); + gp_Vec startVec = DrawUtil::to(pts.arcEnds.first() - pts.center); + gp_Vec endVec = DrawUtil::to(pts.arcEnds.second() - pts.center); double angle = startVec.AngleWithRef(endVec, axis.Direction().XYZ()); pts.arcCW = (angle < 0.0); } @@ -1151,8 +1151,8 @@ arcPoints DrawViewDimension::arcPointsFromEdge(TopoDS_Edge occEdge) if (pts.isArc) { // part of ellipse gp_Ax1 axis = ellipse.Axis(); - gp_Vec startVec = DrawUtil::togp_Vec(pts.arcEnds.first() - pts.center); - gp_Vec endVec = DrawUtil::togp_Vec(pts.arcEnds.second() - pts.center); + gp_Vec startVec = DrawUtil::to(pts.arcEnds.first() - pts.center); + gp_Vec endVec = DrawUtil::to(pts.arcEnds.second() - pts.center); double angle = startVec.AngleWithRef(endVec, axis.Direction().XYZ()); pts.arcCW = (angle < 0.0); } @@ -1180,8 +1180,8 @@ arcPoints DrawViewDimension::arcPointsFromEdge(TopoDS_Edge occEdge) if (pts.isArc) { // part of circle gp_Ax1 axis = circle.Axis(); - gp_Vec startVec = DrawUtil::togp_Vec(pts.arcEnds.first() - pts.center); - gp_Vec endVec = DrawUtil::togp_Vec(pts.arcEnds.second() - pts.center); + gp_Vec startVec = DrawUtil::to(pts.arcEnds.first() - pts.center); + gp_Vec endVec = DrawUtil::to(pts.arcEnds.second() - pts.center); double angle = startVec.AngleWithRef(endVec, axis.Direction().XYZ()); pts.arcCW = (angle < 0.0); } @@ -1317,7 +1317,7 @@ anglePoints DrawViewDimension::getAnglePointsTwoEdges(ReferenceVector references if (!haveIntersection) { throw Base::RuntimeError("Geometry for 3d angle dimension does not intersect"); } - gp_Pnt gApex = DrawUtil::togp_Pnt(vApex); + gp_Pnt gApex = DrawUtil::to(vApex); gp_Pnt gFar0 = gEnd0; if (gStart0.Distance(gApex) > gEnd0.Distance(gApex)) { @@ -1717,9 +1717,9 @@ double DrawViewDimension::getArcAngle(Base::Vector3d center, Base::Vector3d star auto leg0 = startPoint - center; auto leg1 = endPoint - startPoint; auto referenceDirection = leg0.Cross(leg1); - gp_Ax1 axis{DU::togp_Pnt(center), DU::togp_Vec(referenceDirection)}; - gp_Vec startVec = DrawUtil::togp_Vec(leg0); - gp_Vec endVec = DrawUtil::togp_Vec(leg1); + gp_Ax1 axis{DU::to(center), DU::to(referenceDirection)}; + gp_Vec startVec = DrawUtil::to(leg0); + gp_Vec endVec = DrawUtil::to(leg1); double angle = startVec.AngleWithRef(endVec, axis.Direction().XYZ()); return angle; } diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index c82711a5e6..987f37b84a 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -1099,7 +1099,7 @@ gp_Ax2 DrawViewPart::getRotatedCS(const Base::Vector3d basePoint) const { // Base::Console().Message("DVP::getRotatedCS() - %s - %s\n", getNameInDocument(), Label.getValue()); gp_Ax2 unrotated = getProjectionCS(basePoint); - gp_Ax1 rotationAxis(DU::togp_Pnt(basePoint), unrotated.Direction()); + gp_Ax1 rotationAxis(DU::to(basePoint), unrotated.Direction()); double angleRad = Rotation.getValue() * M_PI / 180.0; gp_Ax2 rotated = unrotated.Rotated(rotationAxis, -angleRad); return rotated; diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 628d3ecc4b..615a350e91 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -968,8 +968,8 @@ ChangePointVector DrawViewSection::getChangePointsFromSectionLine() if (baseDvp) { std::pair lineEnds = sectionLineEnds(); // make start and end marks - gp_Pnt location0 = DU::togp_Pnt(lineEnds.first); - gp_Pnt location1 = DU::togp_Pnt(lineEnds.second); + gp_Pnt location0 = DU::to(lineEnds.first); + gp_Pnt location1 = DU::to(lineEnds.second); gp_Dir postDir = gp_Dir(location1.XYZ() - location0.XYZ()); gp_Dir preDir = postDir.Reversed(); ChangePoint startPoint(location0, preDir, postDir); @@ -1067,9 +1067,9 @@ void DrawViewSection::setCSFromLocalUnit(const Base::Vector3d localUnit) // Base::Console().Message("DVS::setCSFromLocalUnit(%s)\n", // DrawUtil::formatVector(localUnit).c_str()); gp_Dir verticalDir = getSectionCS().YDirection(); - gp_Ax1 verticalAxis(DrawUtil::togp_Pnt(SectionOrigin.getValue()), verticalDir); + gp_Ax1 verticalAxis(DrawUtil::to(SectionOrigin.getValue()), verticalDir); gp_Dir oldNormal = getSectionCS().Direction(); - gp_Dir newNormal = DrawUtil::togp_Dir(projectPoint(localUnit)); + gp_Dir newNormal = DrawUtil::to(projectPoint(localUnit)); double angle = oldNormal.AngleWithRef(newNormal, verticalDir); gp_Ax2 newCS = getSectionCS().Rotated(verticalAxis, angle); SectionNormal.setValue(DrawUtil::toVector3d(newCS.Direction())); diff --git a/src/Mod/TechDraw/App/Geometry.cpp b/src/Mod/TechDraw/App/Geometry.cpp index 38a2fc7462..a70bf33812 100644 --- a/src/Mod/TechDraw/App/Geometry.cpp +++ b/src/Mod/TechDraw/App/Geometry.cpp @@ -1442,7 +1442,7 @@ TopoShape Vertex::asTopoShape(double scale) { Base::Vector3d point = DU::toVector3d(BRep_Tool::Pnt(getOCCVertex())); point = point / scale; - BRepBuilderAPI_MakeVertex mkVert(DU::togp_Pnt(point)); + BRepBuilderAPI_MakeVertex mkVert(DU::to(point)); return TopoShape(mkVert.Vertex()); } @@ -1643,7 +1643,7 @@ TopoDS_Edge GeometryUtils::asCircle(TopoDS_Edge splineEdge, bool& arc) throw Base::RuntimeError("GU::asCircle received non-circular edge!"); } - gp_Pnt gCenter = DU::togp_Pnt(center); + gp_Pnt gCenter = DU::to(center); gp_Dir gNormal{0, 0, 1}; Handle(Geom_Circle) circleFromParms = GC_MakeCircle(gCenter, gNormal, radius); @@ -1825,7 +1825,7 @@ std::vector GeometryUtils::findHolesInFace(const DrawViewPart* dvp, con iFace++; continue; } - auto faceCenter = DU::togp_Pnt(face->getCenter()); + auto faceCenter = DU::to(face->getCenter()); auto faceCenterVertex = BRepBuilderAPI_MakeVertex(faceCenter); auto distance = DU::simpleMinDist(faceCenterVertex, bigCheeseOCCFace); if (distance > EWTOLERANCE) { diff --git a/src/Mod/TechDraw/Gui/TaskComplexSection.cpp b/src/Mod/TechDraw/Gui/TaskComplexSection.cpp index d6f20ad2a9..833d426cb4 100644 --- a/src/Mod/TechDraw/Gui/TaskComplexSection.cpp +++ b/src/Mod/TechDraw/Gui/TaskComplexSection.cpp @@ -501,8 +501,8 @@ bool TaskComplexSection::apply(bool forceUpdate) } else { gp_Pnt stdOrigin(0.0, 0.0, 0.0); - gp_Ax2 sectionCS(stdOrigin, DrawUtil::togp_Dir(m_saveNormal), - DrawUtil::togp_Dir(m_saveXDir)); + gp_Ax2 sectionCS(stdOrigin, DrawUtil::to(m_saveNormal), + DrawUtil::to(m_saveXDir)); if (!DrawComplexSection::canBuild(sectionCS, m_profileObject)) { Base::Console().Error( "Can not build Complex Section with this profile and direction (2)\n");