Skip to content

Commit

Permalink
Fixing cppcheck/clang format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ggartside committed Feb 24, 2021
1 parent 784f028 commit f2b8d95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
16 changes: 10 additions & 6 deletions src/utilities/geometry/Polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,19 @@ double Polygon3d::getPerimeter() {
}

bool Polygon3d::getIsClockwise() {
return true;

This comment has been minimized.

Copy link
@macumber

macumber Feb 25, 2021

Contributor

Naming conventions say getters with no arguments don't have a get prefix, would be Polygon3d::isClockwise()

OptionalVector3d normal = getOutwardNormal(points);
if (normal == boost::none)
return true;
else
return normal.get().z() > 0;
}

Point3d Polygon3d::getCentroid() {
//boost::optional p = openstudio::getCentroid(points);

This comment has been minimized.

Copy link
@macumber

macumber Feb 25, 2021

Contributor

This would just be Polygon3d::centroid()

//if (p == boost::none)
return Point3d();
//else
// return p.get();
boost::optional p = openstudio::getCentroid(points);
if (p == boost::none)
return Point3d();
else
return p.get();
}

//bool Polygon3d::PointInPolygon(Point3d testPoint) {
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/geometry/Polygon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UTILITIES_API Polygon3d
Polygon3d();
Polygon3d(Point3dVector outerPth);

void setOuterPath(Point3dVector outerPth);
void setOuterPath(Point3dVector outerPath);
Point3dVector getOuterPath() const;
Point3dVectorVector getInnerPaths() const;

Expand Down
5 changes: 0 additions & 5 deletions src/utilities/geometry/Test/Geometry_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,11 +1170,6 @@ TEST_F(GeometryFixture, Polygon_Basic_Angled) {

Vector3d normal = testPolygon.outwardNormal();

auto v1 = normal.x();
auto v2 = normal.y();
auto v3 = normal.z();
auto v4 = normal.length();

EXPECT_NEAR(0.24242, normal.x(), 0.001);
EXPECT_NEAR(0, normal.y(), 0.001);
EXPECT_NEAR(0.97017, normal.z(), 0.001);
Expand Down

0 comments on commit f2b8d95

Please sign in to comment.