Skip to content

Commit 7240a15

Browse files
committed
code style-2
1 parent 772f36f commit 7240a15

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

Point_set_processing_3/include/CGAL/estimate_lfs.h

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ template <typename NeighborQuery>
9393
typename NeighborQuery::FT
9494
av_sqrt_sum_sq_distance_to_knn(const typename NeighborQuery::Point_3& query, ///< point
9595
const NeighborQuery& neighbor_query,
96-
const int knn)
96+
const int knn)
9797
{
9898
// basic geometric types
9999
typedef typename NeighborQuery::Kernel Kernel;
@@ -121,7 +121,7 @@ av_sqrt_sum_sq_distance_to_knn(const typename NeighborQuery::Point_3& query, ///
121121
template <typename NeighborQuery, typename PointRange, typename PointMap>
122122
typename NeighborQuery::FT
123123
classical_point_dist_func_epsilon_band(const PointRange &points,
124-
const NeighborQuery& neighbor_query,
124+
const NeighborQuery& neighbor_query,
125125
const PointMap point_map,
126126
const int band_knn=12)
127127
{
@@ -183,7 +183,7 @@ Point local2world(const Point &local, const Point &o,
183183

184184

185185
template <typename Geom_traits>
186-
void random_dual_cone_search_segs(const typename Geom_traits::Point_3 &p,
186+
void random_dual_cone_search_segs(const typename Geom_traits::Point_3 &p,
187187
const typename Geom_traits::Vector_3 &n,
188188
const typename Geom_traits::Sphere_3 &bsphere,
189189
std::vector<typename Geom_traits::Segment_3> &segs,
@@ -251,7 +251,7 @@ void random_dual_cone_search_segs(const typename Geom_traits::Point_3 &p,
251251
}
252252

253253
template <typename NeighborQuery>
254-
bool recursive_dichotomic_search_base(const typename NeighborQuery::Kernel::Segment_3 &e,
254+
bool recursive_dichotomic_search_base(const typename NeighborQuery::Kernel::Segment_3 &e,
255255
const typename NeighborQuery::Kernel::Point_2 &s,
256256
const typename NeighborQuery::Kernel::Point_2 &t,
257257
const NeighborQuery& neighbor_query,
@@ -349,7 +349,7 @@ bool recursive_dichotomic_search_base(const typename NeighborQuery::Kernel::Segm
349349
}
350350

351351
template<class NeighborQuery>
352-
bool recursive_dichotomic_search(const typename NeighborQuery::Kernel::Segment_3 &e,
352+
bool recursive_dichotomic_search(const typename NeighborQuery::Kernel::Segment_3 &e,
353353
const typename NeighborQuery::Kernel::Point_2 &s,
354354
const typename NeighborQuery::Kernel::Point_2 &t,
355355
const NeighborQuery &neighbor_query,
@@ -363,21 +363,18 @@ bool recursive_dichotomic_search(const typename NeighborQuery::Kernel::Segment_3
363363
typedef typename Kernel::Point_3 Point;
364364

365365
CGAL_precondition(intersections.empty());
366-
bool flag = recursive_dichotomic_search_base(e, s, t, neighbor_query, epsilon_band,
366+
bool flag = recursive_dichotomic_search_base(e, s, t, neighbor_query, epsilon_band,
367367
intersections, lipschitz, eps);
368368

369-
if (flag == false) // should not false
370-
{
371-
;
372-
}
373-
else if (intersections.size() % 2 != 0)
369+
if (intersections.size() % 2 != 0)
374370
{
375371
const bool s_sign = (s.y() > epsilon_band);
376372
const bool t_sign = (t.y() > epsilon_band);
377373

378374
if ((!s_sign) && t_sign)
379375
{
380376
std::vector<Point> intersections_;
377+
intersections_.reserve(intersections.size());
381378
intersections_.push_back(e.source());
382379
for (std::size_t i = 1; i < intersections.size(); i = i + 2)
383380
{
@@ -386,12 +383,13 @@ bool recursive_dichotomic_search(const typename NeighborQuery::Kernel::Segment_3
386383
const Point p = p1 + (p0 - p1) / 2;
387384
intersections_.push_back(p);
388385
}
389-
intersections = intersections_;
386+
std::swap(intersections, intersections_);
390387
}
391388

392389
if ((!t_sign) && s_sign)
393390
{
394391
std::vector<Point> intersections_;
392+
intersections_.reserve(intersections.size());
395393
for (std::size_t i = 0; i < intersections.size() - 1; i = i + 2)
396394
{
397395
const Point p0 = intersections[i];
@@ -400,10 +398,10 @@ bool recursive_dichotomic_search(const typename NeighborQuery::Kernel::Segment_3
400398
intersections_.push_back(p);
401399
}
402400
intersections_.push_back(e.target());
403-
intersections = intersections_;
401+
std::swap(intersections, intersections_);
404402
}
405403

406-
if (s_sign && t_sign)
404+
if (s_sign && t_sign)
407405
{
408406
flag = false;
409407
}
@@ -527,7 +525,7 @@ min_curvature_radius(Monge_form &monge_form)
527525

528526
template <typename NeighborQuery>
529527
typename NeighborQuery::FT
530-
estimate_local_feature_size(const typename NeighborQuery::Point_3& query, ///< point
528+
estimate_local_feature_size(const typename NeighborQuery::Point_3& query, ///< point
531529
typename NeighborQuery::Kernel::Vector_3& normal,
532530
const NeighborQuery& neighbor_query, ///< KD-tree
533531
const typename NeighborQuery::Kernel::Sphere_3& bsphere, ///< bounding sphere
@@ -684,4 +682,4 @@ estimate_local_feature_size(PointRange& points,
684682

685683
} //namespace CGAL
686684

687-
#endif // CGAL_ESTIMATE_LFS_H
685+
#endif // CGAL_ESTIMATE_LFS_H

0 commit comments

Comments
 (0)