Skip to content

Commit

Permalink
clang-format: apply clang-format forgotten in clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti committed Dec 15, 2023
1 parent b3a7e24 commit a613532
Show file tree
Hide file tree
Showing 167 changed files with 7,634 additions and 7,226 deletions.
11 changes: 6 additions & 5 deletions src/Coordinate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Coordinate::Coordinate(const Kernel::FT &x, const Kernel::FT &y,
{
}


///
///
///
Expand Down Expand Up @@ -262,7 +261,6 @@ class RoundVisitor : public boost::static_visitor<> {
return Kernel::FT(
CGAL::Gmpq(SFCGAL::round(v.exact() * _scaleFactor), _scaleFactor));
#endif

}
};

Expand Down Expand Up @@ -356,22 +354,25 @@ Coordinate::operator<(const Coordinate &other) const -> bool
// comparison along x
if (x() < other.x()) {
return true;
} if (other.x() < x()) {
}
if (other.x() < x()) {
return false;
}

// comparison along y
if (y() < other.y()) {
return true;
} if (other.y() < y()) {
}
if (other.y() < y()) {
return false;
}

// comparison along z if possible
if (is3D()) {
if (z() < other.z()) {
return true;
} if (other.z() < z()) {
}
if (other.z() < z()) {
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/GeometryCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace SFCGAL {
///
///
///
GeometryCollection::GeometryCollection() = default;
GeometryCollection::GeometryCollection() = default;

///
///
Expand Down Expand Up @@ -90,8 +90,8 @@ GeometryCollection::coordinateDimension() const -> int
{
if (isEmpty()) {
return 0;
} return _geometries.front().coordinateDimension();

}
return _geometries.front().coordinateDimension();
}

///
Expand Down
10 changes: 5 additions & 5 deletions src/LineString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace SFCGAL {
///
///
///
LineString::LineString() = default;
LineString::LineString() = default;

///
///
///
LineString::LineString(const std::vector<Point> &points)
LineString::LineString(const std::vector<Point> &points)
{
for (const auto &point : points) {
_points.push_back(point.clone());
Expand All @@ -26,7 +26,7 @@ LineString::LineString(const std::vector<Point> &points)
///
///
LineString::LineString(const Point &startPoint, const Point &endPoint)

{
_points.push_back(startPoint.clone());
_points.push_back(endPoint.clone());
Expand Down Expand Up @@ -154,8 +154,8 @@ LineString::numSegments() const -> size_t
{
if (_points.empty()) {
return 0;
} return _points.size() - 1;

}
return _points.size() - 1;
}

///
Expand Down
2 changes: 1 addition & 1 deletion src/MultiLineString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace SFCGAL {
///
///
///
MultiLineString::MultiLineString() = default;
MultiLineString::MultiLineString() = default;

///
///
Expand Down
2 changes: 1 addition & 1 deletion src/MultiPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace SFCGAL {
///
///
///
MultiPoint::MultiPoint() = default;
MultiPoint::MultiPoint() = default;

///
///
Expand Down
2 changes: 1 addition & 1 deletion src/MultiPolygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace SFCGAL {
///
///
///
MultiPolygon::MultiPolygon() = default;
MultiPolygon::MultiPolygon() = default;

///
///
Expand Down
2 changes: 1 addition & 1 deletion src/MultiSolid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace SFCGAL {
///
///
///
MultiSolid::MultiSolid() = default;
MultiSolid::MultiSolid() = default;

///
///
Expand Down
16 changes: 7 additions & 9 deletions src/Polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace SFCGAL {
///
///
///
Polygon::Polygon() { _rings.push_back(new LineString()); }
Polygon::Polygon() { _rings.push_back(new LineString()); }

///
///
///
Polygon::Polygon(const std::vector<LineString> &rings)
Polygon::Polygon(const std::vector<LineString> &rings)
{
if (rings.empty()) {
_rings.resize(1, new LineString());
Expand All @@ -32,23 +32,20 @@ Polygon::Polygon(const std::vector<LineString> &rings)
///
///
///
Polygon::Polygon(const LineString &exteriorRing)
Polygon::Polygon(const LineString &exteriorRing)
{
_rings.push_back(exteriorRing.clone());
}

///
///
///
Polygon::Polygon(LineString *exteriorRing)
{
_rings.push_back(exteriorRing);
}
Polygon::Polygon(LineString *exteriorRing) { _rings.push_back(exteriorRing); }

///
///
///
Polygon::Polygon(const Triangle &triangle)
Polygon::Polygon(const Triangle &triangle)
{
_rings.push_back(new LineString());

Expand Down Expand Up @@ -255,7 +252,8 @@ Polygon::toPolygon_with_holes_2(bool fixOrientation) const
holes.push_back(inner);
}

CGAL::Polygon_2<Kernel> const outer = exteriorRing().toPolygon_2(fixOrientation);
CGAL::Polygon_2<Kernel> const outer =
exteriorRing().toPolygon_2(fixOrientation);
return CGAL::Polygon_with_holes_2<Kernel>(outer, holes.begin(), holes.end());
}

Expand Down
23 changes: 12 additions & 11 deletions src/PolyhedralSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ namespace SFCGAL {
///
///
///
PolyhedralSurface::PolyhedralSurface() = default;
PolyhedralSurface::PolyhedralSurface() = default;

///
///
///
PolyhedralSurface::PolyhedralSurface(const std::vector<Polygon> &polygons)

{
for (const auto &polygon : polygons) {
_polygons.push_back(polygon.clone());
Expand All @@ -35,7 +35,7 @@ PolyhedralSurface::PolyhedralSurface(const PolyhedralSurface &other)
///
///
///
PolyhedralSurface::PolyhedralSurface(const MarkedPolyhedron &poly)
PolyhedralSurface::PolyhedralSurface(const MarkedPolyhedron &poly)
{
for (MarkedPolyhedron::Facet_const_iterator fit = poly.facets_begin();
fit != poly.facets_end(); ++fit) {
Expand All @@ -57,13 +57,14 @@ PolyhedralSurface::PolyhedralSurface(const MarkedPolyhedron &poly)
///
///
///
PolyhedralSurface::PolyhedralSurface(const Mesh &sm)
PolyhedralSurface::PolyhedralSurface(const Mesh &sm)
{

using vertex_descriptor = Mesh::Vertex_index;
for (auto face : sm.faces()) {
auto *new_face = new LineString();
for (vertex_descriptor const vd : vertices_around_face(sm.halfedge(face), sm)) {
for (vertex_descriptor const vd :
vertices_around_face(sm.halfedge(face), sm)) {
new_face->addPoint(Point(sm.point(vd)));
}

Expand Down Expand Up @@ -131,8 +132,8 @@ PolyhedralSurface::coordinateDimension() const -> int
{
if (isEmpty()) {
return 0;
} return _polygons.front().coordinateDimension();

}
return _polygons.front().coordinateDimension();
}

///
Expand All @@ -152,8 +153,8 @@ PolyhedralSurface::is3D() const -> bool
{
if (isEmpty()) {
return false;
} return _polygons.front().is3D();

}
return _polygons.front().is3D();
}

///
Expand All @@ -164,8 +165,8 @@ PolyhedralSurface::isMeasured() const -> bool
{
if (isEmpty()) {
return false;
} return _polygons.front().isMeasured();

}
return _polygons.front().isMeasured();
}

///
Expand Down
2 changes: 1 addition & 1 deletion src/Surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Surface::dimension() const -> int
///
///
///
Surface::Surface() = default;
Surface::Surface() = default;

///
///
Expand Down
4 changes: 2 additions & 2 deletions src/Triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace SFCGAL {
///
///
///
Triangle::Triangle()
Triangle::Triangle()
{
_vertices[0] = Point();
_vertices[1] = Point();
Expand Down Expand Up @@ -42,7 +42,7 @@ Triangle::Triangle(const Kernel::Triangle_3 &triangle)
///
///
///
Triangle::Triangle(const Point &p, const Point &q, const Point &r)
Triangle::Triangle(const Point &p, const Point &q, const Point &r)
{
_vertices[0] = p;
_vertices[1] = q;
Expand Down
14 changes: 7 additions & 7 deletions src/TriangulatedSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ namespace SFCGAL {
///
///
///
TriangulatedSurface::TriangulatedSurface() = default;
TriangulatedSurface::TriangulatedSurface() = default;

///
///
///
TriangulatedSurface::TriangulatedSurface(const std::vector<Triangle> &triangles)

{
for (const auto &triangle : triangles) {
_triangles.push_back(triangle.clone());
Expand Down Expand Up @@ -91,8 +91,8 @@ TriangulatedSurface::coordinateDimension() const -> int
{
if (_triangles.empty()) {
return 0;
} return _triangles[0].coordinateDimension();

}
return _triangles[0].coordinateDimension();
}

///
Expand Down Expand Up @@ -237,9 +237,9 @@ class Triangulated2Polyhedron : public CGAL::Modifier_base<HDS> {
for (size_t i = 0; i < surf.numGeometries(); i++) {
B.begin_facet();
CGAL::Triangle_3<K> const tri(surf.geometryN(i).toTriangle_3());
CGAL::Point_3<K> const pa(tri[0]);
CGAL::Point_3<K> const pb(tri[1]);
CGAL::Point_3<K> const pc(tri[2]);
CGAL::Point_3<K> const pa(tri[0]);
CGAL::Point_3<K> const pb(tri[1]);
CGAL::Point_3<K> const pc(tri[2]);

if (edges.find(std::make_pair(pa, pb)) != edges.end() ||
edges.find(std::make_pair(pb, pc)) != edges.end() ||
Expand Down
6 changes: 3 additions & 3 deletions src/algorithm/BoundaryVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ BoundaryVisitor::releaseBoundary() -> Geometry *
{
if (_boundary != nullptr) {
return _boundary.release();
} return new GeometryCollection();

}
return new GeometryCollection();
}

///
Expand Down Expand Up @@ -299,4 +299,4 @@ BoundaryVisitor::getBoundaryFromPolygons(const graph::GeometryGraph &g)
}
}

} // namespace SFCGAL
} // namespace SFCGAL::algorithm
4 changes: 2 additions & 2 deletions src/algorithm/ConsistentOrientationBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace SFCGAL::algorithm {
///
///
ConsistentOrientationBuilder::ConsistentOrientationBuilder()
: _graph(), _graphBuilder(_graph)
: _graph(), _graphBuilder(_graph)
{
}

Expand Down Expand Up @@ -207,4 +207,4 @@ ConsistentOrientationBuilder::_findNextTriangle() -> int
return result;
}

} // namespace SFCGAL
} // namespace SFCGAL::algorithm
Loading

0 comments on commit a613532

Please sign in to comment.