Skip to content
Snippets Groups Projects
Commit 12f9c5e8 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

clang-format

parent a49d0a64
No related branches found
No related tags found
No related merge requests found
...@@ -211,7 +211,8 @@ void GEOModels::connectPolylineSegments( ...@@ -211,7 +211,8 @@ void GEOModels::connectPolylineSegments(
INFO( INFO(
"Creating a surface by triangulation of the polyline " "Creating a surface by triangulation of the polyline "
"..."); "...");
if (GeoLib::Surface* sfc = FileIO::createSurfaceWithEarClipping(*new_line)) if (GeoLib::Surface* sfc =
FileIO::createSurfaceWithEarClipping(*new_line))
{ {
std::vector<GeoLib::Surface*> new_sfc; std::vector<GeoLib::Surface*> new_sfc;
new_sfc.push_back(sfc); new_sfc.push_back(sfc);
......
...@@ -95,7 +95,8 @@ public slots: ...@@ -95,7 +95,8 @@ public slots:
std::vector<std::size_t> const& indexlist, std::vector<std::size_t> const& indexlist,
double const proximity, double const proximity,
std::string const& ply_name, std::string const& ply_name,
bool const closePly, bool const triangulatePly); bool const closePly,
bool const triangulatePly);
protected: protected:
GeoTreeModel* _geoModel; GeoTreeModel* _geoModel;
......
...@@ -109,8 +109,8 @@ void EarClippingTriangulation::ensureCWOrientation() ...@@ -109,8 +109,8 @@ void EarClippingTriangulation::ensureCWOrientation()
{ {
_original_orientation = _original_orientation =
GeoLib::getOrientation(*_pnts[min_x_max_y_idx - 1], GeoLib::getOrientation(*_pnts[min_x_max_y_idx - 1],
*_pnts[min_x_max_y_idx], *_pnts[min_x_max_y_idx],
*_pnts[min_x_max_y_idx + 1]); *_pnts[min_x_max_y_idx + 1]);
} }
else else
{ {
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
namespace GeoLib namespace GeoLib
{ {
class Polygon; class Polygon;
class Triangle; class Triangle;
...@@ -29,7 +28,7 @@ class EarClippingTriangulation final ...@@ -29,7 +28,7 @@ class EarClippingTriangulation final
{ {
public: public:
EarClippingTriangulation(GeoLib::Polygon const& polygon, EarClippingTriangulation(GeoLib::Polygon const& polygon,
std::list<GeoLib::Triangle> &triangles, std::list<GeoLib::Triangle>& triangles,
bool rot = true); bool rot = true);
~EarClippingTriangulation(); ~EarClippingTriangulation();
...@@ -38,13 +37,13 @@ private: ...@@ -38,13 +37,13 @@ private:
* copies the points of the polygon to the vector _pnts * copies the points of the polygon to the vector _pnts
*/ */
inline void copyPolygonPoints(GeoLib::Polygon const& polygon); inline void copyPolygonPoints(GeoLib::Polygon const& polygon);
inline void ensureCWOrientation (); inline void ensureCWOrientation();
inline bool isEar(std::size_t v0, std::size_t v1, std::size_t v2) const; inline bool isEar(std::size_t v0, std::size_t v1, std::size_t v2) const;
inline void initVertexList (); inline void initVertexList();
inline void initLists (); inline void initLists();
inline void clipEars (); inline void clipEars();
/** /**
* a copy of the polygon points * a copy of the polygon points
...@@ -61,4 +60,4 @@ private: ...@@ -61,4 +60,4 @@ private:
GeoLib::Orientation _original_orientation; GeoLib::Orientation _original_orientation;
}; };
} // end namespace GeoLib } // end namespace GeoLib
...@@ -100,7 +100,8 @@ public: ...@@ -100,7 +100,8 @@ public:
GeoLib::Point& intersection_pnt, GeoLib::Point& intersection_pnt,
std::size_t& seg_num) const; std::size_t& seg_num) const;
/// Subdivides a self-intersecting polygon into a list of non-intersecting shapes. /// Subdivides a self-intersecting polygon into a list of non-intersecting
/// shapes.
std::list<Polygon*> const& computeListOfSimplePolygons(); std::list<Polygon*> const& computeListOfSimplePolygons();
friend bool operator==(Polygon const& lhs, Polygon const& rhs); friend bool operator==(Polygon const& lhs, Polygon const& rhs);
......
...@@ -32,7 +32,8 @@ TEST(TestEarClipping, TestEarClippingPolygons) ...@@ -32,7 +32,8 @@ TEST(TestEarClipping, TestEarClippingPolygons)
ASSERT_EQ(4, polygons.size()); ASSERT_EQ(4, polygons.size());
for (auto polygon : polygons) for (auto polygon : polygons)
{ {
std::unique_ptr<GeoLib::Surface> sfc (FileIO::createSurfaceWithEarClipping(*polygon)); std::unique_ptr<GeoLib::Surface> sfc(
FileIO::createSurfaceWithEarClipping(*polygon));
ASSERT_TRUE(sfc != nullptr); ASSERT_TRUE(sfc != nullptr);
ASSERT_EQ(sfc->getNumberOfTriangles(), ASSERT_EQ(sfc->getNumberOfTriangles(),
polygon->getNumberOfPoints() - 3); polygon->getNumberOfPoints() - 3);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment