7575FittingCurve2dAPDM::findElement (double xi, const std::vector<double > &elements)
7676{
7777 if (xi >= elements.back ())
78- return (int (elements.size ()) - 2 );
78+ return (static_cast < int > (elements.size ()) - 2 );
7979
8080 for (std::size_t i = 0 ; i < elements.size () - 1 ; i++)
8181 {
@@ -148,8 +148,8 @@ FittingCurve2dAPDM::assemble (const Parameter ¶meter)
148148 int cp_red = m_nurbs.m_order - 2 ;
149149 int ncp = m_nurbs.m_cv_count - 2 * cp_red;
150150 int nCageReg = m_nurbs.m_cv_count - 2 * cp_red;
151- int nInt = int (m_data->interior .size ());
152- int nClosestP = int (elements.size ()) * cp_res;
151+ int nInt = static_cast < int > (m_data->interior .size ());
152+ int nClosestP = static_cast < int > (elements.size ()) * cp_res;
153153
154154 double wInt = 1.0 ;
155155 if (!m_data->interior_weight .empty ())
@@ -330,8 +330,8 @@ FittingCurve2dAPDM::removeCPsOnLine (const ON_NurbsCurve &nurbs, double min_curv
330330 }
331331
332332 int order = nurbs.Order ();
333- ON_NurbsCurve nurbs_opt = ON_NurbsCurve (2 , false , order, int (cps.size ()) + 2 * cp_red);
334- nurbs_opt.MakePeriodicUniformKnotVector (1.0 / (double (cps.size ())));
333+ ON_NurbsCurve nurbs_opt = ON_NurbsCurve (2 , false , order, static_cast < int > (cps.size ()) + 2 * cp_red);
334+ nurbs_opt.MakePeriodicUniformKnotVector (1.0 / (static_cast < double > (cps.size ())));
335335 nurbs_opt.m_knot [cp_red] = 0.0 ;
336336 nurbs_opt.m_knot [nurbs_opt.m_knot_capacity - cp_red - 1 ] = 1.0 ;
337337
@@ -428,7 +428,7 @@ FittingCurve2dAPDM::addCageRegularisation (double weight, unsigned &row, const s
428428 {
429429 int i = j % ncp;
430430
431- if (i >= int (m_data->closest_points_error .size () - 1 ))
431+ if (i >= static_cast < int > (m_data->closest_points_error .size () - 1 ))
432432 {
433433 printf (" [FittingCurve2dAPDM::addCageRegularisation] Warning, index for closest_points_error out of bounds\n " );
434434 m_solver.f (row, 0 , 0.0 );
@@ -512,15 +512,15 @@ FittingCurve2dAPDM::initCPsNurbsCurve2D (int order, const vector_vec2d &cps)
512512 return nurbs;
513513 }
514514
515- int ncps = int (cps.size ()) + 2 * cp_red; // +2*cp_red for smoothness and +1 for closing
515+ int ncps = static_cast < int > (cps.size ()) + 2 * cp_red; // +2*cp_red for smoothness and +1 for closing
516516 nurbs = ON_NurbsCurve (2 , false , order, ncps);
517517 nurbs.MakePeriodicUniformKnotVector (1.0 / (ncps - order + 1 ));
518518
519519 for (std::size_t j = 0 ; j < cps.size (); j++)
520520 nurbs.SetCV (cp_red + j, ON_3dPoint (cps[j] (0 ), cps[j] (1 ), 0.0 ));
521521
522522 // close nurbs
523- nurbs.SetCV (cp_red + int (cps.size ()), ON_3dPoint (cps[0 ] (0 ), cps[0 ] (1 ), 0.0 ));
523+ nurbs.SetCV (cp_red + static_cast < int > (cps.size ()), ON_3dPoint (cps[0 ] (0 ), cps[0 ] (1 ), 0.0 ));
524524
525525 // make smooth at closing point
526526 for (int j = 0 ; j < cp_red; j++)
@@ -544,7 +544,7 @@ FittingCurve2dAPDM::initNurbsCurve2D (int order, const vector_vec2d &data, int n
544544
545545 Eigen::Vector2d mean = NurbsTools::computeMean (data);
546546
547- unsigned s = unsigned (data.size ());
547+ auto s = static_cast < unsigned > (data.size ());
548548
549549 double r (0.0 );
550550 for (unsigned i = 0 ; i < s; i++)
@@ -641,7 +641,7 @@ FittingCurve2dAPDM::getElementVector (const ON_NurbsCurve &nurbs)
641641void
642642FittingCurve2dAPDM::assembleInterior (double wInt, double sigma2, double rScale, unsigned &row)
643643{
644- int nInt = int (m_data->interior .size ());
644+ int nInt = static_cast < int > (m_data->interior .size ());
645645 bool wFunction (true );
646646 double ds = 1.0 / (2.0 * sigma2);
647647 m_data->interior_error .clear ();
@@ -657,7 +657,7 @@ FittingCurve2dAPDM::assembleInterior (double wInt, double sigma2, double rScale,
657657 double param;
658658 Eigen::Vector2d pt, t;
659659 double error;
660- if (p < int (m_data->interior_param .size ()))
660+ if (p < static_cast < int > (m_data->interior_param .size ()))
661661 {
662662 param = findClosestElementMidPoint (m_nurbs, pcp, m_data->interior_param [p]);
663663 param = inverseMapping (m_nurbs, pcp, param, error, pt, t, rScale, in_max_steps, in_accuracy, m_quiet);
@@ -677,10 +677,10 @@ FittingCurve2dAPDM::assembleInterior (double wInt, double sigma2, double rScale,
677677 Eigen::Vector3d b (t (0 ), t (1 ), 0.0 );
678678 Eigen::Vector3d z = a.cross (b);
679679
680- if (p < int (m_data->interior_weight .size ()))
680+ if (p < static_cast < int > (m_data->interior_weight .size ()))
681681 wInt = m_data->interior_weight [p];
682682
683- if (p < int (m_data->interior_weight_function .size ()))
683+ if (p < static_cast < int > (m_data->interior_weight_function .size ()))
684684 wFunction = m_data->interior_weight_function [p];
685685
686686 double w (wInt);
0 commit comments