diff --git a/src/Cylinder.cpp b/src/Cylinder.cpp index 683a564d..ad8fb1e2 100644 --- a/src/Cylinder.cpp +++ b/src/Cylinder.cpp @@ -7,9 +7,8 @@ namespace SFCGAL { Cylinder::Cylinder(const Point_3 &base_center, const Vector_3 &axis, const Kernel::FT &radius, const Kernel::FT &height, int num_radial) - : m_base_center(base_center), m_axis(axis), - m_radius(radius), m_height(height), - m_num_radial(num_radial) + : m_base_center(base_center), m_axis(axis), m_radius(radius), + m_height(height), m_num_radial(num_radial) { } @@ -74,7 +73,7 @@ Cylinder::normalize(const Vector_3 &v) -> Cylinder::Vector_3 double length = std::sqrt(CGAL::to_double(v.squared_length())); if (length < 1e-8) { return v; -} + } return v / length; } diff --git a/src/Envelope.cpp b/src/Envelope.cpp index 6898c7eb..733d1d52 100644 --- a/src/Envelope.cpp +++ b/src/Envelope.cpp @@ -85,7 +85,6 @@ Envelope::operator=(const Envelope &other) -> Envelope & /// /// - /// /// /// diff --git a/src/Exception.cpp b/src/Exception.cpp index e3e48579..4e579030 100644 --- a/src/Exception.cpp +++ b/src/Exception.cpp @@ -9,7 +9,10 @@ namespace SFCGAL { Exception::Exception() noexcept : _message("unknown exception") {} -Exception::Exception(std::string const &message) noexcept : _message(std::move(message)) {} +Exception::Exception(std::string const &message) noexcept + : _message(std::move(message)) +{ +} Exception::~Exception() noexcept = default; diff --git a/src/Geometry.cpp b/src/Geometry.cpp index 805bf222..016c0c9f 100644 --- a/src/Geometry.cpp +++ b/src/Geometry.cpp @@ -139,7 +139,7 @@ Geometry::geometryN(size_t const &n) -> Geometry & /// /// /// -Geometry::Geometry() = default; +Geometry::Geometry() = default; auto Geometry::hasValidityFlag() const -> bool diff --git a/src/Sphere.cpp b/src/Sphere.cpp index 859718d6..503c58f2 100644 --- a/src/Sphere.cpp +++ b/src/Sphere.cpp @@ -16,7 +16,7 @@ template class Sphere_builder : public CGAL::Modifier_base { public: Sphere_builder(double radius, int num_vertical, int num_horizontal, - Point_3 center, const Kernel::Vector_3& direction) + Point_3 center, const Kernel::Vector_3 &direction) : radius(radius), num_vertical(num_vertical), num_horizontal(num_horizontal), center(std::move(center)), direction(normalizeVector(direction)) @@ -51,8 +51,8 @@ class Sphere_builder : public CGAL::Modifier_base { { if (vec.x() != 0 || vec.y() != 0) { return Kernel::Vector_3(-vec.y(), vec.x(), 0); - } return Kernel::Vector_3(0, -vec.z(), vec.y()); - + } + return Kernel::Vector_3(0, -vec.z(), vec.y()); } void @@ -142,8 +142,9 @@ class Sphere_builder : public CGAL::Modifier_base { Sphere::Sphere(const Kernel::FT &radius, const Kernel::Point_3 ¢er, int num_vertical, int num_horizontal, const Kernel::Vector_3 &direction) - : m_radius(std::move(radius)), m_center(std::move(center)), m_num_vertical(num_vertical), - m_num_horizontal(num_horizontal), m_direction(normalizeVector(direction)) + : m_radius(std::move(radius)), m_center(std::move(center)), + m_num_vertical(num_vertical), m_num_horizontal(num_horizontal), + m_direction(normalizeVector(direction)) { } diff --git a/src/algorithm/buffer3D.cpp b/src/algorithm/buffer3D.cpp index eba8652a..1370594e 100644 --- a/src/algorithm/buffer3D.cpp +++ b/src/algorithm/buffer3D.cpp @@ -99,9 +99,8 @@ Buffer3D::computeRoundBuffer() const -> std::unique_ptr SFCGAL::detail::MarkedPolyhedron out; result.convert_to_polyhedron(out); return std::make_unique(out); - } // If _inputPoints is empty, return an empty PolyhedralSurface - return std::make_unique(); - + } // If _inputPoints is empty, return an empty PolyhedralSurface + return std::make_unique(); } auto @@ -200,7 +199,7 @@ Buffer3D::computeFlatBuffer() const -> std::unique_ptr { std::vector line_points; line_points.reserve(_inputPoints.size()); -for (const auto &p : _inputPoints) { + for (const auto &p : _inputPoints) { line_points.emplace_back(p.x(), p.y(), p.z()); } @@ -258,7 +257,7 @@ for (const auto &p : _inputPoints) { rings.push_back(start_ring); if (i == line_points.size() - 2) { rings.push_back(end_ring); -} + } } // Add caps @@ -286,7 +285,7 @@ for (const auto &p : _inputPoints) { auto Buffer3D::extend_point(const Kernel::Point_3 &point, - const Kernel::Vector_3 &direction, double distance) const + const Kernel::Vector_3 &direction, double distance) const -> Kernel::Point_3 { return point + direction * distance; @@ -295,7 +294,7 @@ Buffer3D::extend_point(const Kernel::Point_3 &point, auto Buffer3D::create_circle_points(const Kernel::Point_3 ¢er, const Kernel::Vector_3 &axis, double radius, - int segments) const + int segments) const -> std::vector { std::vector points; @@ -320,7 +319,7 @@ Buffer3D::create_circle_points(const Kernel::Point_3 ¢er, auto Buffer3D::compute_bisector_plane(const Kernel::Point_3 &p1, const Kernel::Point_3 &p2, - const Kernel::Point_3 &p3) const + const Kernel::Point_3 &p3) const -> Kernel::Plane_3 { Kernel::Vector_3 v1 = normalizeVector(p2 - p1); @@ -332,7 +331,7 @@ Buffer3D::compute_bisector_plane(const Kernel::Point_3 &p1, auto Buffer3D::intersect_segment_plane(const Kernel::Point_3 &p1, const Kernel::Point_3 &p2, - const Kernel::Plane_3 &plane) const + const Kernel::Plane_3 &plane) const -> Kernel::Point_3 { Kernel::Vector_3 v = p2 - p1; diff --git a/src/algorithm/difference.cpp b/src/algorithm/difference.cpp index 837ec775..aa041957 100644 --- a/src/algorithm/difference.cpp +++ b/src/algorithm/difference.cpp @@ -320,7 +320,8 @@ post_difference(const GeometrySet<2> &input, GeometrySet<2> &output) } } - output.surfaces().emplace_back(PolygonWH_2(outer, rings.begin(), rings.end())); + output.surfaces().emplace_back( + PolygonWH_2(outer, rings.begin(), rings.end())); } output.points() = input.points(); diff --git a/src/algorithm/intersection.cpp b/src/algorithm/intersection.cpp index 71624a89..f0332cba 100644 --- a/src/algorithm/intersection.cpp +++ b/src/algorithm/intersection.cpp @@ -107,7 +107,8 @@ post_intersection(const GeometrySet<2> &input, GeometrySet<2> &output) } } - output.surfaces().emplace_back(CGAL::Polygon_with_holes_2(outer, rings.begin(), rings.end())); + output.surfaces().emplace_back( + CGAL::Polygon_with_holes_2(outer, rings.begin(), rings.end())); } output.points() = input.points(); diff --git a/src/algorithm/minkowskiSum3D.cpp b/src/algorithm/minkowskiSum3D.cpp index e908fe45..ff9933af 100644 --- a/src/algorithm/minkowskiSum3D.cpp +++ b/src/algorithm/minkowskiSum3D.cpp @@ -29,8 +29,8 @@ perpendicular_vector(const Kernel::Vector_3 &v) -> Kernel::Vector_3 { if (v.x() != 0 || v.y() != 0) { return Kernel::Vector_3(-v.y(), v.x(), 0); - } return Kernel::Vector_3(0, -v.z(), v.y()); - + } + return Kernel::Vector_3(0, -v.z(), v.y()); } // Helper function to convert SFCGAL::Geometry to Nef_polyhedron_3 @@ -166,8 +166,8 @@ nefToGeometry(const Nef_polyhedron_3 &nef) -> std::unique_ptr } auto -minkowskiSum3D(const Geometry &gA, const Geometry &gB, NoValidityCheck /*unused*/) - -> std::unique_ptr +minkowskiSum3D(const Geometry &gA, const Geometry &gB, + NoValidityCheck /*unused*/) -> std::unique_ptr { if (gA.isEmpty() || gB.isEmpty()) { return std::unique_ptr(new GeometryCollection()); diff --git a/src/algorithm/straightSkeleton.cpp b/src/algorithm/straightSkeleton.cpp index 14c4515a..a20994e0 100644 --- a/src/algorithm/straightSkeleton.cpp +++ b/src/algorithm/straightSkeleton.cpp @@ -543,7 +543,7 @@ straightSkeletonPartition(const Polygon &g, bool /*autoOrientation*/) // Skip the faces that correspond to holes if (is_hole_face(face)) { continue; -} + } result->addGeometry(create_polygon_from_face(face)); } diff --git a/src/algorithm/union.cpp b/src/algorithm/union.cpp index 74146626..400c568e 100644 --- a/src/algorithm/union.cpp +++ b/src/algorithm/union.cpp @@ -383,8 +383,8 @@ class Handle { } void - swap(Handle &other) - noexcept { + swap(Handle &other) noexcept + { (*_p)->_observers.erase(_p); (*other._p)->_observers.erase(other._p); std::swap(_p, other._p); diff --git a/src/detail/GeometrySet.cpp b/src/detail/GeometrySet.cpp index af8253eb..574e6c1a 100644 --- a/src/detail/GeometrySet.cpp +++ b/src/detail/GeometrySet.cpp @@ -101,8 +101,8 @@ _decompose_polygon(const Polygon &poly, for (size_t i = 0; i < surf.numTriangles(); ++i) { const Triangle &tri = surf.triangleN(i); surfaces.emplace_back(CGAL::Triangle_3(tri.vertex(0).toPoint_3(), - tri.vertex(1).toPoint_3(), - tri.vertex(2).toPoint_3())); + tri.vertex(1).toPoint_3(), + tri.vertex(2).toPoint_3())); } } @@ -205,7 +205,8 @@ GeometrySet<2>::addPrimitive(const PrimitiveHandle<2> &p) break; case PrimitiveSurface: - _surfaces.emplace_back(*boost::get::Surface *>(p.handle)); + _surfaces.emplace_back( + *boost::get::Surface *>(p.handle)); break; default: @@ -228,7 +229,8 @@ GeometrySet<3>::addPrimitive(const PrimitiveHandle<3> &p) break; case PrimitiveSurface: - _surfaces.emplace_back(*boost::get::Surface *>(p.handle)); + _surfaces.emplace_back( + *boost::get::Surface *>(p.handle)); break; case PrimitiveVolume: { diff --git a/src/detail/tools/Log.cpp b/src/detail/tools/Log.cpp index 66351a6e..8ab97cd5 100644 --- a/src/detail/tools/Log.cpp +++ b/src/detail/tools/Log.cpp @@ -101,10 +101,7 @@ Logger::setLogLevel(const Level &logLevel) /// /// /// -Logger::Logger(std::ostream &str) - : _out(str.rdbuf()) -{ -} +Logger::Logger(std::ostream &str) : _out(str.rdbuf()) {} /// /// diff --git a/src/io/wkt.h b/src/io/wkt.h index b7daf82d..33d08d08 100644 --- a/src/io/wkt.h +++ b/src/io/wkt.h @@ -21,17 +21,17 @@ namespace io { * Read a WKT geometry from an input stream */ SFCGAL_API auto - readWkt(std::istream &s) -> std::unique_ptr; +readWkt(std::istream &s) -> std::unique_ptr; /** * Read a WKT geometry from a string */ SFCGAL_API auto - readWkt(const std::string &s) -> std::unique_ptr; +readWkt(const std::string &s) -> std::unique_ptr; /** * Read a WKT geometry from a char* */ SFCGAL_API auto - readWkt(const char *, size_t) -> std::unique_ptr; +readWkt(const char *, size_t) -> std::unique_ptr; } // namespace io } // namespace SFCGAL diff --git a/test/regress/convex_hull/main.cpp b/test/regress/convex_hull/main.cpp index 4374d662..91ba4260 100644 --- a/test/regress/convex_hull/main.cpp +++ b/test/regress/convex_hull/main.cpp @@ -144,8 +144,7 @@ main(int argc, char *argv[]) -> int std::cout.width(12); boost::chrono::duration const elapsed = boost::chrono::system_clock::now() - start; - std::cout << std::left << lineNumber << "(" << elapsed << " s)" - << '\n'; + std::cout << std::left << lineNumber << "(" << elapsed << " s)" << '\n'; } std::vector tokens; @@ -176,8 +175,7 @@ main(int argc, char *argv[]) -> int hull3D = algorithm::convexHull3D(*g); failed = false; } catch (Exception &e) { - std::cerr << "[Exception]" << id << "|" << e.what() << "|" << wkt - << '\n'; + std::cerr << "[Exception]" << id << "|" << e.what() << "|" << wkt << '\n'; } catch (std::exception &e) { std::cerr << "[std::exception]" << id << "|" << e.what() << "|" << wkt << '\n'; @@ -202,8 +200,7 @@ main(int argc, char *argv[]) -> int boost::chrono::duration const elapsed = boost::chrono::system_clock::now() - start; std::cout << filename << " complete (" << elapsed << " s)---" << '\n'; - std::cout << numFailed << " failed /" << (numFailed + numSuccess) - << '\n'; + std::cout << numFailed << " failed /" << (numFailed + numSuccess) << '\n'; if (numFailed == 0) { // delete empty error file diff --git a/test/regress/polygon_triangulator/main.cpp b/test/regress/polygon_triangulator/main.cpp index db2ff44e..52805be2 100644 --- a/test/regress/polygon_triangulator/main.cpp +++ b/test/regress/polygon_triangulator/main.cpp @@ -164,8 +164,7 @@ main(int argc, char *argv[]) -> int std::cout.width(12); boost::chrono::duration const elapsed = boost::chrono::system_clock::now() - start; - std::cout << std::left << lineNumber << "(" << elapsed << " s)" - << '\n'; + std::cout << std::left << lineNumber << "(" << elapsed << " s)" << '\n'; } std::vector tokens; @@ -254,8 +253,7 @@ main(int argc, char *argv[]) -> int } std::cout << filename << " complete (" << elapsed << " s)---" << '\n'; - std::cout << numFailed << " failed /" << (numFailed + numSuccess) - << '\n'; + std::cout << numFailed << " failed /" << (numFailed + numSuccess) << '\n'; if (numFailed == 0) { // delete empty error file diff --git a/test/unit/SFCGAL/algorithm/Buffer3DTest.cpp b/test/unit/SFCGAL/algorithm/Buffer3DTest.cpp index da67766f..79695a2b 100644 --- a/test/unit/SFCGAL/algorithm/Buffer3DTest.cpp +++ b/test/unit/SFCGAL/algorithm/Buffer3DTest.cpp @@ -123,8 +123,7 @@ BOOST_AUTO_TEST_CASE(testBuffer3D_Point) // Check if the expected file exists if (!fs::exists(expectedFile)) { - std::cout << "Expected file does not exist: " << expectedFile - << '\n'; + std::cout << "Expected file does not exist: " << expectedFile << '\n'; continue; } @@ -186,8 +185,7 @@ BOOST_AUTO_TEST_CASE(testBuffer3D_LineString) // Check if the expected file exists if (!fs::exists(expectedFile)) { - std::cout << "Expected file does not exist: " << expectedFile - << '\n'; + std::cout << "Expected file does not exist: " << expectedFile << '\n'; continue; } diff --git a/test/unit/SFCGAL/io/OBJTest.cpp b/test/unit/SFCGAL/io/OBJTest.cpp index b8b963bb..9418944c 100644 --- a/test/unit/SFCGAL/io/OBJTest.cpp +++ b/test/unit/SFCGAL/io/OBJTest.cpp @@ -104,8 +104,7 @@ BOOST_AUTO_TEST_CASE(test_all_geometries) // Check if the expected file exists if (!fs::exists(expectedFile)) { - std::cout << "Expected file does not exist: " << expectedFile - << '\n'; + std::cout << "Expected file does not exist: " << expectedFile << '\n'; continue; } diff --git a/test/unit/SFCGAL/io/VTKTest.cpp b/test/unit/SFCGAL/io/VTKTest.cpp index a410353a..d56933c6 100644 --- a/test/unit/SFCGAL/io/VTKTest.cpp +++ b/test/unit/SFCGAL/io/VTKTest.cpp @@ -104,8 +104,7 @@ BOOST_AUTO_TEST_CASE(test_all_geometries) // Check if the expected file exists if (!fs::exists(expectedFile)) { - std::cout << "Expected file does not exist: " << expectedFile - << '\n'; + std::cout << "Expected file does not exist: " << expectedFile << '\n'; // continue; }