7373#include < App/Document.h>
7474#include < Base/BoundBox.h>
7575#include < Base/Console.h>
76+ #include < Base/Converter.h>
7677#include < Base/FileInfo.h>
7778#include < Base/Parameter.h>
7879
@@ -244,7 +245,7 @@ TopoDS_Shape DrawBrokenView::compressHorizontal(const TopoDS_Shape& shapeToComp
244245{
245246 auto pieces = getPieces (shapeToCompress);
246247 auto breaksAll = Breaks.getValues ();
247- auto moveDirection = DU::closestBasisOriented (DU::toVector3d (getProjectionCS ().XDirection ()));
248+ auto moveDirection = DU::closestBasisOriented (Base::convertTo<Base::Vector3d> (getProjectionCS ().XDirection ()));
248249 bool descend = false ;
249250 auto sortedBreaks = makeSortedBreakList (breaksAll, moveDirection, descend);
250251 auto limits = getPieceLimits (pieces, moveDirection);
@@ -283,7 +284,7 @@ TopoDS_Shape DrawBrokenView::compressVertical(const TopoDS_Shape& shapeToCompre
283284 auto pieces = getPieces (shapeToCompress);
284285 auto breaksAll = Breaks.getValues ();
285286 // not sure about using closestBasis here. may prevent oblique breaks later.
286- auto moveDirection = DU::closestBasisOriented (DU::toVector3d (getProjectionCS ().YDirection ()));
287+ auto moveDirection = DU::closestBasisOriented (Base::convertTo<Base::Vector3d> (getProjectionCS ().YDirection ()));
287288
288289 bool descend = false ;
289290 auto sortedBreaks = makeSortedBreakList (breaksAll, moveDirection, descend);
@@ -323,11 +324,11 @@ TopoDS_Shape DrawBrokenView::makeHalfSpace(const Base::Vector3d& planePoint,
323324 const Base::Vector3d& planeNormal,
324325 const Base::Vector3d& pointInSpace) const
325326{
326- auto origin = DU::to <gp_Pnt>(planePoint);
327- auto axis = DU::to <gp_Dir>(planeNormal);
327+ auto origin = Base::convertTo <gp_Pnt>(planePoint);
328+ auto axis = Base::convertTo <gp_Dir>(planeNormal);
328329 gp_Pln plane (origin, axis);
329330 BRepBuilderAPI_MakeFace mkFace (plane);
330- BRepPrimAPI_MakeHalfSpace mkHalf (mkFace.Face (), DU::to <gp_Pnt>(pointInSpace));
331+ BRepPrimAPI_MakeHalfSpace mkHalf (mkFace.Face (), Base::convertTo <gp_Pnt>(pointInSpace));
331332
332333 return mkHalf.Solid ();
333334}
@@ -478,7 +479,7 @@ std::pair<Base::Vector3d, Base::Vector3d> DrawBrokenView::breakPointsFromEdge(co
478479 TopoDS_Edge edge = TopoDS::Edge (locShape);
479480 gp_Pnt start = BRep_Tool::Pnt (TopExp::FirstVertex (edge));
480481 gp_Pnt end = BRep_Tool::Pnt (TopExp::LastVertex (edge));
481- return {DU::toVector3d (start), DU::toVector3d (end)};
482+ return {Base::convertTo<Base::Vector3d> (start), Base::convertTo<Base::Vector3d> (end)};
482483}
483484
484485
@@ -641,7 +642,7 @@ bool DrawBrokenView::isVertical(const TopoDS_Edge& edge, const bool projected) c
641642 auto edgeDir = ends.second - ends.first ;
642643 edgeDir.Normalize ();
643644
644- auto upDir = DU::toVector3d (getProjectionCS ().YDirection ());
645+ auto upDir = Base::convertTo<Base::Vector3d> (getProjectionCS ().YDirection ());
645646 if (projected) {
646647 upDir = stdY;
647648 }
@@ -657,7 +658,7 @@ bool DrawBrokenView::isVertical(std::pair<Base::Vector3d, Base::Vector3d> inPoin
657658 auto pointDir = inPoints.second - inPoints.first ;
658659 pointDir.Normalize ();
659660
660- auto upDir = DU::toVector3d (getProjectionCS ().YDirection ());
661+ auto upDir = Base::convertTo<Base::Vector3d> (getProjectionCS ().YDirection ());
661662 if (projected) {
662663 upDir = stdY;
663664 }
@@ -673,7 +674,7 @@ bool DrawBrokenView::isHorizontal(const TopoDS_Edge& edge, bool projected) const
673674 auto edgeDir = ends.second - ends.first ;
674675 edgeDir.Normalize ();
675676
676- auto sideDir = DU::toVector3d (getProjectionCS ().XDirection ());
677+ auto sideDir = Base::convertTo<Base::Vector3d> (getProjectionCS ().XDirection ());
677678 if (projected) {
678679 sideDir = stdX;
679680 }
@@ -876,7 +877,7 @@ Base::Vector3d DrawBrokenView::mapPoint3dToView(Base::Vector3d point3d) const
876877
877878 auto breaksAll = Breaks.getValues ();
878879 bool descend = false ;
879- auto moveXDirection = DU::closestBasisOriented (DU::toVector3d (getProjectionCS ().XDirection ()));
880+ auto moveXDirection = DU::closestBasisOriented (Base::convertTo<Base::Vector3d> (getProjectionCS ().XDirection ()));
880881
881882 // get the breaks that move us in X
882883 auto sortedXBreaks = makeSortedBreakList (breaksAll, moveXDirection, descend);
@@ -885,7 +886,7 @@ Base::Vector3d DrawBrokenView::mapPoint3dToView(Base::Vector3d point3d) const
885886 double xShift = shiftAmountShrink (xLimit, moveXDirection, sortedXBreaks);
886887 Base::Vector3d xMove = moveXDirection * xShift; // move to the right (+X)
887888
888- auto moveYDirection = DU::closestBasisOriented (DU::toVector3d (getProjectionCS ().YDirection ()));
889+ auto moveYDirection = DU::closestBasisOriented (Base::convertTo<Base::Vector3d> (getProjectionCS ().YDirection ()));
889890 descend = false ;
890891 // get the breaks that move us in Y
891892 auto sortedYBreaks = makeSortedBreakList (breaksAll, moveYDirection, descend);
@@ -913,12 +914,12 @@ Base::Vector3d DrawBrokenView::mapPoint2dFromView(Base::Vector3d point2d) const
913914 gp_Ax3 projCS3 (getProjectionCS (getCompressedCentroid ()));
914915 gp_Trsf xTo3d;
915916 xTo3d.SetTransformation (projCS3, OXYZ);
916- auto pseudo3d = DU::toVector3d (DU::to <gp_Pnt>(point2d).Transformed (xTo3d));
917+ auto pseudo3d = Base::convertTo<Base::Vector3d>(Base::convertTo <gp_Pnt>(point2d).Transformed (xTo3d));
917918
918919 // now shift down and left
919920 auto breaksAll = Breaks.getValues ();
920921
921- auto moveXDirection = DU::closestBasisOriented (DU::toVector3d (getProjectionCS ().XDirection ()));
922+ auto moveXDirection = DU::closestBasisOriented (Base::convertTo<Base::Vector3d> (getProjectionCS ().XDirection ()));
922923 // we are expanding, so the direction should be to the "left"/"down" which is the opposite of
923924 // our XDirection
924925 auto moveXReverser = isDirectionReversed (moveXDirection) ? 1.0 : -1.0 ;
@@ -941,7 +942,7 @@ Base::Vector3d DrawBrokenView::mapPoint2dFromView(Base::Vector3d point2d) const
941942 }
942943 double xCoord2 = xLimit + breakSum * moveXReverser;
943944
944- auto moveYDirection = DU::closestBasisOriented (DU::toVector3d (getProjectionCS ().YDirection ()));
945+ auto moveYDirection = DU::closestBasisOriented (Base::convertTo<Base::Vector3d> (getProjectionCS ().YDirection ()));
945946 auto moveYReverser = isDirectionReversed (moveYDirection) ? 1.0 : -1.0 ;
946947 descend = false ;
947948 auto sortedYBreaks = makeSortedBreakList (breaksAll, moveYDirection, descend);
@@ -1102,18 +1103,18 @@ Base::Vector3d DrawBrokenView::getCompressedCentroid() const
11021103 }
11031104 gp_Ax2 cs = getProjectionCS ();
11041105 gp_Pnt gCenter = ShapeUtils::findCentroid (m_compressedShape, cs);
1105- return DU::toVector3d (gCenter );
1106+ return Base::convertTo<Base::Vector3d> (gCenter );
11061107}
11071108
11081109// ! construct a perpendicular direction in the projection CS
11091110Base::Vector3d DrawBrokenView::makePerpendicular (Base::Vector3d inDir) const
11101111{
1111- auto gDir = DU::to <gp_Dir>(inDir);
1112+ auto gDir = Base::convertTo <gp_Dir>(inDir);
11121113 gp_Pnt origin (0.0 , 0.0 , 0.0 );
11131114 auto dir = getProjectionCS ().Direction ();
11141115 gp_Ax1 axis (origin, dir);
11151116 auto gRotated = gDir .Rotated (axis, M_PI_2);
1116- return DU::toVector3d (gRotated );
1117+ return Base::convertTo<Base::Vector3d> (gRotated );
11171118}
11181119
11191120// ! true if this piece should be moved
0 commit comments