#3246 Fracture Visualization: Move fracture coordinates into separate scope

This commit is contained in:
Magne Sjaastad 2018-08-30 08:26:29 +02:00
parent 25b78626be
commit 417ef314b4

View File

@ -324,14 +324,16 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createEllipseSurfacePart(const RimEc
if (m_rimFracture) if (m_rimFracture)
{ {
std::vector<cvf::Vec3f> nodeCoords;
std::vector<cvf::uint> triangleIndices; std::vector<cvf::uint> triangleIndices;
std::vector<cvf::Vec3f> nodeDisplayCoords;
m_rimFracture->fractureTemplate()->fractureTriangleGeometry(&nodeCoords, &triangleIndices); {
std::vector<cvf::Vec3f> nodeCoords;
m_rimFracture->fractureTemplate()->fractureTriangleGeometry(&nodeCoords, &triangleIndices);
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix(); cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
std::vector<cvf::Vec3f> nodeDisplayCoords = nodeDisplayCoords = transformToFractureDisplayCoords(nodeCoords, fractureXf, *displayCoordTransform);
transformToFractureDisplayCoords(nodeCoords, fractureXf, *displayCoordTransform); }
if (triangleIndices.empty() || nodeDisplayCoords.empty()) if (triangleIndices.empty() || nodeDisplayCoords.empty())
{ {
@ -396,18 +398,20 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfa
// Note that the filtering and result mapping code below couples closely to the triangulation and vertex layout returned by // Note that the filtering and result mapping code below couples closely to the triangulation and vertex layout returned by
// triangleGeometry() If this ever changes, the entire code must be revisited // triangleGeometry() If this ever changes, the entire code must be revisited
std::vector<cvf::Vec3f> nodeCoords;
std::vector<cvf::uint> triangleIndices; std::vector<cvf::uint> triangleIndices;
std::vector<cvf::Vec3f> nodeDisplayCoords;
stimPlanFracTemplate->fractureTriangleGeometry(&nodeCoords, &triangleIndices);
if (triangleIndices.empty() || nodeCoords.empty())
{ {
return nullptr; std::vector<cvf::Vec3f> nodeCoords;
} stimPlanFracTemplate->fractureTriangleGeometry(&nodeCoords, &triangleIndices);
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix(); if (triangleIndices.empty() || nodeCoords.empty())
std::vector<cvf::Vec3f> nodeDisplayCoords = transformToFractureDisplayCoords(nodeCoords, fractureXf, *displayCoordTransform); {
return nullptr;
}
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
nodeDisplayCoords = transformToFractureDisplayCoords(nodeCoords, fractureXf, *displayCoordTransform);
}
RimRegularLegendConfig* legendConfig = nullptr; RimRegularLegendConfig* legendConfig = nullptr;
if (activeView.fractureColors() && activeView.fractureColors()->isChecked()) if (activeView.fractureColors() && activeView.fractureColors()->isChecked())
@ -422,7 +426,8 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfa
// Since some time steps don't have result vales, we initialize the array to well known values before populating it // Since some time steps don't have result vales, we initialize the array to well known values before populating it
std::vector<double> perNodeResultValues(nodeDisplayCoords.size(), HUGE_VAL); std::vector<double> perNodeResultValues(nodeDisplayCoords.size(), HUGE_VAL);
{ {
size_t idx = 0; size_t idx = 0;
const std::vector<std::vector<double>> dataToPlot = const std::vector<std::vector<double>> dataToPlot =
stimPlanFracTemplate->resultValues(activeView.fractureColors()->uiResultName(), stimPlanFracTemplate->resultValues(activeView.fractureColors()->uiResultName(),
activeView.fractureColors()->unit(), activeView.fractureColors()->unit(),