Whitespace and function headers, move implementation to header

This commit is contained in:
Magne Sjaastad 2018-01-16 08:02:40 +01:00
parent 2457f968cf
commit 424c6a46f6
2 changed files with 21 additions and 6 deletions

View File

@ -35,7 +35,10 @@
#include <cmath> #include <cmath>
RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, RimFracture* rimFracture) //--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, const RimFracture* rimFracture)
{ {
std::vector<cvf::Vec3d> wellPathPoints = wellpathGeom->wellPathPointsIncludingInterpolatedIntersectionPoint(rimFracture->fractureMD()); std::vector<cvf::Vec3d> wellPathPoints = wellpathGeom->wellPathPointsIncludingInterpolatedIntersectionPoint(rimFracture->fractureMD());
cvf::Mat4d fractureXf = rimFracture->transformMatrix(); cvf::Mat4d fractureXf = rimFracture->transformMatrix();
@ -53,13 +56,19 @@ RigWellPathStimplanIntersector::RigWellPathStimplanIntersector(const RigWellPath
double perforationLength = rimFracture->perforationLength(); double perforationLength = rimFracture->perforationLength();
calculate(fractureXf, wellPathPoints, wellRadius, perforationLength, stpCellPolygons, m_stimPlanCellIdxToIntersectionInfoMap); calculate(fractureXf, wellPathPoints, wellRadius, perforationLength, stpCellPolygons, m_stimPlanCellIdxToIntersectionInfoMap);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::map<size_t, RigWellPathStimplanIntersector::RigWellPathStimplanIntersector::WellCellIntersection >& RigWellPathStimplanIntersector::intersections() const
{
return m_stimPlanCellIdxToIntersectionInfoMap;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Todo: Use only the perforated parts of the well path /// Todo: Use only the perforated parts of the well path
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigWellPathStimplanIntersector::calculate(const cvf::Mat4d &fractureXf, void RigWellPathStimplanIntersector::calculate(const cvf::Mat4d &fractureXf,
const std::vector<cvf::Vec3d>& wellPathPointsOrg, const std::vector<cvf::Vec3d>& wellPathPointsOrg,
double wellRadius, double wellRadius,
@ -178,7 +187,7 @@ void RigWellPathStimplanIntersector::calculate(const cvf::Mat4d &fractureXf,
currentIntersectingWpPart.push_back(part.back()); currentIntersectingWpPart.push_back(part.back());
} }
if ( currentIntersectingWpPart.size() ) if ( !currentIntersectingWpPart.empty() )
{ {
intersectingWellPathParts.push_back(currentIntersectingWpPart); intersectingWellPathParts.push_back(currentIntersectingWpPart);
} }
@ -197,7 +206,7 @@ void RigWellPathStimplanIntersector::calculate(const cvf::Mat4d &fractureXf,
RigCellGeometryTools::USE_HUGEVAL); RigCellGeometryTools::USE_HUGEVAL);
for ( const auto& wellPathPartInCell: wellPathPartsInPolygon ) for ( const auto& wellPathPartInCell: wellPathPartsInPolygon )
{ {
if ( wellPathPartInCell.size() ) if ( !wellPathPartInCell.empty() )
{ {
int endpointCount = 0; int endpointCount = 0;
if ( wellPathPartInCell.front().z() != HUGE_VAL ) ++endpointCount; if ( wellPathPartInCell.front().z() != HUGE_VAL ) ++endpointCount;

View File

@ -29,6 +29,9 @@ class RimFracture;
class RigWellPathStimplanIntersectorTester; class RigWellPathStimplanIntersectorTester;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RigWellPathStimplanIntersector class RigWellPathStimplanIntersector
{ {
public: public:
@ -40,9 +43,9 @@ public:
int endpointCount; int endpointCount;
}; };
RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, RimFracture * rimFracture); RigWellPathStimplanIntersector(const RigWellPath* wellpathGeom, const RimFracture* rimFracture);
const std::map<size_t, WellCellIntersection >& intersections() { return m_stimPlanCellIdxToIntersectionInfoMap; } const std::map<size_t, WellCellIntersection >& intersections() const;
private: private:
friend class RigWellPathStimplanIntersectorTester; friend class RigWellPathStimplanIntersectorTester;
@ -57,6 +60,9 @@ private:
}; };
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RigWellPathStimplanIntersectorTester class RigWellPathStimplanIntersectorTester
{ {
public: public: