mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#166) Added storage of interpolation metadata
This commit is contained in:
parent
74f0251ee9
commit
227eba0325
@ -1060,8 +1060,8 @@ void RivCrossSectionGeometryGenerator::calculateArrays()
|
|||||||
p2Plane.setFromPoints(p2, p2 + m_extrusionDirection*maxSectionHeight, p2 - plane.normal() );
|
p2Plane.setFromPoints(p2, p2 + m_extrusionDirection*maxSectionHeight, p2 - plane.normal() );
|
||||||
|
|
||||||
|
|
||||||
std::vector<ClipVx> triangleVxes;
|
std::vector<ClipVx> triangleClipVxes;
|
||||||
triangleVxes.reserve(5*3);
|
triangleClipVxes.reserve(5*3);
|
||||||
std::vector<bool> isTriangleEdgeCellContour;
|
std::vector<bool> isTriangleEdgeCellContour;
|
||||||
isTriangleEdgeCellContour.reserve(5*3);
|
isTriangleEdgeCellContour.reserve(5*3);
|
||||||
|
|
||||||
@ -1071,7 +1071,7 @@ void RivCrossSectionGeometryGenerator::calculateArrays()
|
|||||||
|
|
||||||
if (m_mainGrid->cells()[globalCellIdx].isInvalid()) continue;
|
if (m_mainGrid->cells()[globalCellIdx].isInvalid()) continue;
|
||||||
|
|
||||||
triangleVxes.clear();
|
triangleClipVxes.clear();
|
||||||
cvf::Vec3d cellCorners[8];
|
cvf::Vec3d cellCorners[8];
|
||||||
m_mainGrid->cellCornerVertices(globalCellIdx, cellCorners);
|
m_mainGrid->cellCornerVertices(globalCellIdx, cellCorners);
|
||||||
|
|
||||||
@ -1089,7 +1089,7 @@ void RivCrossSectionGeometryGenerator::calculateArrays()
|
|||||||
int triangleCount = planeHexIntersectionMC(plane,
|
int triangleCount = planeHexIntersectionMC(plane,
|
||||||
cellCorners,
|
cellCorners,
|
||||||
hexCornersIds,
|
hexCornersIds,
|
||||||
&triangleVxes,
|
&triangleClipVxes,
|
||||||
&isTriangleEdgeCellContour);
|
&isTriangleEdgeCellContour);
|
||||||
|
|
||||||
|
|
||||||
@ -1110,7 +1110,7 @@ void RivCrossSectionGeometryGenerator::calculateArrays()
|
|||||||
std::vector<ClipVx> clippedTriangleVxes;
|
std::vector<ClipVx> clippedTriangleVxes;
|
||||||
std::vector<bool> isClippedTriEdgeCellContour;
|
std::vector<bool> isClippedTriEdgeCellContour;
|
||||||
|
|
||||||
clipTrianglesBetweenTwoParallelPlanes(triangleVxes, isTriangleEdgeCellContour, p1Plane, p2Plane, &clippedTriangleVxes, &isClippedTriEdgeCellContour);
|
clipTrianglesBetweenTwoParallelPlanes(triangleClipVxes, isTriangleEdgeCellContour, p1Plane, p2Plane, &clippedTriangleVxes, &isClippedTriEdgeCellContour);
|
||||||
|
|
||||||
int clippedTriangleCount = static_cast<int>(clippedTriangleVxes.size())/3;
|
int clippedTriangleCount = static_cast<int>(clippedTriangleVxes.size())/3;
|
||||||
|
|
||||||
@ -1150,7 +1150,28 @@ void RivCrossSectionGeometryGenerator::calculateArrays()
|
|||||||
|
|
||||||
m_triangleToCellIdxMap.push_back(globalCellIdx);
|
m_triangleToCellIdxMap.push_back(globalCellIdx);
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
ClipVx cvx = clippedTriangleVxes[triVxIdx+i];
|
||||||
|
if (cvx.isVxIdsNative)
|
||||||
|
{
|
||||||
|
m_triangleVxInterPolationData.push_back(
|
||||||
|
VxInterPolData(cvx.clippedEdgeVx1Id, cvx.clippedEdgeVx2Id, cvx.normDistFromEdgeVx1,
|
||||||
|
-1, -1, 0.0,
|
||||||
|
0.0));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClipVx cvx1 = triangleClipVxes[cvx.clippedEdgeVx1Id];
|
||||||
|
ClipVx cvx2 = triangleClipVxes[cvx.clippedEdgeVx2Id];
|
||||||
|
|
||||||
|
m_triangleVxInterPolationData.push_back(
|
||||||
|
VxInterPolData(cvx1.clippedEdgeVx1Id, cvx1.clippedEdgeVx2Id, cvx1.normDistFromEdgeVx1,
|
||||||
|
cvx2.clippedEdgeVx1Id, cvx2.clippedEdgeVx2Id, cvx2.normDistFromEdgeVx1,
|
||||||
|
cvx.normDistFromEdgeVx1));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -62,14 +62,43 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
void adjustPolyline();
|
void adjustPolyline();
|
||||||
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
|
||||||
cvf::ref<cvf::Vec3fArray> m_cellBorderLineVxes;
|
|
||||||
|
|
||||||
std::vector<size_t> m_triangleToCellIdxMap;
|
|
||||||
|
|
||||||
cvf::cref<RigMainGrid> m_mainGrid;
|
cvf::cref<RigMainGrid> m_mainGrid;
|
||||||
std::vector<cvf::Vec3d> m_polyLine;
|
std::vector<cvf::Vec3d> m_polyLine;
|
||||||
cvf::Vec3d m_extrusionDirection;
|
cvf::Vec3d m_extrusionDirection;
|
||||||
std::vector<cvf::Vec3d> m_adjustedPolyline;
|
std::vector<cvf::Vec3d> m_adjustedPolyline;
|
||||||
|
|
||||||
|
// Output arrays
|
||||||
|
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
||||||
|
cvf::ref<cvf::Vec3fArray> m_cellBorderLineVxes;
|
||||||
|
std::vector<size_t> m_triangleToCellIdxMap;
|
||||||
|
|
||||||
|
struct VxInterPolData
|
||||||
|
{
|
||||||
|
explicit VxInterPolData(int vx1, int vx2, double normDistFrom1,
|
||||||
|
int vx3, int vx4, double normDistFrom3,
|
||||||
|
double normDistFrom12)
|
||||||
|
: vx1Id(vx1),
|
||||||
|
weight1((float)(1.0 - normDistFrom1 - normDistFrom12 + normDistFrom1*normDistFrom12)),
|
||||||
|
vx2Id(vx2),
|
||||||
|
weight2((float)(normDistFrom1 - normDistFrom1*normDistFrom12)),
|
||||||
|
vx3Id(vx3),
|
||||||
|
weight3((float)(normDistFrom12 - normDistFrom3*normDistFrom12)),
|
||||||
|
vx4Id(vx4),
|
||||||
|
weight4((float)(normDistFrom3*normDistFrom12))
|
||||||
|
{}
|
||||||
|
|
||||||
|
int vx1Id;
|
||||||
|
float weight1;
|
||||||
|
int vx2Id;
|
||||||
|
float weight2;
|
||||||
|
|
||||||
|
int vx3Id;
|
||||||
|
float weight3;
|
||||||
|
int vx4Id;
|
||||||
|
float weight4;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector<VxInterPolData> m_triangleVxInterPolationData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user