diff --git a/src/Coordinate.h b/src/Coordinate.h index 83a34079..458bf5f7 100644 --- a/src/Coordinate.h +++ b/src/Coordinate.h @@ -180,8 +180,7 @@ class SFCGAL_API Coordinate { toPoint_3() const; // class for Empty coordinate - class Empty { - }; + class Empty {}; private: boost::variant _storage; diff --git a/src/algorithm/intersects.cpp b/src/algorithm/intersects.cpp index aff6a8ac..161edea9 100644 --- a/src/algorithm/intersects.cpp +++ b/src/algorithm/intersects.cpp @@ -339,8 +339,7 @@ intersects(const PrimitiveHandle &pa, const PrimitiveHandle &pb) return dispatch_intersects_sym(pa, pb); } -struct found_an_intersection { -}; +struct found_an_intersection {}; template struct intersects_cb { diff --git a/src/algorithm/isValid.h b/src/algorithm/isValid.h index b0beeabb..4854da8e 100644 --- a/src/algorithm/isValid.h +++ b/src/algorithm/isValid.h @@ -47,8 +47,7 @@ propagateValidityFlag(Geometry &g, bool valid); * Tag used for variants of algorithm that do not do validity check * @ingroup public_api */ -struct NoValidityCheck { -}; +struct NoValidityCheck {}; } // namespace algorithm } // namespace SFCGAL diff --git a/src/algorithm/lineSubstring.cpp b/src/algorithm/lineSubstring.cpp index ee0bf595..b70dd24d 100644 --- a/src/algorithm/lineSubstring.cpp +++ b/src/algorithm/lineSubstring.cpp @@ -207,10 +207,10 @@ lineSubstring(const LineString &ls, double start, double end) bool on_end = false; double len_to_end_idx = 0.0; Point pend = find_position( - ls, N, len * end, len_to_start_idx, tol, false // Find end. - , - end_idx, end_frac, on_end, len_to_end_idx // This result is not used. - ); + ls, N, len * end, len_to_start_idx, tol, false // Find end. + , + end_idx, end_frac, on_end, len_to_end_idx // This result is not used. + ); if (reverse && closed) { // For closed lines we always want to follow the diff --git a/src/algorithm/partition_2.cpp b/src/algorithm/partition_2.cpp index ba654baa..be7337f1 100644 --- a/src/algorithm/partition_2.cpp +++ b/src/algorithm/partition_2.cpp @@ -81,7 +81,7 @@ polygons_to_geometry(const std::list &polys) } auto -partition_2(const Geometry &g, PartitionAlgorithm alg) +partition_2(const Geometry &g, PartitionAlgorithm alg) -> std::unique_ptr { using CGAL::object_cast; @@ -97,26 +97,25 @@ partition_2(const Geometry &g, PartitionAlgorithm alg) const TPolygon_2 poly{toTPolygon_2(g.as())}; std::list partition_polys; - switch(alg) { - case y_monotone: - y_monotone_partition_2(poly.vertices_begin(), poly.vertices_end(), - std::back_inserter(partition_polys)); - break; - case optimal_convex: - optimal_convex_partition_2(poly.vertices_begin(), poly.vertices_end(), - std::back_inserter(partition_polys)); - break; - case greene_approx_convex: - greene_approx_convex_partition_2(poly.vertices_begin(), poly.vertices_end(), - std::back_inserter(partition_polys)); - break; - case approx_convex: - approx_convex_partition_2(poly.vertices_begin(), poly.vertices_end(), - std::back_inserter(partition_polys)); - break; - default: - break; - + switch (alg) { + case y_monotone: + y_monotone_partition_2(poly.vertices_begin(), poly.vertices_end(), + std::back_inserter(partition_polys)); + break; + case optimal_convex: + optimal_convex_partition_2(poly.vertices_begin(), poly.vertices_end(), + std::back_inserter(partition_polys)); + break; + case greene_approx_convex: + greene_approx_convex_partition_2(poly.vertices_begin(), poly.vertices_end(), + std::back_inserter(partition_polys)); + break; + case approx_convex: + approx_convex_partition_2(poly.vertices_begin(), poly.vertices_end(), + std::back_inserter(partition_polys)); + break; + default: + break; } return polygons_to_geometry(partition_polys); } diff --git a/src/algorithm/partition_2.h b/src/algorithm/partition_2.h index 1c860367..f1f9d05d 100644 --- a/src/algorithm/partition_2.h +++ b/src/algorithm/partition_2.h @@ -17,10 +17,19 @@ namespace algorithm { * @ingroup public_api * @since 1.4.2 */ -enum PartitionAlgorithm { y_monotone, /*!< Y Monotone Partition: https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_monotone */ - approx_convex, /*!< Simple approximation algorithm of Hertel and Mehlhorn https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_convex */ - greene_approx_convex, /*!< Sweep-line approximation algorithm of Greene https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_convex */ - optimal_convex /*!< Optimal convex partition https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_convex */ +enum PartitionAlgorithm { + y_monotone, /*!< Y Monotone Partition: + https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_monotone + */ + approx_convex, /*!< Simple approximation algorithm of Hertel and Mehlhorn + https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_convex + */ + greene_approx_convex, /*!< Sweep-line approximation algorithm of Greene + https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_convex + */ + optimal_convex /*!< Optimal convex partition + https://doc.cgal.org/latest/Partition_2/index.html#secpartition_2_convex + */ }; /** @@ -30,12 +39,10 @@ enum PartitionAlgorithm { y_monotone, /*!< Y Monotone Partition: https://doc.cga * @since 1.4.2 */ SFCGAL_API auto -partition_2(const Geometry &g, PartitionAlgorithm alg = y_monotone ) +partition_2(const Geometry &g, PartitionAlgorithm alg = y_monotone) -> std::unique_ptr; - } // namespace algorithm } // namespace SFCGAL - #endif diff --git a/src/algorithm/plane.h b/src/algorithm/plane.h index 6c121978..51d76a25 100644 --- a/src/algorithm/plane.h +++ b/src/algorithm/plane.h @@ -7,7 +7,7 @@ #include -//#include +// #include #include #include @@ -97,8 +97,7 @@ plane3D(const Polygon &polygon) nrml); } -struct Plane3DInexactUnsafe { -}; +struct Plane3DInexactUnsafe {}; /** * Returns the oriented 3D plane of a polygon (supposed to be planar) - inexact diff --git a/src/algorithm/union.cpp b/src/algorithm/union.cpp index 4bf27d4f..4fc6ac37 100644 --- a/src/algorithm/union.cpp +++ b/src/algorithm/union.cpp @@ -19,8 +19,7 @@ namespace SFCGAL { namespace algorithm { -struct EmptyPrimitive { -}; +struct EmptyPrimitive {}; enum PrimitiveType { PrimitivePoint = 0, @@ -93,8 +92,7 @@ struct Segment_d : detail::Segment_d::Type { }; template -struct Surface_d { -}; +struct Surface_d {}; template <> struct Surface_d<3> : Triangle_3 { diff --git a/src/detail/TypeForDimension.h b/src/detail/TypeForDimension.h index ce1ce73f..502c5c41 100644 --- a/src/detail/TypeForDimension.h +++ b/src/detail/TypeForDimension.h @@ -23,8 +23,7 @@ namespace detail { /// TypeForKernel::Point is equivalent to CGAL::Point_2 for instance /// TypeForDimension<2>::Bbox is equivalent to CGAL::Bbox_2 -struct SFCGAL_API NoVolume { -}; +struct SFCGAL_API NoVolume {}; /// /// Generic traits, default dimension is 2 diff --git a/src/detail/io/WkbReader.cpp b/src/detail/io/WkbReader.cpp index 5704f6bc..3d96f383 100644 --- a/src/detail/io/WkbReader.cpp +++ b/src/detail/io/WkbReader.cpp @@ -163,7 +163,7 @@ WkbReader::readInnerGeometryCollection() -> GeometryCollection const uint32_t numGeoms{read()}; for (uint32_t i = 0; i < numGeoms; ++i) { readWkb(); - if(_geometry.get() != nullptr) { + if (_geometry.get() != nullptr) { result.addGeometry(_geometry.release()); } } @@ -185,7 +185,7 @@ WkbReader::readInnerTriangulatedSurface() -> TriangulatedSurface const uint32_t numGeoms{read()}; for (uint32_t i = 0; i < numGeoms; ++i) { readWkb(); - if(_geometry.get() != nullptr) { + if (_geometry.get() != nullptr) { SFCGAL::Triangle geom{_geometry->as()}; result.addTriangle(geom); } @@ -208,7 +208,7 @@ WkbReader::readInnerPolyhedralSurface() -> PolyhedralSurface const uint32_t numGeoms{read()}; for (uint32_t i = 0; i < numGeoms; ++i) { readWkb(); - if(_geometry.get() != nullptr) { + if (_geometry.get() != nullptr) { geoms.push_back(_geometry->as()); } }