#1585 Move more code away from StimPlanTemplate

This commit is contained in:
Jacob Støren 2017-06-12 15:39:28 +02:00
parent 681a3404b4
commit bd03fa4791
3 changed files with 21 additions and 59 deletions

View File

@ -693,11 +693,7 @@ std::vector<std::pair<QString, QString> > RimStimPlanFractureTemplate::getStimPl
std::vector<std::pair<QString, QString> > propertyNamesUnits;
if (m_stimPlanFractureDefinitionData.notNull())
{
std::vector<RigStimPlanResultFrames > allStimPlanData = m_stimPlanFractureDefinitionData->stimPlanData;
for (RigStimPlanResultFrames stimPlanDataEntry : allStimPlanData)
{
propertyNamesUnits.push_back(std::make_pair(stimPlanDataEntry.resultName, stimPlanDataEntry.unit));
}
propertyNamesUnits = m_stimPlanFractureDefinitionData->getStimPlanPropertyNamesUnits();
}
return propertyNamesUnits;
}
@ -714,11 +710,14 @@ void RimStimPlanFractureTemplate::computeMinMax(const QString& resultName, const
}
//--------------------------------------------------------------------------------------------------
///
/// OBSOLETE ! Only used for upscaling code
//--------------------------------------------------------------------------------------------------
void RimStimPlanFractureTemplate::getStimPlanDataAsPolygonsAndValues(std::vector<std::vector<cvf::Vec3d> > &cellsAsPolygons, std::vector<double> &parameterValues, const QString& resultName, const QString& unitName, size_t timeStepIndex)
void RimStimPlanFractureTemplate::getStimPlanDataAsPolygonsAndValues(std::vector<std::vector<cvf::Vec3d> > &cellsAsPolygons,
std::vector<double> &parameterValues,
const QString& resultName,
const QString& unitName,
size_t timeStepIndex)
{
std::vector< std::vector<double> > propertyValuesAtTimeStep = m_stimPlanFractureDefinitionData->getMirroredDataAtTimeIndex(resultName, unitName, timeStepIndex);
cellsAsPolygons.clear();
@ -749,8 +748,6 @@ void RimStimPlanFractureTemplate::getStimPlanDataAsPolygonsAndValues(std::vector
}
}
}
//--------------------------------------------------------------------------------------------------
@ -847,52 +844,6 @@ const RigFractureGrid* RimStimPlanFractureTemplate::fractureGrid() const
return m_fractureGrid.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimStimPlanFractureTemplate::getStimPlanRowPolygon(size_t i) //Row with constant depth
{
std::vector<cvf::Vec3d> rowPolygon;
std::vector<double> depthCoordsAtNodes = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
std::vector<double> xCoordsAtNodes = m_stimPlanFractureDefinitionData->getNegAndPosXcoords();
std::vector<double> xCoords;
for (int i = 0; i < xCoordsAtNodes.size() - 1; i++) xCoords.push_back((xCoordsAtNodes[i] + xCoordsAtNodes[i + 1]) / 2);
std::vector<double> depthCoords;
for (int i = 0; i < depthCoordsAtNodes.size() - 1; i++) depthCoords.push_back((depthCoordsAtNodes[i] + depthCoordsAtNodes[i + 1]) / 2);
rowPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[0]), static_cast<float>(depthCoords[i]), 0.0));
rowPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords.back()), static_cast<float>(depthCoords[i]), 0.0));
rowPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords.back()), static_cast<float>(depthCoords[i+1]), 0.0));
rowPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[0]), static_cast<float>(depthCoords[i+1]), 0.0));
return rowPolygon;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimStimPlanFractureTemplate::getStimPlanColPolygon(size_t j)
{
std::vector<cvf::Vec3d> colPolygon;
std::vector<double> depthCoordsAtNodes = m_stimPlanFractureDefinitionData->adjustedDepthCoordsAroundWellPathPosition(m_wellPathDepthAtFracture());
std::vector<double> xCoordsAtNodes = m_stimPlanFractureDefinitionData->getNegAndPosXcoords();
std::vector<double> xCoords;
for (int i = 0; i < xCoordsAtNodes.size() - 1; i++) xCoords.push_back((xCoordsAtNodes[i] + xCoordsAtNodes[i + 1]) / 2);
std::vector<double> depthCoords;
for (int i = 0; i < depthCoordsAtNodes.size() - 1; i++) depthCoords.push_back((depthCoordsAtNodes[i] + depthCoordsAtNodes[i + 1]) / 2);
colPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j]), static_cast<float>(depthCoords[0]), 0.0));
colPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j+1]), static_cast<float>(depthCoords[0]), 0.0));
colPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j+1]), static_cast<float>(depthCoords.back()), 0.0));
colPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j]), static_cast<float>(depthCoords.back()), 0.0));
return colPolygon;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -76,10 +76,8 @@ public:
void setupStimPlanCells();
const RigFractureGrid* fractureGrid() const;
//Functions used by upscaling only
//Function used by upscaling only
void getStimPlanDataAsPolygonsAndValues(std::vector<std::vector<cvf::Vec3d> > &cellsAsPolygons, std::vector<double> &parameterValue, const QString& resultName, const QString& unitName, size_t timeStepIndex);
std::vector<cvf::Vec3d> getStimPlanRowPolygon(size_t i);
std::vector<cvf::Vec3d> getStimPlanColPolygon(size_t j);
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;

View File

@ -100,6 +100,19 @@ public:
return depthRelativeToWellPath;
}
std::vector<std::pair<QString, QString> > getStimPlanPropertyNamesUnits() const
{
std::vector<std::pair<QString, QString> > propertyNamesUnits;
{
std::vector<RigStimPlanResultFrames > allStimPlanData = this->stimPlanData;
for (RigStimPlanResultFrames stimPlanDataEntry : allStimPlanData)
{
propertyNamesUnits.push_back(std::make_pair(stimPlanDataEntry.resultName, stimPlanDataEntry.unit));
}
}
return propertyNamesUnits;
}
std::vector<std::vector<double>> getMirroredDataAtTimeIndex(const QString& resultName,
const QString& unitName,