mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
CppCheck : Add const reference and remove unused variable
This commit is contained in:
@@ -452,12 +452,10 @@ std::pair<cvf::Vec3d, cvf::Vec3d> RigCellGeometryTools::getLineThroughBoundingBo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCellGeometryTools::getLengthOfPolygonAlongLine(std::pair<cvf::Vec3d, cvf::Vec3d> line, std::vector<cvf::Vec3d> polygon)
|
||||
double RigCellGeometryTools::getLengthOfPolygonAlongLine(const std::pair<cvf::Vec3d, cvf::Vec3d>& line, const std::vector<cvf::Vec3d>& polygon)
|
||||
{
|
||||
cvf::BoundingBox lineBoundingBox;
|
||||
|
||||
std::vector<cvf::Vec3d> pointsOnLine;
|
||||
|
||||
for (cvf::Vec3d polygonPoint : polygon)
|
||||
{
|
||||
cvf::Vec3d pointOnLine = cvf::GeometryTools::projectPointOnLine(line.first, line.second, polygonPoint, nullptr);
|
||||
@@ -465,6 +463,7 @@ double RigCellGeometryTools::getLengthOfPolygonAlongLine(std::pair<cvf::Vec3d, c
|
||||
}
|
||||
|
||||
double length = lineBoundingBox.extent().length();
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
static std::pair<cvf::Vec3d, cvf::Vec3d> getLineThroughBoundingBox(cvf::Vec3d lineDirection, cvf::BoundingBox polygonBBox, cvf::Vec3d pointOnLine);
|
||||
|
||||
static double getLengthOfPolygonAlongLine(std::pair<cvf::Vec3d, cvf::Vec3d> line, std::vector<cvf::Vec3d> polygon);
|
||||
static double getLengthOfPolygonAlongLine(const std::pair<cvf::Vec3d, cvf::Vec3d>& line, const std::vector<cvf::Vec3d>& polygon);
|
||||
|
||||
private:
|
||||
static std::vector<cvf::Vec3d> ajustPolygonToAvoidIntersectionsAtVertex(const std::vector<cvf::Vec3d>& polyLine,
|
||||
|
||||
Reference in New Issue
Block a user