mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
clang-format: Set column width to 140
* Set column width to 140 * Use c++20 * Remove redundant virtual
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivBoxIntersectionGeometryGenerator::RivBoxIntersectionGeometryGenerator( RimBoxIntersection* intersectionBox,
|
||||
RivBoxIntersectionGeometryGenerator::RivBoxIntersectionGeometryGenerator( RimBoxIntersection* intersectionBox,
|
||||
const RivIntersectionHexGridInterface* grid )
|
||||
: m_intersectionBoxDefinition( intersectionBox )
|
||||
, m_hexGrid( grid )
|
||||
@@ -113,8 +113,7 @@ const std::vector<size_t>& RivBoxIntersectionGeometryGenerator::triangleToCellIn
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RivIntersectionVertexWeights>&
|
||||
RivBoxIntersectionGeometryGenerator::triangleVxToCellCornerInterpolationWeights() const
|
||||
const std::vector<RivIntersectionVertexWeights>& RivBoxIntersectionGeometryGenerator::triangleVxToCellCornerInterpolationWeights() const
|
||||
{
|
||||
CVF_ASSERT( m_triangleVxes->size() );
|
||||
return m_triVxToCellCornerWeights;
|
||||
@@ -214,7 +213,7 @@ public:
|
||||
|
||||
std::array<FaceType, 4> adjacentFaces( FaceType face )
|
||||
{
|
||||
std::array<FaceType, 4> clipFaces = { FaceType::NO_FACE, FaceType::NO_FACE, FaceType::NO_FACE, FaceType::NO_FACE };
|
||||
std::array<FaceType, 4> clipFaces = { FaceType::NO_FACE, FaceType::NO_FACE, FaceType::NO_FACE, FaceType::NO_FACE };
|
||||
FaceType oppFace = cvf::StructGridInterface::oppositeFace( face );
|
||||
int clipFaceCount = 0;
|
||||
for ( int faceCand = 0; faceCand < 6; ++faceCand )
|
||||
@@ -394,9 +393,8 @@ void RivBoxIntersectionGeometryGenerator::calculateArrays()
|
||||
caf::HexGridIntersectionTools::ClipVx cvx = clippedTriangleVxes[triVxIdx + i];
|
||||
if ( cvx.isVxIdsNative )
|
||||
{
|
||||
m_triVxToCellCornerWeights.push_back( RivIntersectionVertexWeights( cvx.clippedEdgeVx1Id,
|
||||
cvx.clippedEdgeVx2Id,
|
||||
cvx.normDistFromEdgeVx1 ) );
|
||||
m_triVxToCellCornerWeights.push_back(
|
||||
RivIntersectionVertexWeights( cvx.clippedEdgeVx1Id, cvx.clippedEdgeVx2Id, cvx.normDistFromEdgeVx1 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -475,25 +473,23 @@ void RivBoxIntersectionGeometryGenerator::calculateArrays()
|
||||
CVF_ASSERT( false );
|
||||
}
|
||||
|
||||
CVF_TIGHT_ASSERT( cvx11.isVxIdsNative && cvx12.isVxIdsNative && cvx21.isVxIdsNative &&
|
||||
cvx22.isVxIdsNative );
|
||||
CVF_TIGHT_ASSERT( cvx11.isVxIdsNative && cvx12.isVxIdsNative && cvx21.isVxIdsNative && cvx22.isVxIdsNative );
|
||||
|
||||
m_triVxToCellCornerWeights.push_back(
|
||||
RivIntersectionVertexWeights( cvx11.clippedEdgeVx1Id,
|
||||
cvx11.clippedEdgeVx2Id,
|
||||
cvx11.normDistFromEdgeVx1,
|
||||
cvx12.clippedEdgeVx1Id,
|
||||
cvx12.clippedEdgeVx2Id,
|
||||
cvx2.normDistFromEdgeVx1,
|
||||
cvx21.clippedEdgeVx1Id,
|
||||
cvx21.clippedEdgeVx2Id,
|
||||
cvx21.normDistFromEdgeVx1,
|
||||
cvx22.clippedEdgeVx1Id,
|
||||
cvx22.clippedEdgeVx2Id,
|
||||
cvx22.normDistFromEdgeVx1,
|
||||
cvx1.normDistFromEdgeVx1,
|
||||
cvx2.normDistFromEdgeVx1,
|
||||
cvx.normDistFromEdgeVx1 ) );
|
||||
m_triVxToCellCornerWeights.push_back( RivIntersectionVertexWeights( cvx11.clippedEdgeVx1Id,
|
||||
cvx11.clippedEdgeVx2Id,
|
||||
cvx11.normDistFromEdgeVx1,
|
||||
cvx12.clippedEdgeVx1Id,
|
||||
cvx12.clippedEdgeVx2Id,
|
||||
cvx2.normDistFromEdgeVx1,
|
||||
cvx21.clippedEdgeVx1Id,
|
||||
cvx21.clippedEdgeVx2Id,
|
||||
cvx21.normDistFromEdgeVx1,
|
||||
cvx22.clippedEdgeVx1Id,
|
||||
cvx22.clippedEdgeVx2Id,
|
||||
cvx22.normDistFromEdgeVx1,
|
||||
cvx1.normDistFromEdgeVx1,
|
||||
cvx2.normDistFromEdgeVx1,
|
||||
cvx.normDistFromEdgeVx1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ RivBoxIntersectionPartMgr::RivBoxIntersectionPartMgr( RimBoxIntersection* inters
|
||||
m_intersectionBoxFacesTextureCoords = new cvf::Vec2fArray;
|
||||
|
||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = intersectionBox->createHexGridInterface();
|
||||
m_intersectionBoxGenerator = new RivBoxIntersectionGeometryGenerator( m_rimIntersectionBox, hexGrid.p() );
|
||||
m_intersectionBoxGenerator = new RivBoxIntersectionGeometryGenerator( m_rimIntersectionBox, hexGrid.p() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -185,8 +185,7 @@ void RivBoxIntersectionPartMgr::updatePartEffect()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivBoxIntersectionPartMgr::appendNativeIntersectionFacesToModel( cvf::ModelBasicList* model,
|
||||
cvf::Transform* scaleTransform )
|
||||
void RivBoxIntersectionPartMgr::appendNativeIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
if ( m_intersectionBoxFaces.isNull() && m_intersectionBoxGridLines.isNull() )
|
||||
{
|
||||
|
@@ -25,9 +25,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivEclipseIntersectionGrid::RivEclipseIntersectionGrid( const RigMainGrid* mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool showInactiveCells )
|
||||
RivEclipseIntersectionGrid::RivEclipseIntersectionGrid( const RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool showInactiveCells )
|
||||
: m_mainGrid( mainGrid )
|
||||
, m_activeCellInfo( activeCellInfo )
|
||||
, m_showInactiveCells( showInactiveCells )
|
||||
@@ -53,8 +51,7 @@ cvf::BoundingBox RivEclipseIntersectionGrid::boundingBox() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivEclipseIntersectionGrid::findIntersectingCells( const cvf::BoundingBox& intersectingBB,
|
||||
std::vector<size_t>* intersectedCells ) const
|
||||
void RivEclipseIntersectionGrid::findIntersectingCells( const cvf::BoundingBox& intersectingBB, std::vector<size_t>* intersectedCells ) const
|
||||
{
|
||||
m_mainGrid->findIntersectingCells( intersectingBB, intersectedCells );
|
||||
}
|
||||
@@ -95,7 +92,7 @@ void RivEclipseIntersectionGrid::cellCornerIndices( size_t cellIndex, size_t cor
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigFault* RivEclipseIntersectionGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
const RigFault* RivEclipseIntersectionGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType face ) const
|
||||
{
|
||||
return m_mainGrid->findFaultFromCellIndexAndCellFace( reservoirCellIndex, face );
|
||||
|
@@ -40,13 +40,11 @@ public:
|
||||
|
||||
cvf::Vec3d displayOffset() const override;
|
||||
cvf::BoundingBox boundingBox() const override;
|
||||
void findIntersectingCells( const cvf::BoundingBox& intersectingBB,
|
||||
std::vector<size_t>* intersectedCells ) const override;
|
||||
void findIntersectingCells( const cvf::BoundingBox& intersectingBB, std::vector<size_t>* intersectedCells ) const override;
|
||||
bool useCell( size_t cellIndex ) const override;
|
||||
void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override;
|
||||
void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override;
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType face ) const override;
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override;
|
||||
|
||||
private:
|
||||
cvf::cref<RigMainGrid> m_mainGrid;
|
||||
|
@@ -63,13 +63,12 @@ cvf::ref<caf::DisplayCoordTransform> displayCoordTransform( const RimExtrudedCur
|
||||
/// isFlattened means to transform each flat section of the intersection onto the XZ plane
|
||||
/// placed adjacent to each other as if they were rotated around the common extrusion line like a hinge
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::RivExtrudedCurveIntersectionGeometryGenerator(
|
||||
RimExtrudedCurveIntersection* crossSection,
|
||||
std::vector<std::vector<cvf::Vec3d>>& polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
const RivIntersectionHexGridInterface* grid,
|
||||
bool isFlattened,
|
||||
const cvf::Vec3d& flattenedPolylineStartPoint )
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* crossSection,
|
||||
std::vector<std::vector<cvf::Vec3d>>& polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
const RivIntersectionHexGridInterface* grid,
|
||||
bool isFlattened,
|
||||
const cvf::Vec3d& flattenedPolylineStartPoint )
|
||||
: m_intersection( crossSection )
|
||||
, m_polylines( polylines )
|
||||
, m_extrusionDirection( extrusionDirection )
|
||||
@@ -106,10 +105,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateLineSegementTransfo
|
||||
{
|
||||
startOffset.z() = polyLine[0].z();
|
||||
m_lineSegmentTransforms.emplace_back(
|
||||
RivSectionFlattener::calculateFlatteningCSsForPolyline( polyLine,
|
||||
m_extrusionDirection,
|
||||
startOffset,
|
||||
&startOffset ) );
|
||||
RivSectionFlattener::calculateFlatteningCSsForPolyline( polyLine, m_extrusionDirection, startOffset, &startOffset ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -203,17 +199,15 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateSurfaceIntersection
|
||||
cvf::Vec3d pointBelow = cvf::Vec3d( point.x(), point.y(), -10000.0 );
|
||||
|
||||
cvf::Vec3d intersectionPoint;
|
||||
bool foundMatch = RigSurfaceResampler::resamplePoint( surface, pointAbove, pointBelow, intersectionPoint );
|
||||
bool foundMatch = RigSurfaceResampler::resamplePoint( surface, pointAbove, pointBelow, intersectionPoint );
|
||||
if ( foundMatch )
|
||||
{
|
||||
const size_t lineIndex = 0;
|
||||
transformedSurfacePolyline.push_back(
|
||||
transformPointByPolylineSegmentIndex( intersectionPoint, lineIndex, segmentIndex ) );
|
||||
transformedSurfacePolyline.push_back( transformPointByPolylineSegmentIndex( intersectionPoint, lineIndex, segmentIndex ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !transformedSurfacePolyline.empty() )
|
||||
m_transformedSurfaceIntersectionPolylines[rimSurface] = transformedSurfacePolyline;
|
||||
if ( !transformedSurfacePolyline.empty() ) m_transformedSurfaceIntersectionPolylines[rimSurface] = transformedSurfacePolyline;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,8 +236,7 @@ public:
|
||||
if ( isFace( cellFaceForEachClippedTriangleEdge[triVxIdx] ) )
|
||||
{
|
||||
const RigFault* fault =
|
||||
m_hexGrid->findFaultFromCellIndexAndCellFace( globalCellIdx,
|
||||
(FaceType)cellFaceForEachClippedTriangleEdge[triVxIdx] );
|
||||
m_hexGrid->findFaultFromCellIndexAndCellFace( globalCellIdx, (FaceType)cellFaceForEachClippedTriangleEdge[triVxIdx] );
|
||||
if ( fault )
|
||||
{
|
||||
cvf::Vec3d highestVx = p0.z() > p1.z() ? p0 : p1;
|
||||
@@ -505,9 +498,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
caf::HexGridIntersectionTools::ClipVx cvx = clippedTriangleVxes[triVxIdx + i];
|
||||
if ( cvx.isVxIdsNative )
|
||||
{
|
||||
m_triVxToCellCornerWeights.emplace_back( cvx.clippedEdgeVx1Id,
|
||||
cvx.clippedEdgeVx2Id,
|
||||
cvx.normDistFromEdgeVx1 );
|
||||
m_triVxToCellCornerWeights.emplace_back( cvx.clippedEdgeVx1Id, cvx.clippedEdgeVx2Id, cvx.normDistFromEdgeVx1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -586,8 +577,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
CVF_ASSERT( false );
|
||||
}
|
||||
|
||||
CVF_TIGHT_ASSERT( cvx11.isVxIdsNative && cvx12.isVxIdsNative && cvx21.isVxIdsNative &&
|
||||
cvx22.isVxIdsNative );
|
||||
CVF_TIGHT_ASSERT( cvx11.isVxIdsNative && cvx12.isVxIdsNative && cvx21.isVxIdsNative && cvx22.isVxIdsNative );
|
||||
|
||||
m_triVxToCellCornerWeights.emplace_back( cvx11.clippedEdgeVx1Id,
|
||||
cvx11.clippedEdgeVx2Id,
|
||||
@@ -688,8 +678,8 @@ cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::create
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::createLineAlongExtrusionLineDrawable(
|
||||
const std::vector<cvf::Vec3d>& extrusionLine )
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::createLineAlongExtrusionLineDrawable( const std::vector<cvf::Vec3d>& extrusionLine )
|
||||
{
|
||||
cvf::ref<caf::DisplayCoordTransform> transform = displayCoordTransform( intersection() );
|
||||
std::vector<cvf::Vec3d> displayCoords;
|
||||
@@ -699,8 +689,7 @@ cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::create
|
||||
displayCoords.push_back( transform->translateToDisplayCoord( pt ) );
|
||||
}
|
||||
|
||||
return RivPolylineGenerator::createLineAlongPolylineDrawable(
|
||||
std::vector<std::vector<cvf::Vec3d>>( { displayCoords } ) );
|
||||
return RivPolylineGenerator::createLineAlongPolylineDrawable( std::vector<std::vector<cvf::Vec3d>>( { displayCoords } ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -714,8 +703,8 @@ cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::create
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::createPointsFromExtrusionLineDrawable(
|
||||
const std::vector<cvf::Vec3d>& extrusionLine )
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::createPointsFromExtrusionLineDrawable( const std::vector<cvf::Vec3d>& extrusionLine )
|
||||
{
|
||||
cvf::ref<caf::DisplayCoordTransform> transform = displayCoordTransform( intersection() );
|
||||
std::vector<cvf::Vec3d> displayCoords;
|
||||
@@ -725,8 +714,7 @@ cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::create
|
||||
displayCoords.push_back( transform->translateToDisplayCoord( pt ) );
|
||||
}
|
||||
|
||||
return RivPolylineGenerator::createPointsFromPolylineDrawable(
|
||||
std::vector<std::vector<cvf::Vec3d>>( { displayCoords } ) );
|
||||
return RivPolylineGenerator::createPointsFromPolylineDrawable( std::vector<std::vector<cvf::Vec3d>>( { displayCoords } ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -740,8 +728,7 @@ const std::vector<std::vector<cvf::Vec3d>>& RivExtrudedCurveIntersectionGeometry
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<std::pair<QString, cvf::Vec3d>>&
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::faultMeshLabelAndAnchorPositions()
|
||||
const std::vector<std::pair<QString, cvf::Vec3d>>& RivExtrudedCurveIntersectionGeometryGenerator::faultMeshLabelAndAnchorPositions()
|
||||
{
|
||||
return m_faultMeshLabelAndAnchorPositions;
|
||||
}
|
||||
@@ -758,8 +745,7 @@ const std::vector<size_t>& RivExtrudedCurveIntersectionGeometryGenerator::triang
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RivIntersectionVertexWeights>&
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::triangleVxToCellCornerInterpolationWeights() const
|
||||
const std::vector<RivIntersectionVertexWeights>& RivExtrudedCurveIntersectionGeometryGenerator::triangleVxToCellCornerInterpolationWeights() const
|
||||
{
|
||||
CVF_ASSERT( m_triangleVxes->size() );
|
||||
return m_triVxToCellCornerWeights;
|
||||
@@ -811,8 +797,8 @@ RimExtrudedCurveIntersection* RivExtrudedCurveIntersectionGeometryGenerator::int
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RivExtrudedCurveIntersectionGeometryGenerator::transformPointByPolylineSegmentIndex( const cvf::Vec3d& domainCoord,
|
||||
size_t lineIndex,
|
||||
size_t segmentIndex )
|
||||
size_t lineIndex,
|
||||
size_t segmentIndex )
|
||||
{
|
||||
CVF_ASSERT( lineIndex < m_lineSegmentTransforms.size() );
|
||||
CVF_ASSERT( segmentIndex < m_lineSegmentTransforms[lineIndex].size() );
|
||||
@@ -827,8 +813,7 @@ cvf::Vec3d RivExtrudedCurveIntersectionGeometryGenerator::transformPointByPolyli
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::pair<cvf::Vec3d, size_t>>
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::computeResampledPolyline( const std::vector<cvf::Vec3d>& polyline,
|
||||
double resamplingDistance )
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::computeResampledPolyline( const std::vector<cvf::Vec3d>& polyline, double resamplingDistance )
|
||||
{
|
||||
// Segments along the original polyline must be provided to be able to find the associated transform matrix
|
||||
std::vector<std::pair<cvf::Vec3d, size_t>> resampledPolyline;
|
||||
@@ -879,8 +864,7 @@ std::vector<std::pair<cvf::Vec3d, size_t>>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Mat4d
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const
|
||||
cvf::Mat4d RivExtrudedCurveIntersectionGeometryGenerator::unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const
|
||||
{
|
||||
cvf::Mat4d flattenMx = cvf::Mat4d::IDENTITY;
|
||||
|
||||
@@ -921,8 +905,7 @@ bool RivExtrudedCurveIntersectionGeometryGenerator::isAnyGeometryPresent() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<RimSurface*, std::vector<cvf::Vec3d>>
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::transformedSurfaceIntersectionPolylines() const
|
||||
std::map<RimSurface*, std::vector<cvf::Vec3d>> RivExtrudedCurveIntersectionGeometryGenerator::transformedSurfaceIntersectionPolylines() const
|
||||
{
|
||||
return m_transformedSurfaceIntersectionPolylines;
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ private:
|
||||
cvf::Vec3d transformPointByPolylineSegmentIndex( const cvf::Vec3d& domainCoord, size_t lineIndex, size_t segmentIndex );
|
||||
|
||||
static std::vector<std::pair<cvf::Vec3d, size_t>> computeResampledPolyline( const std::vector<cvf::Vec3d>& polyline,
|
||||
double resamplingDistance );
|
||||
double resamplingDistance );
|
||||
|
||||
private:
|
||||
RimExtrudedCurveIntersection* m_intersection;
|
||||
|
@@ -88,8 +88,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivExtrudedCurveIntersectionPartMgr::RivExtrudedCurveIntersectionPartMgr( RimExtrudedCurveIntersection* rimCrossSection,
|
||||
bool isFlattened )
|
||||
RivExtrudedCurveIntersectionPartMgr::RivExtrudedCurveIntersectionPartMgr( RimExtrudedCurveIntersection* rimCrossSection, bool isFlattened )
|
||||
: m_rimIntersection( rimCrossSection )
|
||||
, m_isFlattened( isFlattened )
|
||||
{
|
||||
@@ -104,7 +103,7 @@ RivExtrudedCurveIntersectionPartMgr::RivExtrudedCurveIntersectionPartMgr( RimExt
|
||||
{
|
||||
cvf::Vec3d direction = m_rimIntersection->extrusionDirection();
|
||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = m_rimIntersection->createHexGridInterface();
|
||||
m_intersectionGenerator = new RivExtrudedCurveIntersectionGeometryGenerator( m_rimIntersection,
|
||||
m_intersectionGenerator = new RivExtrudedCurveIntersectionGeometryGenerator( m_rimIntersection,
|
||||
polyLines,
|
||||
direction,
|
||||
hexGrid.p(),
|
||||
@@ -154,8 +153,8 @@ void RivExtrudedCurveIntersectionPartMgr::applySingleColorEffect()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionPartMgr::updateCellResultColor( int timeStepIndex,
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
void RivExtrudedCurveIntersectionPartMgr::updateCellResultColor( int timeStepIndex,
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
const RivTernaryScalarMapper* explicitTernaryColorMapper )
|
||||
{
|
||||
RivIntersectionResultsColoringTools::calculateIntersectionResultColors( timeStepIndex,
|
||||
@@ -529,8 +528,8 @@ void RivExtrudedCurveIntersectionPartMgr::createExtrusionDirParts( bool useBuffe
|
||||
if ( m_rimIntersection->direction() == RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_TWO_POINTS )
|
||||
{
|
||||
{
|
||||
cvf::ref<cvf::DrawableGeo> polylineGeo = m_intersectionGenerator->createLineAlongExtrusionLineDrawable(
|
||||
m_rimIntersection->polyLinesForExtrusionDirection() );
|
||||
cvf::ref<cvf::DrawableGeo> polylineGeo =
|
||||
m_intersectionGenerator->createLineAlongExtrusionLineDrawable( m_rimIntersection->polyLinesForExtrusionDirection() );
|
||||
if ( polylineGeo.notNull() )
|
||||
{
|
||||
if ( useBufferObjects )
|
||||
@@ -562,8 +561,8 @@ void RivExtrudedCurveIntersectionPartMgr::createExtrusionDirParts( bool useBuffe
|
||||
}
|
||||
}
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> polylinePointsGeo = m_intersectionGenerator->createPointsFromExtrusionLineDrawable(
|
||||
m_rimIntersection->polyLinesForExtrusionDirection() );
|
||||
cvf::ref<cvf::DrawableGeo> polylinePointsGeo =
|
||||
m_intersectionGenerator->createPointsFromExtrusionLineDrawable( m_rimIntersection->polyLinesForExtrusionDirection() );
|
||||
if ( polylinePointsGeo.notNull() )
|
||||
{
|
||||
if ( useBufferObjects )
|
||||
@@ -729,10 +728,10 @@ void RivExtrudedCurveIntersectionPartMgr::createAnnotationSurfaceParts( bool use
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part> RivExtrudedCurveIntersectionPartMgr::createCurvePart( const std::vector<cvf::Vec3d>& polylines,
|
||||
bool useBufferObjects,
|
||||
const QString& description,
|
||||
const cvf::Color3f& color,
|
||||
float lineWidth )
|
||||
bool useBufferObjects,
|
||||
const QString& description,
|
||||
const cvf::Color3f& color,
|
||||
float lineWidth )
|
||||
{
|
||||
auto polylineGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( polylines );
|
||||
if ( polylineGeo.notNull() )
|
||||
@@ -772,8 +771,7 @@ cvf::ref<cvf::Part> RivExtrudedCurveIntersectionPartMgr::createCurvePart( const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::ModelBasicList* model,
|
||||
cvf::Transform* scaleTransform )
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
if ( m_intersectionFaces.isNull() )
|
||||
{
|
||||
@@ -790,8 +788,7 @@ void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::M
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model,
|
||||
cvf::Transform* scaleTransform )
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
if ( m_intersectionGridLines.isNull() )
|
||||
{
|
||||
@@ -826,9 +823,7 @@ void RivExtrudedCurveIntersectionPartMgr::appendMeshLinePartsToModel( cvf::Model
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView& view,
|
||||
cvf::ModelBasicList* model,
|
||||
cvf::Transform* scaleTransform )
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
auto* curr2dView = dynamic_cast<Rim2dIntersectionView*>( &view );
|
||||
|
||||
|
@@ -25,9 +25,8 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivExtrudedCurveIntersectionSourceInfo::RivExtrudedCurveIntersectionSourceInfo(
|
||||
RivExtrudedCurveIntersectionGeometryGenerator* geometryGenerator,
|
||||
RimExtrudedCurveIntersection* intersection )
|
||||
RivExtrudedCurveIntersectionSourceInfo::RivExtrudedCurveIntersectionSourceInfo( RivExtrudedCurveIntersectionGeometryGenerator* geometryGenerator,
|
||||
RimExtrudedCurveIntersection* intersection )
|
||||
: m_intersectionGeometryGenerator( geometryGenerator )
|
||||
, m_intersection( intersection )
|
||||
{
|
||||
|
@@ -51,8 +51,7 @@ cvf::BoundingBox RivFemIntersectionGrid::boundingBox() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFemIntersectionGrid::findIntersectingCells( const cvf::BoundingBox& intersectingBB,
|
||||
std::vector<size_t>* intersectedCells ) const
|
||||
void RivFemIntersectionGrid::findIntersectingCells( const cvf::BoundingBox& intersectingBB, std::vector<size_t>* intersectedCells ) const
|
||||
{
|
||||
for ( int i = 0; i < m_femParts->partCount(); i++ )
|
||||
{
|
||||
@@ -75,8 +74,7 @@ bool RivFemIntersectionGrid::useCell( size_t globalCellIndex ) const
|
||||
{
|
||||
auto [part, elementIdx] = m_femParts->partAndElementIndex( globalCellIndex );
|
||||
|
||||
return ( ( part->elementType( elementIdx ) == RigElementType::HEX8 ) ||
|
||||
( part->elementType( elementIdx ) == RigElementType::HEX8P ) );
|
||||
return ( ( part->elementType( elementIdx ) == RigElementType::HEX8 ) || ( part->elementType( elementIdx ) == RigElementType::HEX8P ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -132,7 +130,7 @@ void RivFemIntersectionGrid::cellCornerIndices( size_t globalCellIndex, size_t c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigFault* RivFemIntersectionGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
const RigFault* RivFemIntersectionGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType face ) const
|
||||
{
|
||||
return nullptr;
|
||||
|
@@ -40,13 +40,11 @@ public:
|
||||
|
||||
cvf::Vec3d displayOffset() const override;
|
||||
cvf::BoundingBox boundingBox() const override;
|
||||
void findIntersectingCells( const cvf::BoundingBox& intersectingBB,
|
||||
std::vector<size_t>* intersectedCells ) const override;
|
||||
void findIntersectingCells( const cvf::BoundingBox& intersectingBB, std::vector<size_t>* intersectedCells ) const override;
|
||||
bool useCell( size_t cellIndex ) const override;
|
||||
void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override;
|
||||
void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override;
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType face ) const override;
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override;
|
||||
|
||||
private:
|
||||
cvf::cref<RigFemPartCollection> m_femParts;
|
||||
|
@@ -27,9 +27,9 @@
|
||||
class RivIntersectionGeometryGeneratorInterface
|
||||
{
|
||||
public:
|
||||
virtual ~RivIntersectionGeometryGeneratorInterface() = default;
|
||||
virtual bool isAnyGeometryPresent() const = 0;
|
||||
virtual const std::vector<size_t>& triangleToCellIndex() const = 0;
|
||||
virtual ~RivIntersectionGeometryGeneratorInterface() = default;
|
||||
virtual bool isAnyGeometryPresent() const = 0;
|
||||
virtual const std::vector<size_t>& triangleToCellIndex() const = 0;
|
||||
virtual const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const = 0;
|
||||
virtual const cvf::Vec3fArray* triangleVxes() const = 0;
|
||||
virtual const cvf::Vec3fArray* cellMeshVxes() const { return nullptr; };
|
||||
|
@@ -34,13 +34,11 @@ class RigFault;
|
||||
class RivIntersectionHexGridInterface : public cvf::Object
|
||||
{
|
||||
public:
|
||||
virtual cvf::Vec3d displayOffset() const = 0;
|
||||
virtual cvf::BoundingBox boundingBox() const = 0;
|
||||
virtual void findIntersectingCells( const cvf::BoundingBox& intersectingBB,
|
||||
std::vector<size_t>* intersectedCells ) const = 0;
|
||||
virtual bool useCell( size_t cellIndex ) const = 0;
|
||||
virtual void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const = 0;
|
||||
virtual void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const = 0;
|
||||
virtual const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType face ) const = 0;
|
||||
virtual cvf::Vec3d displayOffset() const = 0;
|
||||
virtual cvf::BoundingBox boundingBox() const = 0;
|
||||
virtual void findIntersectingCells( const cvf::BoundingBox& intersectingBB, std::vector<size_t>* intersectedCells ) const = 0;
|
||||
virtual bool useCell( size_t cellIndex ) const = 0;
|
||||
virtual void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const = 0;
|
||||
virtual void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const = 0;
|
||||
virtual const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const = 0;
|
||||
};
|
||||
|
@@ -50,15 +50,14 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionResultsColoringTools::calculateIntersectionResultColors(
|
||||
int timeStepIndex,
|
||||
bool useSeparateIntersectionResDefTimeStep,
|
||||
RimIntersection* rimIntersectionHandle,
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeomGenIF,
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
const RivTernaryScalarMapper* explicitTernaryColorMapper,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
void RivIntersectionResultsColoringTools::calculateIntersectionResultColors( int timeStepIndex,
|
||||
bool useSeparateIntersectionResDefTimeStep,
|
||||
RimIntersection* rimIntersectionHandle,
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeomGenIF,
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
const RivTernaryScalarMapper* explicitTernaryColorMapper,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
if ( !intersectionGeomGenIF || !intersectionGeomGenIF->isAnyGeometryPresent() ) return;
|
||||
|
||||
@@ -107,8 +106,7 @@ void RivIntersectionResultsColoringTools::calculateIntersectionResultColors(
|
||||
{
|
||||
eclipseResDef = eclipseView->cellResult();
|
||||
if ( !scalarColorMapper ) scalarColorMapper = eclipseView->cellResult()->legendConfig()->scalarMapper();
|
||||
if ( !ternaryColorMapper )
|
||||
ternaryColorMapper = eclipseView->cellResult()->ternaryLegendConfig()->scalarMapper();
|
||||
if ( !ternaryColorMapper ) ternaryColorMapper = eclipseView->cellResult()->ternaryLegendConfig()->scalarMapper();
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView;
|
||||
@@ -129,8 +127,7 @@ void RivIntersectionResultsColoringTools::calculateIntersectionResultColors(
|
||||
ternaryColorMapper,
|
||||
timeStepIndex,
|
||||
isLightingDisabled,
|
||||
intersectionGeomGenIF
|
||||
->triangleToCellIndex(),
|
||||
intersectionGeomGenIF->triangleToCellIndex(),
|
||||
intersectionFacesPart,
|
||||
intersectionFacesTextureCoords );
|
||||
}
|
||||
@@ -162,12 +159,12 @@ void RivIntersectionResultsColoringTools::calculateIntersectionResultColors(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionResultsColoringTools::updateEclipseCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseResDef->eclipseCase()->eclipseCaseData();
|
||||
|
||||
@@ -176,8 +173,7 @@ void RivIntersectionResultsColoringTools::updateEclipseCellResultColors( const R
|
||||
if ( !RiaResultNames::isPerCellFaceResult( eclipseResDef->resultVariable() ) )
|
||||
|
||||
{
|
||||
resultAccessor =
|
||||
RigResultAccessorFactory::createFromResultDefinition( eclipseCaseData, 0, timeStepIndex, eclipseResDef );
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition( eclipseCaseData, 0, timeStepIndex, eclipseResDef );
|
||||
}
|
||||
|
||||
if ( resultAccessor.isNull() )
|
||||
@@ -201,14 +197,13 @@ void RivIntersectionResultsColoringTools::updateEclipseCellResultColors( const R
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionResultsColoringTools::updateEclipseTernaryCellResultColors(
|
||||
const RimEclipseResultDefinition* eclipseResDef,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
void RivIntersectionResultsColoringTools::updateEclipseTernaryCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
RivTernaryTextureCoordsCreator texturer( eclipseResDef, ternaryColorMapper, timeStepIndex );
|
||||
|
||||
@@ -225,14 +220,13 @@ void RivIntersectionResultsColoringTools::updateEclipseTernaryCellResultColors(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
|
||||
const RimGeoMechResultDefinition* geomResultDef,
|
||||
int viewerTimeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
bool isLightingDisabled,
|
||||
const RivIntersectionGeometryGeneratorInterface* geomGenerator,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors( const RimGeoMechResultDefinition* geomResultDef,
|
||||
int viewerTimeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
bool isLightingDisabled,
|
||||
const RivIntersectionGeometryGeneratorInterface* geomGenerator,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
RigGeoMechCaseData* caseData = nullptr;
|
||||
RigFemResultAddress resVarAddress;
|
||||
@@ -247,15 +241,13 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
|
||||
|
||||
const std::vector<size_t>& triangleToCellIdx = geomGenerator->triangleToCellIndex();
|
||||
const cvf::Vec3fArray* triangelVxes = geomGenerator->triangleVxes();
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights =
|
||||
geomGenerator->triangleVxToCellCornerInterpolationWeights();
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights = geomGenerator->triangleVxToCellCornerInterpolationWeights();
|
||||
|
||||
if ( resVarAddress.resultPosType == RIG_ELEMENT )
|
||||
{
|
||||
if ( caseData->femPartResults()->partCount() == 1 )
|
||||
{
|
||||
const std::vector<float>& resultValues =
|
||||
caseData->femPartResults()->resultValues( resVarAddress, 0, stepIdx, frameIdx );
|
||||
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues( resVarAddress, 0, stepIdx, frameIdx );
|
||||
|
||||
RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
|
||||
resultValues,
|
||||
@@ -314,8 +306,7 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
|
||||
|
||||
if ( caseData->femPartResults()->partCount() == 1 )
|
||||
{
|
||||
const std::vector<float>& resultValues =
|
||||
caseData->femPartResults()->resultValues( resVarAddress, 0, stepIdx, frameIdx );
|
||||
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues( resVarAddress, 0, stepIdx, frameIdx );
|
||||
RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
|
||||
vertexWeights,
|
||||
resultValues,
|
||||
@@ -351,8 +342,8 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionResultsColoringTools::calculateEclipseTextureCoordinates( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
if ( !resultAccessor ) return;
|
||||
|
||||
@@ -384,10 +375,10 @@ void RivIntersectionResultsColoringTools::calculateEclipseTextureCoordinates( cv
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float>& resultValues,
|
||||
void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float>& resultValues,
|
||||
const std::vector<size_t>& triangleToCellIdx,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
textureCoords->resize( triangleToCellIdx.size() * 3 );
|
||||
|
||||
@@ -425,16 +416,15 @@ void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionResultsColoringTools::calculateGeoMechTensorXfTextureCoords(
|
||||
cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
int partIdx,
|
||||
int timeStepIdx,
|
||||
int frameIdx,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
void RivIntersectionResultsColoringTools::calculateGeoMechTensorXfTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
int partIdx,
|
||||
int timeStepIdx,
|
||||
int frameIdx,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
RiuGeoMechXfTensorResultAccessor accessor( caseData->femPartResults(), resVarAddress, partIdx, timeStepIdx, frameIdx );
|
||||
|
||||
@@ -449,19 +439,14 @@ void RivIntersectionResultsColoringTools::calculateGeoMechTensorXfTextureCoords(
|
||||
int triangleVxStartIdx = triangleIdx * 3;
|
||||
float values[3];
|
||||
|
||||
accessor.calculateInterpolatedValue( &( ( *triangelVertices )[triangleVxStartIdx] ),
|
||||
&( vertexWeights[triangleVxStartIdx] ),
|
||||
values );
|
||||
accessor.calculateInterpolatedValue( &( ( *triangelVertices )[triangleVxStartIdx] ), &( vertexWeights[triangleVxStartIdx] ), values );
|
||||
|
||||
rawPtr[triangleVxStartIdx + 0] = ( values[0] != std::numeric_limits<float>::infinity() )
|
||||
? mapper->mapToTextureCoord( values[0] )
|
||||
: cvf::Vec2f( 0.0f, 1.0f );
|
||||
rawPtr[triangleVxStartIdx + 1] = ( values[1] != std::numeric_limits<float>::infinity() )
|
||||
? mapper->mapToTextureCoord( values[1] )
|
||||
: cvf::Vec2f( 0.0f, 1.0f );
|
||||
rawPtr[triangleVxStartIdx + 2] = ( values[2] != std::numeric_limits<float>::infinity() )
|
||||
? mapper->mapToTextureCoord( values[2] )
|
||||
: cvf::Vec2f( 0.0f, 1.0f );
|
||||
rawPtr[triangleVxStartIdx + 0] = ( values[0] != std::numeric_limits<float>::infinity() ) ? mapper->mapToTextureCoord( values[0] )
|
||||
: cvf::Vec2f( 0.0f, 1.0f );
|
||||
rawPtr[triangleVxStartIdx + 1] = ( values[1] != std::numeric_limits<float>::infinity() ) ? mapper->mapToTextureCoord( values[1] )
|
||||
: cvf::Vec2f( 0.0f, 1.0f );
|
||||
rawPtr[triangleVxStartIdx + 2] = ( values[2] != std::numeric_limits<float>::infinity() ) ? mapper->mapToTextureCoord( values[2] )
|
||||
: cvf::Vec2f( 0.0f, 1.0f );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,12 +479,12 @@ void RivIntersectionResultsColoringTools::calculatePlaneAngleTextureCoords( cvf:
|
||||
int triangleVxStartIdx = triangleIdx * 3;
|
||||
|
||||
const cvf::Vec3f* triangle = &( ( *triangelVertices )[triangleVxStartIdx] );
|
||||
cvf::Mat3f rotMx =
|
||||
cvf::GeometryTools::computePlaneHorizontalRotationMx( triangle[1] - triangle[0], triangle[2] - triangle[0] );
|
||||
cvf::Mat3f rotMx = cvf::GeometryTools::computePlaneHorizontalRotationMx( triangle[1] - triangle[0], triangle[2] - triangle[0] );
|
||||
|
||||
RiaOffshoreSphericalCoords sphCoord(
|
||||
cvf::Vec3f( rotMx.rowCol( 2, 0 ), rotMx.rowCol( 2, 1 ), rotMx.rowCol( 2, 2 ) ) ); // Use Ez from the matrix
|
||||
// as plane normal
|
||||
RiaOffshoreSphericalCoords sphCoord( cvf::Vec3f( rotMx.rowCol( 2, 0 ), rotMx.rowCol( 2, 1 ), rotMx.rowCol( 2, 2 ) ) ); // Use Ez from
|
||||
// the matrix
|
||||
// as plane
|
||||
// normal
|
||||
|
||||
float angle = cvf::Math::toDegrees( operation( sphCoord ) );
|
||||
cvf::Vec2f texCoord = ( angle != std::numeric_limits<float>::infinity() ) ? mapper->mapToTextureCoord( angle )
|
||||
|
@@ -42,14 +42,14 @@ class ScalarMapper;
|
||||
class RivIntersectionResultsColoringTools
|
||||
{
|
||||
public:
|
||||
static void calculateIntersectionResultColors( int timeStepIndex,
|
||||
bool useSeparateIntersectionResDefTimeStep,
|
||||
RimIntersection* rimIntersectionHandle,
|
||||
static void calculateIntersectionResultColors( int timeStepIndex,
|
||||
bool useSeparateIntersectionResDefTimeStep,
|
||||
RimIntersection* rimIntersectionHandle,
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeomGenIF,
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
const RivTernaryScalarMapper* explicitTernaryColorMapper,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords );
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
const RivTernaryScalarMapper* explicitTernaryColorMapper,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords );
|
||||
|
||||
private:
|
||||
static void updateEclipseCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
static void updateGeoMechCellResultColors( const RimGeoMechResultDefinition* geomResultDef,
|
||||
int timeStepIndex,
|
||||
@@ -74,28 +74,27 @@ private:
|
||||
bool isLightingDisabled,
|
||||
const RivIntersectionGeometryGeneratorInterface* geomGenerator,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
static void calculateEclipseTextureCoordinates( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
|
||||
static void
|
||||
calculateNodeOrElementNodeBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
const std::vector<float>& resultValues,
|
||||
bool isElementNodalResult,
|
||||
const RigFemPartCollection* femParts,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
static void calculateNodeOrElementNodeBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
const std::vector<float>& resultValues,
|
||||
bool isElementNodalResult,
|
||||
const RigFemPartCollection* femParts,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
|
||||
static void calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float>& resultValues,
|
||||
const std::vector<size_t>& triangleToCellIdx,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
|
||||
static void calculateGeoMechTensorXfTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
static void calculateGeoMechTensorXfTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
|
@@ -25,9 +25,7 @@
|
||||
///
|
||||
/// Returns size_t(-1) if no point is found
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RivSectionFlattener::indexToNextValidPoint( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const cvf::Vec3d extrDir,
|
||||
size_t idxToStartOfLineSegment )
|
||||
size_t RivSectionFlattener::indexToNextValidPoint( const std::vector<cvf::Vec3d>& polyLine, const cvf::Vec3d extrDir, size_t idxToStartOfLineSegment )
|
||||
{
|
||||
size_t lineCount = polyLine.size();
|
||||
if ( !( idxToStartOfLineSegment + 1 < lineCount ) ) return -1;
|
||||
@@ -52,9 +50,9 @@ size_t RivSectionFlattener::indexToNextValidPoint( const std::vector<cvf::Vec3d>
|
||||
/// Returns one CS pr point, valid for the next segment
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Mat4d> RivSectionFlattener::calculateFlatteningCSsForPolyline( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const cvf::Vec3d& extrusionDir,
|
||||
const cvf::Vec3d& startOffset,
|
||||
cvf::Vec3d* endOffset )
|
||||
const cvf::Vec3d& extrusionDir,
|
||||
const cvf::Vec3d& startOffset,
|
||||
cvf::Vec3d* endOffset )
|
||||
{
|
||||
CVF_ASSERT( endOffset );
|
||||
size_t pointCount = polyLine.size();
|
||||
@@ -128,9 +126,7 @@ std::vector<cvf::Mat4d> RivSectionFlattener::calculateFlatteningCSsForPolyline(
|
||||
/// Ey normal to the section plane
|
||||
/// Ex in plane along p1-p2
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Mat4d RivSectionFlattener::calculateSectionLocalFlatteningCS( const cvf::Vec3d& p1,
|
||||
const cvf::Vec3d& p2,
|
||||
const cvf::Vec3d& extrusionDir )
|
||||
cvf::Mat4d RivSectionFlattener::calculateSectionLocalFlatteningCS( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& extrusionDir )
|
||||
{
|
||||
using namespace cvf;
|
||||
|
||||
|
@@ -25,9 +25,7 @@
|
||||
class RivSectionFlattener
|
||||
{
|
||||
public:
|
||||
static size_t indexToNextValidPoint( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const cvf::Vec3d extrDir,
|
||||
size_t idxToStartOfLineSegment );
|
||||
static size_t indexToNextValidPoint( const std::vector<cvf::Vec3d>& polyLine, const cvf::Vec3d extrDir, size_t idxToStartOfLineSegment );
|
||||
|
||||
static std::vector<cvf::Mat4d> calculateFlatteningCSsForPolyline( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const cvf::Vec3d& extrusionDir,
|
||||
@@ -35,6 +33,5 @@ public:
|
||||
cvf::Vec3d* endOffset );
|
||||
|
||||
private:
|
||||
static cvf::Mat4d
|
||||
calculateSectionLocalFlatteningCS( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& extrusionDir );
|
||||
static cvf::Mat4d calculateSectionLocalFlatteningCS( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& extrusionDir );
|
||||
};
|
||||
|
@@ -48,10 +48,10 @@ Riv3dWellLogCurveGeometryGenerator::Riv3dWellLogCurveGeometryGenerator( RimWellP
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( gsl::not_null<const caf::DisplayCoordTransform*> displayCoordTransform,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
gsl::not_null<const Rim3dWellLogCurve*> wellLogCurve,
|
||||
double planeOffsetFromWellPathCenter,
|
||||
double planeWidth,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
gsl::not_null<const Rim3dWellLogCurve*> wellLogCurve,
|
||||
double planeOffsetFromWellPathCenter,
|
||||
double planeWidth,
|
||||
const std::vector<cvf::Vec3d>& drawSurfaceVertices,
|
||||
int currentTimeStep )
|
||||
{
|
||||
@@ -98,12 +98,10 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( gsl::not_null<con
|
||||
}
|
||||
clipLocation = displayCoordTransform->transformToDisplayCoord( clipLocation );
|
||||
|
||||
std::vector<cvf::Vec3d> displayCoords =
|
||||
displayCoordTransform->transformToDisplayCoords( wellPathGeometry->wellPathPoints() );
|
||||
std::vector<cvf::Vec3d> displayCoords = displayCoordTransform->transformToDisplayCoords( wellPathGeometry->wellPathPoints() );
|
||||
|
||||
std::vector<cvf::Vec3d> wellPathCurveNormals =
|
||||
RigWellPathGeometryTools::calculateLineSegmentNormals( displayCoords,
|
||||
wellLogCurve->drawPlaneAngle( wellLogCurve->drawPlane() ) );
|
||||
RigWellPathGeometryTools::calculateLineSegmentNormals( displayCoords, wellLogCurve->drawPlaneAngle( wellLogCurve->drawPlane() ) );
|
||||
|
||||
std::vector<cvf::Vec3d> interpolatedWellPathPoints;
|
||||
std::vector<cvf::Vec3d> interpolatedCurveNormals;
|
||||
@@ -124,7 +122,7 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( gsl::not_null<con
|
||||
std::reverse( interpolatedCurveNormals.begin(), interpolatedCurveNormals.end() );
|
||||
|
||||
// The result values for the part of the well which is not clipped off, matching interpolatedWellPathPoints size
|
||||
m_curveValues = std::vector<double>( resultValues.end() - interpolatedWellPathPoints.size(), resultValues.end() );
|
||||
m_curveValues = std::vector<double>( resultValues.end() - interpolatedWellPathPoints.size(), resultValues.end() );
|
||||
m_curveMeasuredDepths = std::vector<double>( resultMds.end() - interpolatedWellPathPoints.size(), resultMds.end() );
|
||||
|
||||
double maxVisibleResult = -std::numeric_limits<double>::max();
|
||||
@@ -168,8 +166,7 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( gsl::not_null<con
|
||||
|
||||
if ( RiaCurveDataTools::isValidValue( m_curveValues[i], false ) )
|
||||
{
|
||||
scaledResult = planeOffsetFromWellPathCenter +
|
||||
( m_curveValues[i] - minCurveValue ) * plotRangeToResultRangeFactor;
|
||||
scaledResult = planeOffsetFromWellPathCenter + ( m_curveValues[i] - minCurveValue ) * plotRangeToResultRangeFactor;
|
||||
}
|
||||
cvf::Vec3d curvePoint( interpolatedWellPathPoints[i] + scaledResult * interpolatedCurveNormals[i] );
|
||||
m_curveVertices.push_back( curvePoint );
|
||||
@@ -183,8 +180,7 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( gsl::not_null<con
|
||||
indices.reserve( m_curveVertices.size() * 2 );
|
||||
for ( size_t i = 0; i < m_curveVertices.size() - 1; ++i )
|
||||
{
|
||||
if ( RiaCurveDataTools::isValidValue( m_curveValues[i], false ) &&
|
||||
RiaCurveDataTools::isValidValue( m_curveValues[i + 1], false ) )
|
||||
if ( RiaCurveDataTools::isValidValue( m_curveValues[i], false ) && RiaCurveDataTools::isValidValue( m_curveValues[i + 1], false ) )
|
||||
{
|
||||
if ( cvf::Math::valueInRange( m_curveValues[i], minCurveValue, maxCurveValue ) ||
|
||||
cvf::Math::valueInRange( m_curveValues[i + 1], minCurveValue, maxCurveValue ) )
|
||||
@@ -195,9 +191,8 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( gsl::not_null<con
|
||||
}
|
||||
}
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt =
|
||||
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
|
||||
m_curveDrawable = new cvf::DrawableGeo();
|
||||
|
||||
@@ -268,13 +263,12 @@ bool Riv3dWellLogCurveGeometryGenerator::findClosestPointOnCurve( const cvf::Vec
|
||||
double distanceToProjectedPointAlongAB = ap * ab / ( ab * ab );
|
||||
double clampedDistance = std::clamp( distanceToProjectedPointAlongAB, 0.0, 1.0 );
|
||||
cvf::Vec3d projectionOfGlobalIntersection = a + clampedDistance * ab;
|
||||
double distance = ( projectionOfGlobalIntersection - globalIntersection ).length();
|
||||
double distance = ( projectionOfGlobalIntersection - globalIntersection ).length();
|
||||
if ( distance < closestDistance )
|
||||
{
|
||||
*closestPoint = cvf::Vec3d( projectionOfGlobalIntersection );
|
||||
closestDistance = distance;
|
||||
*measuredDepthAtPoint = m_curveMeasuredDepths[i - 1] * ( 1.0 - clampedDistance ) +
|
||||
m_curveMeasuredDepths[i] * clampedDistance;
|
||||
*measuredDepthAtPoint = m_curveMeasuredDepths[i - 1] * ( 1.0 - clampedDistance ) + m_curveMeasuredDepths[i] * clampedDistance;
|
||||
*valueAtClosestPoint = m_curveValues[i - 1] * ( 1.0 - clampedDistance ) + m_curveValues[i] * clampedDistance;
|
||||
}
|
||||
}
|
||||
@@ -300,8 +294,7 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges( co
|
||||
|
||||
for ( size_t i = 0; i < m_curveVertices.size() - 1; i += 2 )
|
||||
{
|
||||
if ( RiaCurveDataTools::isValidValue( m_curveValues[i], false ) &&
|
||||
RiaCurveDataTools::isValidValue( m_curveValues[i + 1], false ) )
|
||||
if ( RiaCurveDataTools::isValidValue( m_curveValues[i], false ) && RiaCurveDataTools::isValidValue( m_curveValues[i + 1], false ) )
|
||||
{
|
||||
cvf::Vec3d lastVertex = m_curveVertices[i];
|
||||
cvf::Vec3d fullSegmentVector = m_curveVertices[i + 1] - m_curveVertices[i];
|
||||
@@ -318,8 +311,7 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges( co
|
||||
double fractionAlongFullSegment = dotProduct / fullSegmentVector.lengthSquared();
|
||||
double measuredDepth = m_curveMeasuredDepths[i] * ( 1 - fractionAlongFullSegment ) +
|
||||
m_curveMeasuredDepths[i + 1] * fractionAlongFullSegment;
|
||||
double valueAtPoint = m_curveValues[i] * ( 1 - fractionAlongFullSegment ) +
|
||||
m_curveValues[i + 1] * fractionAlongFullSegment;
|
||||
double valueAtPoint = m_curveValues[i] * ( 1 - fractionAlongFullSegment ) + m_curveValues[i + 1] * fractionAlongFullSegment;
|
||||
expandedCurveVertices.push_back( extraVertex );
|
||||
expandedMeasuredDepths.push_back( measuredDepth );
|
||||
expandedValues.push_back( valueAtPoint );
|
||||
@@ -355,17 +347,15 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongSegment( const cv
|
||||
{
|
||||
caf::Line<double> triangleEdge1 = caf::Line<double>( drawSurfaceVertices[j], drawSurfaceVertices[j + 1] );
|
||||
caf::Line<double> triangleEdge2 = caf::Line<double>( drawSurfaceVertices[j + 2], drawSurfaceVertices[j + 1] );
|
||||
cvf::Vec3d triangleNormal =
|
||||
( triangleEdge1.vector().getNormalized() ^ triangleEdge2.vector().getNormalized() ).getNormalized();
|
||||
cvf::Vec3d triangleNormal = ( triangleEdge1.vector().getNormalized() ^ triangleEdge2.vector().getNormalized() ).getNormalized();
|
||||
|
||||
cvf::Vec3d currentSubSegment = ptEnd - extraVertices->back();
|
||||
cvf::Vec3d projectedSegmentVector = currentSubSegment - ( currentSubSegment * triangleNormal ) * triangleNormal;
|
||||
cvf::Vec3d currentSubSegment = ptEnd - extraVertices->back();
|
||||
cvf::Vec3d projectedSegmentVector = currentSubSegment - ( currentSubSegment * triangleNormal ) * triangleNormal;
|
||||
caf::Line<double> projectedCurveLine( extraVertices->back(), extraVertices->back() + projectedSegmentVector );
|
||||
|
||||
// Only attempt to find intersections with the first edge. The other edge is handled with the next triangle.
|
||||
bool withinSegments = false;
|
||||
caf::Line<double> connectingLine =
|
||||
projectedCurveLine.findLineBetweenNearestPoints( triangleEdge1, &withinSegments );
|
||||
caf::Line<double> connectingLine = projectedCurveLine.findLineBetweenNearestPoints( triangleEdge1, &withinSegments );
|
||||
|
||||
cvf::Vec3d newVertex = connectingLine.end();
|
||||
cvf::Vec3d newSegmentVector = newVertex - extraVertices->back();
|
||||
@@ -380,9 +370,8 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongSegment( const cv
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d>
|
||||
Riv3dWellLogCurveGeometryGenerator::projectVerticesOntoTriangles( const std::vector<cvf::Vec3d>& originalVertices,
|
||||
const std::vector<cvf::Vec3d>& drawSurfaceVertices )
|
||||
std::vector<cvf::Vec3d> Riv3dWellLogCurveGeometryGenerator::projectVerticesOntoTriangles( const std::vector<cvf::Vec3d>& originalVertices,
|
||||
const std::vector<cvf::Vec3d>& drawSurfaceVertices )
|
||||
{
|
||||
std::vector<cvf::Vec3d> projectedVertices;
|
||||
projectedVertices.reserve( originalVertices.size() );
|
||||
@@ -407,15 +396,11 @@ std::vector<cvf::Vec3d>
|
||||
}
|
||||
|
||||
bool wasInsideTriangle = false;
|
||||
cvf::Vec3d projectedPoint = projectPointOntoTriangle( originalVertices[i],
|
||||
triangleVertex1,
|
||||
triangleVertex2,
|
||||
triangleVertex3,
|
||||
&wasInsideTriangle );
|
||||
cvf::Vec3d projectedPoint =
|
||||
projectPointOntoTriangle( originalVertices[i], triangleVertex1, triangleVertex2, triangleVertex3, &wasInsideTriangle );
|
||||
if ( wasInsideTriangle )
|
||||
{
|
||||
projectionsInsideTriangle.insert(
|
||||
std::make_pair( ( projectedPoint - originalVertices[i] ).lengthSquared(), projectedPoint ) );
|
||||
projectionsInsideTriangle.insert( std::make_pair( ( projectedPoint - originalVertices[i] ).lengthSquared(), projectedPoint ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -49,9 +49,9 @@ Riv3dWellLogDrawSurfaceGenerator::Riv3dWellLogDrawSurfaceGenerator( RimWellPath*
|
||||
bool Riv3dWellLogDrawSurfaceGenerator::createDrawSurface( const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
double planeAngle,
|
||||
double planeOffsetFromWellPathCenter,
|
||||
double planeWidth,
|
||||
double samplingIntervalSize )
|
||||
double planeOffsetFromWellPathCenter,
|
||||
double planeWidth,
|
||||
double samplingIntervalSize )
|
||||
{
|
||||
CVF_ASSERT( samplingIntervalSize > 0 );
|
||||
|
||||
@@ -82,8 +82,7 @@ bool Riv3dWellLogDrawSurfaceGenerator::createDrawSurface( const caf::DisplayCoor
|
||||
wellPathDisplayCoords = displayCoordTransform->transformToDisplayCoords( domainCoords );
|
||||
}
|
||||
|
||||
std::vector<cvf::Vec3d> wellPathSegmentNormals =
|
||||
RigWellPathGeometryTools::calculateLineSegmentNormals( wellPathDisplayCoords, planeAngle );
|
||||
std::vector<cvf::Vec3d> wellPathSegmentNormals = RigWellPathGeometryTools::calculateLineSegmentNormals( wellPathDisplayCoords, planeAngle );
|
||||
|
||||
size_t indexToFirstVisibleSegment = 0u;
|
||||
if ( wellPathCollection->wellPathClip )
|
||||
@@ -108,8 +107,7 @@ bool Riv3dWellLogDrawSurfaceGenerator::createDrawSurface( const caf::DisplayCoor
|
||||
wellPathSegmentNormals );
|
||||
|
||||
// Note that normals are calculated on the full non-clipped well path. So we need to clip the start here.
|
||||
wellPathSegmentNormals.erase( wellPathSegmentNormals.begin(),
|
||||
wellPathSegmentNormals.end() - wellPathDisplayCoords.size() );
|
||||
wellPathSegmentNormals.erase( wellPathSegmentNormals.begin(), wellPathSegmentNormals.end() - wellPathDisplayCoords.size() );
|
||||
|
||||
if ( wellPathDisplayCoords.size() < (size_t)2 )
|
||||
{
|
||||
@@ -120,10 +118,8 @@ bool Riv3dWellLogDrawSurfaceGenerator::createDrawSurface( const caf::DisplayCoor
|
||||
m_vertices.reserve( wellPathDisplayCoords.size() * 2 );
|
||||
for ( size_t i = 0; i < wellPathDisplayCoords.size(); i++ )
|
||||
{
|
||||
m_vertices.push_back( wellPathDisplayCoords[i] +
|
||||
wellPathSegmentNormals[i] * ( planeOffsetFromWellPathCenter - 0.025 * planeWidth ) );
|
||||
m_vertices.push_back( wellPathDisplayCoords[i] +
|
||||
wellPathSegmentNormals[i] * ( planeOffsetFromWellPathCenter + 1.025 * planeWidth ) );
|
||||
m_vertices.push_back( wellPathDisplayCoords[i] + wellPathSegmentNormals[i] * ( planeOffsetFromWellPathCenter - 0.025 * planeWidth ) );
|
||||
m_vertices.push_back( wellPathDisplayCoords[i] + wellPathSegmentNormals[i] * ( planeOffsetFromWellPathCenter + 1.025 * planeWidth ) );
|
||||
}
|
||||
|
||||
cvf::ref<cvf::Vec3fArray> vertexArray = new cvf::Vec3fArray( m_vertices.size() );
|
||||
@@ -185,10 +181,10 @@ const std::vector<cvf::Vec3d>& Riv3dWellLogDrawSurfaceGenerator::vertices() cons
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Riv3dWellLogDrawSurfaceGenerator::createCurveNormalVectors( const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
size_t clipStartIndex,
|
||||
double planeOffsetFromWellPathCenter,
|
||||
double planeWidth,
|
||||
double samplingIntervalSize,
|
||||
const std::vector<cvf::Vec3d>& segmentNormals )
|
||||
double planeOffsetFromWellPathCenter,
|
||||
double planeWidth,
|
||||
double samplingIntervalSize,
|
||||
const std::vector<cvf::Vec3d>& segmentNormals )
|
||||
{
|
||||
std::vector<cvf::Vec3d> interpolatedWellPathPoints;
|
||||
std::vector<cvf::Vec3d> interpolatedWellPathNormals;
|
||||
@@ -219,8 +215,7 @@ void Riv3dWellLogDrawSurfaceGenerator::createCurveNormalVectors( const caf::Disp
|
||||
// Normal lines. Start from one to avoid drawing at surface edge.
|
||||
for ( size_t i = 1; i < interpolatedWellPathNormals.size(); i++ )
|
||||
{
|
||||
arrowVertices.push_back( cvf::Vec3f( interpolatedWellPathPoints[i] +
|
||||
interpolatedWellPathNormals[i] * planeOffsetFromWellPathCenter ) );
|
||||
arrowVertices.push_back( cvf::Vec3f( interpolatedWellPathPoints[i] + interpolatedWellPathNormals[i] * planeOffsetFromWellPathCenter ) );
|
||||
|
||||
arrowVectors.push_back( cvf::Vec3f( interpolatedWellPathNormals[i] * planeWidth * totalArrowScaling ) );
|
||||
}
|
||||
@@ -261,9 +256,8 @@ void Riv3dWellLogDrawSurfaceGenerator::createBackground( cvf::Vec3fArray* vertex
|
||||
}
|
||||
|
||||
// Background specific
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt =
|
||||
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_TRIANGLE_STRIP );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( backgroundIndices );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_TRIANGLE_STRIP );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( backgroundIndices );
|
||||
indexedUInt->setIndices( indexArray.p() );
|
||||
|
||||
m_background = new cvf::DrawableGeo();
|
||||
@@ -306,7 +300,7 @@ void Riv3dWellLogDrawSurfaceGenerator::createBorder( cvf::Vec3fArray* vertexArra
|
||||
borderIndices.push_back( 0u );
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( borderIndices );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( borderIndices );
|
||||
indexedUInt->setIndices( indexArray.p() );
|
||||
|
||||
m_border = new cvf::DrawableGeo();
|
||||
|
@@ -91,17 +91,12 @@ void Riv3dWellLogPlanePartMgr::appendPlaneToModel( cvf::ModelBasicList*
|
||||
|
||||
for ( Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves() )
|
||||
{
|
||||
if ( rim3dWellLogCurve->showInView( m_gridView ) &&
|
||||
rim3dWellLogCurve->isShowingTimeDependentResult() != isStaticResult )
|
||||
if ( rim3dWellLogCurve->showInView( m_gridView ) && rim3dWellLogCurve->isShowingTimeDependentResult() != isStaticResult )
|
||||
{
|
||||
auto it = m_3dWellLogDrawSurfaceGeometryGenerators.find( rim3dWellLogCurve->drawPlane() );
|
||||
if ( it != m_3dWellLogDrawSurfaceGeometryGenerators.end() )
|
||||
{
|
||||
append3dWellLogCurveToModel( model,
|
||||
displayCoordTransform,
|
||||
wellPathClipBoundingBox,
|
||||
rim3dWellLogCurve,
|
||||
it->second->vertices() );
|
||||
append3dWellLogCurveToModel( model, displayCoordTransform, wellPathClipBoundingBox, rim3dWellLogCurve, it->second->vertices() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,13 +220,13 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList*
|
||||
backgroundEffectGen.enableDepthWrite( false );
|
||||
}
|
||||
|
||||
bool drawSurfaceCreated = m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]
|
||||
->createDrawSurface( displayCoordTransform,
|
||||
wellPathClipBoundingBox,
|
||||
Rim3dWellLogCurve::drawPlaneAngle( drawPlane ),
|
||||
wellPathCenterToPlotStartOffset( drawPlane ),
|
||||
planeWidth(),
|
||||
samplingInterval );
|
||||
bool drawSurfaceCreated =
|
||||
m_3dWellLogDrawSurfaceGeometryGenerators[drawPlane]->createDrawSurface( displayCoordTransform,
|
||||
wellPathClipBoundingBox,
|
||||
Rim3dWellLogCurve::drawPlaneAngle( drawPlane ),
|
||||
wellPathCenterToPlotStartOffset( drawPlane ),
|
||||
planeWidth(),
|
||||
samplingInterval );
|
||||
if ( !drawSurfaceCreated ) return;
|
||||
|
||||
cvf::ref<cvf::Effect> backgroundEffect = backgroundEffectGen.generateCachedEffect();
|
||||
|
@@ -29,8 +29,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part> RivBoxGeometryGenerator::createBoxFromVertices( const std::vector<cvf::Vec3f>& vertices,
|
||||
const cvf::Color3f color )
|
||||
cvf::ref<cvf::Part> RivBoxGeometryGenerator::createBoxFromVertices( const std::vector<cvf::Vec3f>& vertices, const cvf::Color3f color )
|
||||
{
|
||||
std::vector<cvf::Vec3f> boxVertices;
|
||||
|
||||
|
@@ -119,8 +119,7 @@ bool CellEdgeEffectGenerator::isEqual( const EffectGenerator* other ) const
|
||||
if ( otherCellFaceEffectGenerator && m_cellScalarMapper.p() == otherCellFaceEffectGenerator->m_cellScalarMapper.p() &&
|
||||
m_edgeScalarMapper.p() == otherCellFaceEffectGenerator->m_edgeScalarMapper.p() &&
|
||||
m_ternaryCellScalarMapper.p() == otherCellFaceEffectGenerator->m_ternaryCellScalarMapper.p() &&
|
||||
m_cullBackfaces == otherCellFaceEffectGenerator->m_cullBackfaces &&
|
||||
m_opacityLevel == otherCellFaceEffectGenerator->m_opacityLevel &&
|
||||
m_cullBackfaces == otherCellFaceEffectGenerator->m_cullBackfaces && m_opacityLevel == otherCellFaceEffectGenerator->m_opacityLevel &&
|
||||
m_undefinedColor == otherCellFaceEffectGenerator->m_undefinedColor &&
|
||||
m_defaultCellColor == otherCellFaceEffectGenerator->m_defaultCellColor &&
|
||||
m_disableLighting == otherCellFaceEffectGenerator->m_disableLighting )
|
||||
@@ -234,8 +233,7 @@ void CellEdgeEffectGenerator::updateForShaderBasedRendering( cvf::Effect* effect
|
||||
cvf::ref<cvf::ShaderProgram> prog = shaderGen.generate();
|
||||
eff->setShaderProgram( prog.p() );
|
||||
|
||||
if ( !m_disableLighting )
|
||||
prog->setDefaultUniform( new cvf::UniformFloat( "u_ecLightPosition", cvf::Vec3f( 0.5, 5.0, 7.0 ) ) );
|
||||
if ( !m_disableLighting ) prog->setDefaultUniform( new cvf::UniformFloat( "u_ecLightPosition", cvf::Vec3f( 0.5, 5.0, 7.0 ) ) );
|
||||
|
||||
// Set up textures
|
||||
|
||||
@@ -252,9 +250,8 @@ void CellEdgeEffectGenerator::updateForShaderBasedRendering( cvf::Effect* effect
|
||||
else if ( m_cellScalarMapper.notNull() )
|
||||
{
|
||||
m_cellScalarMapper->updateTexture( m_cellTextureImage.p() );
|
||||
modifiedCellTextImage = caf::ScalarMapperEffectGenerator::addAlphaAndUndefStripes( m_cellTextureImage.p(),
|
||||
m_undefinedColor,
|
||||
m_opacityLevel );
|
||||
modifiedCellTextImage =
|
||||
caf::ScalarMapperEffectGenerator::addAlphaAndUndefStripes( m_cellTextureImage.p(), m_undefinedColor, m_opacityLevel );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -43,14 +43,14 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||
cvf::DrawableGeo* geo,
|
||||
size_t gridIndex,
|
||||
bool useDefaultValueForHugeVals,
|
||||
float opacityLevel )
|
||||
bool useDefaultValueForHugeVals,
|
||||
float opacityLevel )
|
||||
{
|
||||
RigEclipseCaseData* eclipseCase = cellResultColors->reservoirView()->eclipseCase()->eclipseCaseData();
|
||||
CVF_ASSERT( eclipseCase != nullptr );
|
||||
@@ -59,11 +59,8 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t
|
||||
|
||||
cvf::ref<RigResultAccessor> cellCenterDataAccessObject =
|
||||
createCellCenterResultAccessor( cellResultColors, timeStepIndex, eclipseCase, eclipseCase->grid( gridIndex ) );
|
||||
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeResultAccessor( cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
timeStepIndex,
|
||||
eclipseCase,
|
||||
eclipseCase->grid( gridIndex ) );
|
||||
cvf::ref<RigResultAccessor> cellEdgeResultAccessor =
|
||||
createCellEdgeResultAccessor( cellResultColors, cellEdgeResultColors, timeStepIndex, eclipseCase, eclipseCase->grid( gridIndex ) );
|
||||
|
||||
size_t vertexCount = geo->vertexArray()->size();
|
||||
size_t quadCount = vertexCount / 4;
|
||||
@@ -97,8 +94,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t
|
||||
|
||||
if ( opacityLevel < 1.0f )
|
||||
{
|
||||
isWellPipeVisible =
|
||||
&( cellResultColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities( timeStepIndex ) );
|
||||
isWellPipeVisible = &( cellResultColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities( timeStepIndex ) );
|
||||
gridCellToWellindexMap = eclipseCase->gridCellToResultWellIndex( gridIndex );
|
||||
}
|
||||
|
||||
@@ -117,8 +113,8 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t
|
||||
|
||||
size_t cellIndex = quadToCellFaceMapper->cellIndex( quadIdx );
|
||||
{
|
||||
cvf::StructGridInterface::FaceType cellFace = quadToCellFaceMapper->cellFace( quadIdx );
|
||||
double scalarValue = cellCenterDataAccessObject->cellFaceScalar( cellIndex, cellFace );
|
||||
cvf::StructGridInterface::FaceType cellFace = quadToCellFaceMapper->cellFace( quadIdx );
|
||||
double scalarValue = cellCenterDataAccessObject->cellFaceScalar( cellIndex, cellFace );
|
||||
|
||||
{
|
||||
float cellColorTextureCoord = 0.5f; // If no results exists, the texture will have a special color
|
||||
@@ -161,8 +157,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t
|
||||
float edgeColor = -1.0f; // Undefined texture coord. Shader handles this.
|
||||
|
||||
double scalarValue =
|
||||
cellEdgeResultAccessor->cellFaceScalar( cellIndex,
|
||||
static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ) );
|
||||
cellEdgeResultAccessor->cellFaceScalar( cellIndex, static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ) );
|
||||
|
||||
if ( !hideScalarValue( scalarValue, ignoredScalarValue, 1e-2 ) )
|
||||
{
|
||||
@@ -181,8 +176,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t
|
||||
geo->setVertexAttribute( new cvf::Vec2fVertexAttribute( "a_localCoord", localCoords.p() ) );
|
||||
geo->setVertexAttribute( new cvf::FloatVertexAttribute( "a_colorCell", cellColorTextureCoordArray.p() ) );
|
||||
|
||||
cvf::ref<cvf::IntVertexAttributeDirect> faceIntAttribute =
|
||||
new cvf::IntVertexAttributeDirect( "a_face", faceIndexArray.p() );
|
||||
cvf::ref<cvf::IntVertexAttributeDirect> faceIntAttribute = new cvf::IntVertexAttributeDirect( "a_face", faceIndexArray.p() );
|
||||
geo->setVertexAttribute( faceIntAttribute.p() );
|
||||
|
||||
geo->setVertexAttribute( new cvf::FloatVertexAttribute( "a_colorPosI", cellEdgeColorTextureCoordsArrays.at( 0 ) ) );
|
||||
@@ -201,22 +195,19 @@ bool RivCellEdgeGeometryUtils::hideScalarValue( double scalarValue, double scala
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||
cvf::DrawableGeo* geo,
|
||||
size_t gridIndex,
|
||||
float opacityLevel )
|
||||
size_t gridIndex,
|
||||
float opacityLevel )
|
||||
{
|
||||
RigEclipseCaseData* eclipseCase = cellResultColors->reservoirView()->eclipseCase()->eclipseCaseData();
|
||||
CVF_ASSERT( eclipseCase != nullptr );
|
||||
|
||||
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeResultAccessor( cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
timeStepIndex,
|
||||
eclipseCase,
|
||||
eclipseCase->grid( gridIndex ) );
|
||||
cvf::ref<RigResultAccessor> cellEdgeResultAccessor =
|
||||
createCellEdgeResultAccessor( cellResultColors, cellEdgeResultColors, timeStepIndex, eclipseCase, eclipseCase->grid( gridIndex ) );
|
||||
|
||||
size_t vertexCount = geo->vertexArray()->size();
|
||||
size_t quadCount = vertexCount / 4;
|
||||
@@ -273,8 +264,7 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo( size_t
|
||||
float edgeColor = -1.0f; // Undefined texture coord. Shader handles this.
|
||||
|
||||
double scalarValue =
|
||||
cellEdgeResultAccessor->cellFaceScalar( cellIndex,
|
||||
static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ) );
|
||||
cellEdgeResultAccessor->cellFaceScalar( cellIndex, static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ) );
|
||||
|
||||
if ( !hideScalarValue( scalarValue, ignoredScalarValue, 1e-2 ) )
|
||||
{
|
||||
@@ -293,8 +283,7 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo( size_t
|
||||
geo->setVertexAttribute( new cvf::Vec2fVertexAttribute( "a_localCoord", localCoords.p() ) );
|
||||
geo->setVertexAttribute( new cvf::Vec2fVertexAttribute( "a_cellTextureCoord", vCellColorTextureCoordArray.p() ) );
|
||||
|
||||
cvf::ref<cvf::IntVertexAttributeDirect> faceIntAttribute =
|
||||
new cvf::IntVertexAttributeDirect( "a_face", faceIndexArray.p() );
|
||||
cvf::ref<cvf::IntVertexAttributeDirect> faceIntAttribute = new cvf::IntVertexAttributeDirect( "a_face", faceIndexArray.p() );
|
||||
geo->setVertexAttribute( faceIntAttribute.p() );
|
||||
|
||||
geo->setVertexAttribute( new cvf::FloatVertexAttribute( "a_colorPosI", cellEdgeColorTextureCoordsArrays.at( 0 ) ) );
|
||||
@@ -309,10 +298,10 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo( size_t
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccessor( RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
size_t timeStepIndex,
|
||||
RigEclipseCaseData* eclipseCase,
|
||||
const RigGridBase* grid )
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
size_t timeStepIndex,
|
||||
RigEclipseCaseData* eclipseCase,
|
||||
const RigGridBase* grid )
|
||||
{
|
||||
cvf::ref<RigCellEdgeResultAccessor> cellEdgeResultAccessor = new RigCellEdgeResultAccessor();
|
||||
|
||||
@@ -331,14 +320,12 @@ cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccess
|
||||
}
|
||||
|
||||
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
|
||||
cvf::ref<RigResultAccessor> daObj =
|
||||
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
grid->gridIndex(),
|
||||
porosityModel,
|
||||
adjustedTimeStep,
|
||||
resultAddresses[cubeFaceIdx] );
|
||||
cellEdgeResultAccessor->setDataAccessObjectForFace( static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ),
|
||||
daObj.p() );
|
||||
cvf::ref<RigResultAccessor> daObj = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
grid->gridIndex(),
|
||||
porosityModel,
|
||||
adjustedTimeStep,
|
||||
resultAddresses[cubeFaceIdx] );
|
||||
cellEdgeResultAccessor->setDataAccessObjectForFace( static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ), daObj.p() );
|
||||
}
|
||||
|
||||
return cellEdgeResultAccessor;
|
||||
@@ -348,18 +335,16 @@ cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccess
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellCenterResultAccessor( RimEclipseCellColors* cellResultColors,
|
||||
size_t timeStepIndex,
|
||||
RigEclipseCaseData* eclipseCase,
|
||||
const RigGridBase* grid )
|
||||
size_t timeStepIndex,
|
||||
RigEclipseCaseData* eclipseCase,
|
||||
const RigGridBase* grid )
|
||||
{
|
||||
cvf::ref<RigResultAccessor> resultAccessor = nullptr;
|
||||
|
||||
if ( cellResultColors->hasResult() )
|
||||
{
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition( eclipseCase,
|
||||
grid->gridIndex(),
|
||||
timeStepIndex,
|
||||
cellResultColors );
|
||||
resultAccessor =
|
||||
RigResultAccessorFactory::createFromResultDefinition( eclipseCase, grid->gridIndex(), timeStepIndex, cellResultColors );
|
||||
}
|
||||
|
||||
if ( resultAccessor.isNull() )
|
||||
|
@@ -35,8 +35,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivContourMapProjectionPartMgr::RivContourMapProjectionPartMgr( RimContourMapProjection* contourMapProjection,
|
||||
RimGridView* contourMap )
|
||||
RivContourMapProjectionPartMgr::RivContourMapProjectionPartMgr( RimContourMapProjection* contourMapProjection, RimGridView* contourMap )
|
||||
{
|
||||
m_contourMapProjection = contourMapProjection;
|
||||
m_parentContourMap = contourMap;
|
||||
@@ -104,10 +103,9 @@ cvf::ref<cvf::Vec2fArray> RivContourMapProjectionPartMgr::createTextureCoords( c
|
||||
{
|
||||
if ( values[i] != std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
cvf::Vec2f textureCoord =
|
||||
m_contourMapProjection->legendConfig()->scalarMapper()->mapToTextureCoord( values[i] );
|
||||
textureCoord.y() = 0.0;
|
||||
( *textureCoords )[i] = textureCoord;
|
||||
cvf::Vec2f textureCoord = m_contourMapProjection->legendConfig()->scalarMapper()->mapToTextureCoord( values[i] );
|
||||
textureCoord.y() = 0.0;
|
||||
( *textureCoords )[i] = textureCoord;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -190,8 +188,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableText> RivContourMapProjectionPartMgr::createTextLabel( const cvf::Color3f& textColor,
|
||||
const cvf::Color3f& backgroundColor )
|
||||
cvf::ref<cvf::DrawableText> RivContourMapProjectionPartMgr::createTextLabel( const cvf::Color3f& textColor, const cvf::Color3f& backgroundColor )
|
||||
{
|
||||
auto font = RiaFontCache::getFont( RiaFontCache::FontSize::FONT_SIZE_10 );
|
||||
|
||||
@@ -212,8 +209,7 @@ cvf::ref<cvf::DrawableText> RivContourMapProjectionPartMgr::createTextLabel( con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part>
|
||||
RivContourMapProjectionPartMgr::createProjectionMapPart( const caf::DisplayCoordTransform* displayCoordTransform ) const
|
||||
cvf::ref<cvf::Part> RivContourMapProjectionPartMgr::createProjectionMapPart( const caf::DisplayCoordTransform* displayCoordTransform ) const
|
||||
{
|
||||
const std::vector<cvf::Vec4d>& vertices = m_contourMapTriangles;
|
||||
if ( vertices.size() < 3u )
|
||||
@@ -225,16 +221,14 @@ cvf::ref<cvf::Part>
|
||||
std::vector<double> values( vertices.size() );
|
||||
for ( uint i = 0; i < vertices.size(); ++i )
|
||||
{
|
||||
cvf::Vec3d globalVertex = cvf::Vec3d( vertices[i].x(), vertices[i].y(), vertices[i].z() ) +
|
||||
m_contourMapProjection->origin3d();
|
||||
cvf::Vec3d globalVertex = cvf::Vec3d( vertices[i].x(), vertices[i].y(), vertices[i].z() ) + m_contourMapProjection->origin3d();
|
||||
cvf::Vec3f displayVertexPos( displayCoordTransform->transformToDisplayCoord( globalVertex ) );
|
||||
( *vertexArray )[i] = displayVertexPos;
|
||||
( *faceList )[i] = i;
|
||||
values[i] = vertices[i].w();
|
||||
}
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexUInt =
|
||||
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_TRIANGLES, faceList.p() );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexUInt = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_TRIANGLES, faceList.p() );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;
|
||||
geo->addPrimitiveSet( indexUInt.p() );
|
||||
@@ -264,7 +258,7 @@ cvf::ref<cvf::Part>
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
RivContourMapProjectionPartMgr::createContourPolygons( const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
RivContourMapProjectionPartMgr::createContourPolygons( const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const std::vector<std::vector<cvf::BoundingBox>>& labelBBoxes ) const
|
||||
{
|
||||
const cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
|
||||
@@ -292,7 +286,7 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
displayLines.reserve( nVertices * 2 );
|
||||
for ( size_t v = 0; v < nVertices; ++v )
|
||||
{
|
||||
cvf::Vec3d globalVertex1 = m_contourLinePolygons[i][j].vertices[v] + m_contourMapProjection->origin3d();
|
||||
cvf::Vec3d globalVertex1 = m_contourLinePolygons[i][j].vertices[v] + m_contourMapProjection->origin3d();
|
||||
cvf::Vec3d displayVertex1 = displayCoordTransform->transformToDisplayCoord( globalVertex1 );
|
||||
|
||||
cvf::Vec3d globalVertex2;
|
||||
@@ -372,9 +366,8 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
indices.push_back( k );
|
||||
}
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt =
|
||||
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
indexedUInt->setIndices( indexArray.p() );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;
|
||||
@@ -395,8 +388,8 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::ref<cvf::Drawable>>
|
||||
RivContourMapProjectionPartMgr::createContourLabels( const cvf::Camera* camera,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
RivContourMapProjectionPartMgr::createContourLabels( const cvf::Camera* camera,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
std::vector<std::vector<cvf::BoundingBox>>* labelBBoxes ) const
|
||||
{
|
||||
CVF_ASSERT( camera && displayCoordTransform && labelBBoxes );
|
||||
@@ -422,8 +415,8 @@ std::vector<cvf::ref<cvf::Drawable>>
|
||||
{
|
||||
if ( m_contourLinePolygons[i][j].vertices.empty() ) continue;
|
||||
|
||||
QString qLabelText = m_contourMapProjection->legendConfig()->valueToText( m_contourLinePolygons[i][j].value );
|
||||
cvf::String labelText = cvfqt::Utils::toString( qLabelText );
|
||||
QString qLabelText = m_contourMapProjection->legendConfig()->valueToText( m_contourLinePolygons[i][j].value );
|
||||
cvf::String labelText = cvfqt::Utils::toString( qLabelText );
|
||||
|
||||
size_t nVertices = m_contourLinePolygons[i][j].vertices.size();
|
||||
size_t nLabels = nVertices;
|
||||
@@ -453,17 +446,15 @@ std::vector<cvf::ref<cvf::Drawable>>
|
||||
camera->project( displayVertex, &windowVertex );
|
||||
CVF_ASSERT( !windowVertex.isUndefined() );
|
||||
displayVertex.z() += 10.0f;
|
||||
cvf::BoundingBox windowBBox =
|
||||
label->textBoundingBox( labelText, cvf::Vec3f::ZERO, cvf::Vec3f( segment.getNormalized() ) );
|
||||
cvf::Vec3d displayBBoxMin, displayBBoxMax;
|
||||
cvf::BoundingBox windowBBox = label->textBoundingBox( labelText, cvf::Vec3f::ZERO, cvf::Vec3f( segment.getNormalized() ) );
|
||||
cvf::Vec3d displayBBoxMin, displayBBoxMax;
|
||||
camera->unproject( windowBBox.min() + windowVertex, &displayBBoxMin );
|
||||
camera->unproject( windowBBox.max() + windowVertex, &displayBBoxMax );
|
||||
|
||||
CVF_ASSERT( !displayBBoxMin.isUndefined() );
|
||||
CVF_ASSERT( !displayBBoxMax.isUndefined() );
|
||||
|
||||
cvf::BoundingBox displayBBox( displayBBoxMin - cvf::Vec3d::Z_AXIS * 20.0,
|
||||
displayBBoxMax + cvf::Vec3d::Z_AXIS * 20.0 );
|
||||
cvf::BoundingBox displayBBox( displayBBoxMin - cvf::Vec3d::Z_AXIS * 20.0, displayBBoxMax + cvf::Vec3d::Z_AXIS * 20.0 );
|
||||
|
||||
cvf::Vec3d currentExtent = displayBBoxMax - displayBBoxMin;
|
||||
|
||||
@@ -546,9 +537,8 @@ cvf::ref<cvf::DrawableGeo>
|
||||
indices.push_back( j );
|
||||
}
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt =
|
||||
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
indexedUInt->setIndices( indexArray.p() );
|
||||
|
||||
geo = new cvf::DrawableGeo;
|
||||
@@ -562,9 +552,8 @@ cvf::ref<cvf::DrawableGeo>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivContourMapProjectionPartMgr::lineOverlapsWithPreviousContourLevel(
|
||||
const cvf::Vec3d& lineCenter,
|
||||
const RimContourMapProjection::ContourPolygons* previousLevel ) const
|
||||
bool RivContourMapProjectionPartMgr::lineOverlapsWithPreviousContourLevel( const cvf::Vec3d& lineCenter,
|
||||
const RimContourMapProjection::ContourPolygons* previousLevel ) const
|
||||
{
|
||||
const int64_t jump = 50;
|
||||
CVF_ASSERT( previousLevel );
|
||||
@@ -576,7 +565,7 @@ bool RivContourMapProjectionPartMgr::lineOverlapsWithPreviousContourLevel(
|
||||
{
|
||||
const cvf::Vec3d& edgeVertex1 = edgePolygon.vertices[i];
|
||||
const cvf::Vec3d& edgeVertex2 = edgePolygon.vertices[( i + 1 ) % edgePolygon.vertices.size()];
|
||||
double dist1 = cvf::GeometryTools::linePointSquareDist( edgeVertex1, edgeVertex2, lineCenter );
|
||||
double dist1 = cvf::GeometryTools::linePointSquareDist( edgeVertex1, edgeVertex2, lineCenter );
|
||||
if ( dist1 < tolerance )
|
||||
{
|
||||
return true;
|
||||
@@ -592,7 +581,7 @@ bool RivContourMapProjectionPartMgr::lineOverlapsWithPreviousContourLevel(
|
||||
{
|
||||
const cvf::Vec3d& edgeVertex1 = edgePolygon.vertices[i];
|
||||
const cvf::Vec3d& edgeVertex2 = edgePolygon.vertices[( i + 1 ) % edgePolygon.vertices.size()];
|
||||
double dist1 = cvf::GeometryTools::linePointSquareDist( edgeVertex1, edgeVertex2, lineCenter );
|
||||
double dist1 = cvf::GeometryTools::linePointSquareDist( edgeVertex1, edgeVertex2, lineCenter );
|
||||
if ( dist1 < tolerance )
|
||||
{
|
||||
return true;
|
||||
|
@@ -46,20 +46,18 @@ public:
|
||||
void appendContourLinesToModel( const cvf::Camera* camera,
|
||||
cvf::ModelBasicList* model,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform );
|
||||
void appendPickPointVisToModel( cvf::ModelBasicList* model,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
||||
void appendPickPointVisToModel( cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
||||
|
||||
cvf::ref<cvf::Vec2fArray> createTextureCoords( const std::vector<double>& values ) const;
|
||||
|
||||
private:
|
||||
static cvf::ref<cvf::DrawableText> createTextLabel( const cvf::Color3f& textColor, const cvf::Color3f& backgroundColor );
|
||||
cvf::ref<cvf::Part> createProjectionMapPart( const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
||||
std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
createContourPolygons( const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const std::vector<std::vector<cvf::BoundingBox>>& labelBBoxes ) const;
|
||||
std::vector<cvf::ref<cvf::Drawable>> createContourLabels( const cvf::Camera* camera,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
std::vector<std::vector<cvf::BoundingBox>>* labelBBoxes ) const;
|
||||
cvf::ref<cvf::Part> createProjectionMapPart( const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
||||
std::vector<std::vector<cvf::ref<cvf::Drawable>>> createContourPolygons( const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
const std::vector<std::vector<cvf::BoundingBox>>& labelBBoxes ) const;
|
||||
std::vector<cvf::ref<cvf::Drawable>> createContourLabels( const cvf::Camera* camera,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
std::vector<std::vector<cvf::BoundingBox>>* labelBBoxes ) const;
|
||||
cvf::ref<cvf::DrawableGeo> createPickPointVisDrawable( const caf::DisplayCoordTransform* displayCoordTransform ) const;
|
||||
bool lineOverlapsWithPreviousContourLevel( const cvf::Vec3d& lineCenter,
|
||||
const RimContourMapProjection::ContourPolygons* previousLevel ) const;
|
||||
|
@@ -41,9 +41,7 @@ RivDrawableSpheres::RivDrawableSpheres( cvf::String vectorMatrixUniformName, cvf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Estimate the intersection of a sphere by the sphere inscribed in a bounding box
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivDrawableSpheres::rayIntersectCreateDetail( const cvf::Ray& ray,
|
||||
cvf::Vec3d* intersectionPoint,
|
||||
cvf::ref<cvf::HitDetail>* hitDetail ) const
|
||||
bool RivDrawableSpheres::rayIntersectCreateDetail( const cvf::Ray& ray, cvf::Vec3d* intersectionPoint, cvf::ref<cvf::HitDetail>* hitDetail ) const
|
||||
{
|
||||
if ( m_centerCoordArray.isNull() ) return false;
|
||||
|
||||
|
@@ -26,9 +26,7 @@ public:
|
||||
RivDrawableSpheres();
|
||||
RivDrawableSpheres( cvf::String vectorMatrixUniformName, cvf::String colorUniformName );
|
||||
|
||||
bool rayIntersectCreateDetail( const cvf::Ray& ray,
|
||||
cvf::Vec3d* intersectionPoint,
|
||||
cvf::ref<cvf::HitDetail>* hitDetail ) const override;
|
||||
bool rayIntersectCreateDetail( const cvf::Ray& ray, cvf::Vec3d* intersectionPoint, cvf::ref<cvf::HitDetail>* hitDetail ) const override;
|
||||
|
||||
void setRadius( float radius );
|
||||
void setCenterCoords( cvf::Vec3fArray* vertexArray );
|
||||
|
@@ -110,7 +110,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
|
||||
std::vector<RigEclipseResultAddress> resultAddresses;
|
||||
std::vector<cvf::StructGridInterface::FaceType> directions;
|
||||
RigCaseCellResultsData* resultsData = eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
RigCaseCellResultsData* resultsData = eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
{
|
||||
std::vector<RigEclipseResultAddress> addresses;
|
||||
result->resultAddressesIJK( addresses );
|
||||
@@ -122,8 +122,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_I );
|
||||
|
||||
auto candidate = addresses[0 + fluidIndex];
|
||||
if ( resultsData->hasResultEntry( candidate ) &&
|
||||
!resultsData->cellScalarResults( candidate, timeStepIndex ).empty() )
|
||||
if ( resultsData->hasResultEntry( candidate ) && !resultsData->cellScalarResults( candidate, timeStepIndex ).empty() )
|
||||
{
|
||||
resultAddresses.push_back( candidate );
|
||||
}
|
||||
@@ -132,8 +131,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
{
|
||||
if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_J );
|
||||
auto candidate = addresses[1 + fluidIndex];
|
||||
if ( resultsData->hasResultEntry( candidate ) &&
|
||||
!resultsData->cellScalarResults( candidate, timeStepIndex ).empty() )
|
||||
if ( resultsData->hasResultEntry( candidate ) && !resultsData->cellScalarResults( candidate, timeStepIndex ).empty() )
|
||||
{
|
||||
resultAddresses.push_back( candidate );
|
||||
}
|
||||
@@ -142,8 +140,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
{
|
||||
if ( fluidIndex == 0 ) directions.push_back( cvf::StructGridInterface::POS_K );
|
||||
auto candidate = addresses[2 + fluidIndex];
|
||||
if ( resultsData->hasResultEntry( candidate ) &&
|
||||
!resultsData->cellScalarResults( candidate, timeStepIndex ).empty() )
|
||||
if ( resultsData->hasResultEntry( candidate ) && !resultsData->cellScalarResults( candidate, timeStepIndex ).empty() )
|
||||
{
|
||||
resultAddresses.push_back( candidate );
|
||||
}
|
||||
@@ -155,15 +152,14 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
|
||||
const std::vector<RigCell>& cells = eclipseCase->mainGrid()->globalCellArray();
|
||||
|
||||
auto getFaceCenterAndNormal =
|
||||
[activeCellInfo, cells, arrowScaling, displayCordXf]( size_t globalCellIdx,
|
||||
cvf::StructGridInterface::FaceType faceType,
|
||||
cvf::Vec3d& faceCenter,
|
||||
cvf::Vec3d& faceNormal ) {
|
||||
faceCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].faceCenter( faceType ) );
|
||||
cvf::Vec3d cellCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].center() );
|
||||
faceNormal = ( faceCenter - cellCenter ).getNormalized() * arrowScaling;
|
||||
};
|
||||
auto getFaceCenterAndNormal = [activeCellInfo, cells, arrowScaling, displayCordXf]( size_t globalCellIdx,
|
||||
cvf::StructGridInterface::FaceType faceType,
|
||||
cvf::Vec3d& faceCenter,
|
||||
cvf::Vec3d& faceNormal ) {
|
||||
faceCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].faceCenter( faceType ) );
|
||||
cvf::Vec3d cellCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].center() );
|
||||
faceNormal = ( faceCenter - cellCenter ).getNormalized() * arrowScaling;
|
||||
};
|
||||
|
||||
if ( !resultAddresses.empty() && !directions.empty() )
|
||||
{
|
||||
@@ -180,8 +176,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
double resultValue = 0.0;
|
||||
for ( size_t flIdx = dir; flIdx < resultAddresses.size(); flIdx += directions.size() )
|
||||
{
|
||||
resultValue +=
|
||||
resultsData->cellScalarResults( resultAddresses[flIdx], timeStepIndex ).at( resultIdx );
|
||||
resultValue += resultsData->cellScalarResults( resultAddresses[flIdx], timeStepIndex ).at( resultIdx );
|
||||
}
|
||||
|
||||
if ( std::abs( resultValue ) >= result->threshold() )
|
||||
@@ -192,20 +187,18 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
faceNormal *= std::abs( resultValue );
|
||||
|
||||
bool centerArrow = false;
|
||||
if ( result->vectorSuraceCrossingLocation() ==
|
||||
RimElementVectorResult::VectorSurfaceCrossingLocation::VECTOR_CENTER &&
|
||||
if ( result->vectorSuraceCrossingLocation() == RimElementVectorResult::VectorSurfaceCrossingLocation::VECTOR_CENTER &&
|
||||
result->vectorView() == RimElementVectorResult::VectorView::PER_FACE )
|
||||
{
|
||||
centerArrow = true;
|
||||
}
|
||||
|
||||
#pragma omp critical( critical_section_RivElementVectorResultPartMgr_add_1 )
|
||||
tensorVisualizations.push_back(
|
||||
ElementVectorResultVisualization( faceCenter,
|
||||
faceNormal,
|
||||
resultValue,
|
||||
std::cbrt( cells[gcIdx].volume() / 3.0 ),
|
||||
centerArrow ) );
|
||||
tensorVisualizations.push_back( ElementVectorResultVisualization( faceCenter,
|
||||
faceNormal,
|
||||
resultValue,
|
||||
std::cbrt( cells[gcIdx].volume() / 3.0 ),
|
||||
centerArrow ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,8 +211,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
double resultValue = 0.0;
|
||||
for ( size_t flIdx = dir; flIdx < resultAddresses.size(); flIdx += directions.size() )
|
||||
{
|
||||
resultValue +=
|
||||
resultsData->cellScalarResults( resultAddresses[flIdx], timeStepIndex ).at( resultIdx );
|
||||
resultValue += resultsData->cellScalarResults( resultAddresses[flIdx], timeStepIndex ).at( resultIdx );
|
||||
}
|
||||
|
||||
cvf::Vec3d faceCenter;
|
||||
@@ -233,8 +225,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
if ( aggregatedResult.length() >= result->threshold() )
|
||||
{
|
||||
bool centerArrow = false;
|
||||
if ( result->vectorSuraceCrossingLocation() ==
|
||||
RimElementVectorResult::VectorSurfaceCrossingLocation::VECTOR_CENTER )
|
||||
if ( result->vectorSuraceCrossingLocation() == RimElementVectorResult::VectorSurfaceCrossingLocation::VECTOR_CENTER )
|
||||
{
|
||||
centerArrow = true;
|
||||
}
|
||||
@@ -287,8 +278,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
}
|
||||
}
|
||||
|
||||
cvf::Vec3d connCenter =
|
||||
static_cast<cvf::Vec3d>( cvf::GeometryTools::computePolygonCenter<cvf::Vec3f>( conn.polygon() ) );
|
||||
cvf::Vec3d connCenter = static_cast<cvf::Vec3d>( cvf::GeometryTools::computePolygonCenter<cvf::Vec3f>( conn.polygon() ) );
|
||||
|
||||
cvf::Vec3d faceCenter;
|
||||
cvf::Vec3d connNormal;
|
||||
@@ -304,18 +294,16 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
}
|
||||
else if ( result->vectorView() == RimElementVectorResult::VectorView::PER_FACE )
|
||||
{
|
||||
if ( result->vectorSuraceCrossingLocation() ==
|
||||
RimElementVectorResult::VectorSurfaceCrossingLocation::VECTOR_CENTER )
|
||||
if ( result->vectorSuraceCrossingLocation() == RimElementVectorResult::VectorSurfaceCrossingLocation::VECTOR_CENTER )
|
||||
centerArrow = true;
|
||||
}
|
||||
|
||||
#pragma omp critical( critical_section_RivElementVectorResultPartMgr_add_nnc )
|
||||
tensorVisualizations.push_back(
|
||||
ElementVectorResultVisualization( displayCordXf->transformToDisplayCoord( connCenter ),
|
||||
connNormal,
|
||||
resultValue,
|
||||
std::cbrt( cells[conn.c1GlobIdx()].volume() / 3.0 ),
|
||||
centerArrow ) );
|
||||
tensorVisualizations.push_back( ElementVectorResultVisualization( displayCordXf->transformToDisplayCoord( connCenter ),
|
||||
connNormal,
|
||||
resultValue,
|
||||
std::cbrt( cells[conn.c1GlobIdx()].volume() / 3.0 ),
|
||||
centerArrow ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332,9 +320,8 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part>
|
||||
RivElementVectorResultPartMgr::createPart( const RimElementVectorResult& result,
|
||||
const std::vector<ElementVectorResultVisualization>& tensorVisualizations ) const
|
||||
cvf::ref<cvf::Part> RivElementVectorResultPartMgr::createPart( const RimElementVectorResult& result,
|
||||
const std::vector<ElementVectorResultVisualization>& tensorVisualizations ) const
|
||||
{
|
||||
std::vector<uint> shaftIndices;
|
||||
shaftIndices.reserve( tensorVisualizations.size() * 2 );
|
||||
@@ -366,13 +353,11 @@ cvf::ref<cvf::Part>
|
||||
counter += 7;
|
||||
}
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUIntShaft =
|
||||
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArrayShaft = new cvf::UIntArray( shaftIndices );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUIntShaft = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArrayShaft = new cvf::UIntArray( shaftIndices );
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUIntHead =
|
||||
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_TRIANGLES );
|
||||
cvf::ref<cvf::UIntArray> indexArrayHead = new cvf::UIntArray( headIndices );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUIntHead = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_TRIANGLES );
|
||||
cvf::ref<cvf::UIntArray> indexArrayHead = new cvf::UIntArray( headIndices );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> drawable = new cvf::DrawableGeo();
|
||||
|
||||
@@ -426,10 +411,9 @@ cvf::ref<cvf::Part>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivElementVectorResultPartMgr::createResultColorTextureCoords(
|
||||
cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<ElementVectorResultVisualization>& elementVectorResultVisualizations,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
void RivElementVectorResultPartMgr::createResultColorTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<ElementVectorResultVisualization>& elementVectorResultVisualizations,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
CVF_ASSERT( textureCoords );
|
||||
CVF_ASSERT( mapper );
|
||||
@@ -450,8 +434,7 @@ void RivElementVectorResultPartMgr::createResultColorTextureCoords(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::array<cvf::Vec3f, 7>
|
||||
RivElementVectorResultPartMgr::createArrowVertices( const ElementVectorResultVisualization& evrViz ) const
|
||||
std::array<cvf::Vec3f, 7> RivElementVectorResultPartMgr::createArrowVertices( const ElementVectorResultVisualization& evrViz ) const
|
||||
{
|
||||
std::array<cvf::Vec3f, 7> vertices;
|
||||
|
||||
|
@@ -54,11 +54,7 @@ public:
|
||||
private:
|
||||
struct ElementVectorResultVisualization
|
||||
{
|
||||
ElementVectorResultVisualization( cvf::Vec3d faceCenter,
|
||||
cvf::Vec3d faceNormal,
|
||||
double result,
|
||||
double approximateCellLength,
|
||||
bool centerArrow )
|
||||
ElementVectorResultVisualization( cvf::Vec3d faceCenter, cvf::Vec3d faceNormal, double result, double approximateCellLength, bool centerArrow )
|
||||
: faceCenter( faceCenter )
|
||||
, faceNormal( faceNormal )
|
||||
, result( result )
|
||||
@@ -78,10 +74,9 @@ private:
|
||||
cvf::ref<cvf::Part> createPart( const RimElementVectorResult& result,
|
||||
const std::vector<ElementVectorResultVisualization>& tensorVisualizations ) const;
|
||||
|
||||
static void
|
||||
createResultColorTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<ElementVectorResultVisualization>& elementVectorResultVisualizations,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
static void createResultColorTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<ElementVectorResultVisualization>& elementVectorResultVisualizations,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
|
||||
std::array<cvf::Vec3f, 7> createArrowVertices( const ElementVectorResultVisualization& tensorVisualization ) const;
|
||||
std::array<uint, 2> createArrowShaftIndices( uint startIndex ) const;
|
||||
|
@@ -198,8 +198,7 @@ void RivFaultGeometryGenerator::computeArrays( bool onlyShowFacesWithDefinedNeig
|
||||
|
||||
if ( !( *m_cellVisibility )[cellIndex] ) continue;
|
||||
|
||||
if ( onlyShowFacesWithDefinedNeighbors && !hasConnection( cellIndex, face, connections, connIndices ) )
|
||||
continue;
|
||||
if ( onlyShowFacesWithDefinedNeighbors && !hasConnection( cellIndex, face, connections, connIndices ) ) continue;
|
||||
|
||||
m_grid->cellCornerVertices( cellIndex, cornerVerts );
|
||||
m_grid->cellFaceVertexIndices( face, faceConn );
|
||||
|
@@ -44,10 +44,7 @@ class RigFault;
|
||||
class RivFaultGeometryGenerator : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RivFaultGeometryGenerator( const cvf::StructGridInterface* grid,
|
||||
const RigFault* fault,
|
||||
RigNNCData* nncData,
|
||||
bool computeNativeFaultFaces );
|
||||
RivFaultGeometryGenerator( const cvf::StructGridInterface* grid, const RigFault* fault, RigNNCData* nncData, bool computeNativeFaultFaces );
|
||||
~RivFaultGeometryGenerator() override;
|
||||
|
||||
void setCellVisibility( const cvf::UByteArray* cellVisibilities );
|
||||
|
@@ -57,9 +57,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivFaultPartMgr::RivFaultPartMgr( const RigGridBase* grid,
|
||||
const RimFaultInViewCollection* rimFaultCollection,
|
||||
RimFaultInView* rimFault )
|
||||
RivFaultPartMgr::RivFaultPartMgr( const RigGridBase* grid, const RimFaultInViewCollection* rimFaultCollection, RimFaultInView* rimFault )
|
||||
: m_grid( grid )
|
||||
, m_rimFaultCollection( rimFaultCollection )
|
||||
, m_rimFault( rimFault )
|
||||
@@ -73,11 +71,9 @@ RivFaultPartMgr::RivFaultPartMgr( const RigGridBase* grid,
|
||||
{
|
||||
CVF_ASSERT( rimFault->faultGeometry() );
|
||||
|
||||
m_nativeFaultGenerator =
|
||||
new RivFaultGeometryGenerator( grid, rimFault->faultGeometry(), grid->mainGrid()->nncData(), true );
|
||||
m_nativeFaultGenerator = new RivFaultGeometryGenerator( grid, rimFault->faultGeometry(), grid->mainGrid()->nncData(), true );
|
||||
|
||||
m_oppositeFaultGenerator =
|
||||
new RivFaultGeometryGenerator( grid, rimFault->faultGeometry(), grid->mainGrid()->nncData(), false );
|
||||
m_oppositeFaultGenerator = new RivFaultGeometryGenerator( grid, rimFault->faultGeometry(), grid->mainGrid()->nncData(), false );
|
||||
|
||||
m_nativeFaultFacesTextureCoords = new cvf::Vec2fArray;
|
||||
m_oppositeFaultFacesTextureCoords = new cvf::Vec2fArray;
|
||||
@@ -227,17 +223,16 @@ void RivFaultPartMgr::updateCellEdgeResultColor( size_t timeStepI
|
||||
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>( m_nativeFaultFaces->drawable() );
|
||||
if ( dg )
|
||||
{
|
||||
cvf::ref<cvf::Effect> eff =
|
||||
RivScalarMapperUtils::createCellEdgeEffect( dg,
|
||||
m_nativeFaultGenerator->quadToCellFaceMapper(),
|
||||
m_grid->gridIndex(),
|
||||
timeStepIndex,
|
||||
cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
m_opacityLevel,
|
||||
m_defaultColor,
|
||||
this->faceCullingMode(),
|
||||
cellResultColors->reservoirView()->isLightingDisabled() );
|
||||
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect( dg,
|
||||
m_nativeFaultGenerator->quadToCellFaceMapper(),
|
||||
m_grid->gridIndex(),
|
||||
timeStepIndex,
|
||||
cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
m_opacityLevel,
|
||||
m_defaultColor,
|
||||
this->faceCullingMode(),
|
||||
cellResultColors->reservoirView()->isLightingDisabled() );
|
||||
|
||||
m_nativeFaultFaces->setEffect( eff.p() );
|
||||
}
|
||||
@@ -248,17 +243,16 @@ void RivFaultPartMgr::updateCellEdgeResultColor( size_t timeStepI
|
||||
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>( m_oppositeFaultFaces->drawable() );
|
||||
if ( dg )
|
||||
{
|
||||
cvf::ref<cvf::Effect> eff =
|
||||
RivScalarMapperUtils::createCellEdgeEffect( dg,
|
||||
m_oppositeFaultGenerator->quadToCellFaceMapper(),
|
||||
m_grid->gridIndex(),
|
||||
timeStepIndex,
|
||||
cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
m_opacityLevel,
|
||||
m_defaultColor,
|
||||
this->faceCullingMode(),
|
||||
cellResultColors->reservoirView()->isLightingDisabled() );
|
||||
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect( dg,
|
||||
m_oppositeFaultGenerator->quadToCellFaceMapper(),
|
||||
m_grid->gridIndex(),
|
||||
timeStepIndex,
|
||||
cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
m_opacityLevel,
|
||||
m_defaultColor,
|
||||
this->faceCullingMode(),
|
||||
cellResultColors->reservoirView()->isLightingDisabled() );
|
||||
|
||||
m_oppositeFaultFaces->setEffect( eff.p() );
|
||||
}
|
||||
@@ -273,8 +267,7 @@ void RivFaultPartMgr::generatePartGeometry()
|
||||
bool useBufferObjects = true;
|
||||
// Surface geometry
|
||||
{
|
||||
cvf::ref<cvf::DrawableGeo> geo =
|
||||
m_nativeFaultGenerator->generateSurface( m_rimFaultCollection->onlyShowFacesWithDefinedNeighbor() );
|
||||
cvf::ref<cvf::DrawableGeo> geo = m_nativeFaultGenerator->generateSurface( m_rimFaultCollection->onlyShowFacesWithDefinedNeighbor() );
|
||||
if ( geo.notNull() )
|
||||
{
|
||||
geo->computeNormals();
|
||||
@@ -327,8 +320,7 @@ void RivFaultPartMgr::generatePartGeometry()
|
||||
|
||||
// Surface geometry
|
||||
{
|
||||
cvf::ref<cvf::DrawableGeo> geo =
|
||||
m_oppositeFaultGenerator->generateSurface( m_rimFaultCollection->onlyShowFacesWithDefinedNeighbor() );
|
||||
cvf::ref<cvf::DrawableGeo> geo = m_oppositeFaultGenerator->generateSurface( m_rimFaultCollection->onlyShowFacesWithDefinedNeighbor() );
|
||||
if ( geo.notNull() )
|
||||
{
|
||||
geo->computeNormals();
|
||||
@@ -446,10 +438,8 @@ void RivFaultPartMgr::generateAllNncPartGeometry()
|
||||
auto nncConnectionIndices = m_rimFault->faultGeometry()->connectionIndices();
|
||||
if ( !nncConnectionIndices.empty() )
|
||||
{
|
||||
m_allanNNCGenerator = new RivNNCGeometryGenerator( true,
|
||||
m_grid->mainGrid()->nncData(),
|
||||
m_grid->mainGrid()->displayModelOffset(),
|
||||
nncConnectionIndices );
|
||||
m_allanNNCGenerator =
|
||||
new RivNNCGeometryGenerator( true, m_grid->mainGrid()->nncData(), m_grid->mainGrid()->displayModelOffset(), nncConnectionIndices );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,10 +530,8 @@ void RivFaultPartMgr::updatePartEffect()
|
||||
if ( m_opacityLevel < 1.0f )
|
||||
{
|
||||
// Set priority to make sure this transparent geometry are rendered last
|
||||
if ( m_nativeFaultFaces.notNull() )
|
||||
m_nativeFaultFaces->setPriority( RivPartPriority::PartType::TransparentFault );
|
||||
if ( m_oppositeFaultFaces.notNull() )
|
||||
m_oppositeFaultFaces->setPriority( RivPartPriority::PartType::TransparentFault );
|
||||
if ( m_nativeFaultFaces.notNull() ) m_nativeFaultFaces->setPriority( RivPartPriority::PartType::TransparentFault );
|
||||
if ( m_oppositeFaultFaces.notNull() ) m_oppositeFaultFaces->setPriority( RivPartPriority::PartType::TransparentFault );
|
||||
|
||||
if ( m_NNCFaces.notNull() ) m_NNCFaces->setPriority( RivPartPriority::PartType::TransparentNnc );
|
||||
if ( m_allanNNCFaces.notNull() ) m_allanNNCFaces->setPriority( RivPartPriority::PartType::TransparentNnc );
|
||||
@@ -859,20 +847,12 @@ void RivFaultPartMgr::updateNNCColors( size_t timeStepIndex, RimEclipseCellColor
|
||||
|
||||
if ( updateNnc )
|
||||
{
|
||||
m_NNCGenerator->textureCoordinates( m_NNCTextureCoords.p(),
|
||||
mapper,
|
||||
resultType,
|
||||
eclResAddr,
|
||||
nativeTimeStepIndex );
|
||||
m_NNCGenerator->textureCoordinates( m_NNCTextureCoords.p(), mapper, resultType, eclResAddr, nativeTimeStepIndex );
|
||||
}
|
||||
|
||||
if ( updateAllan )
|
||||
{
|
||||
m_allanNNCGenerator->textureCoordinates( m_allanNNCTextureCoords.p(),
|
||||
mapper,
|
||||
resultType,
|
||||
eclResAddr,
|
||||
nativeTimeStepIndex );
|
||||
m_allanNNCGenerator->textureCoordinates( m_allanNNCTextureCoords.p(), mapper, resultType, eclResAddr, nativeTimeStepIndex );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -58,9 +58,7 @@ public:
|
||||
void applySingleColorEffect();
|
||||
void setOpacityLevel( float opacity ) { m_opacityLevel = opacity; }
|
||||
void updateCellResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors );
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors, RimCellEdgeColors* cellEdgeResultColors );
|
||||
|
||||
void appendNativeFaultFacesToModel( cvf::ModelBasicList* model );
|
||||
void appendOppositeFaultFacesToModel( cvf::ModelBasicList* model );
|
||||
|
@@ -82,8 +82,7 @@ void RivFishbonesSubsPartMgr::clearGeometryCache()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFishbonesSubsPartMgr::buildParts( const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
double characteristicCellSize )
|
||||
void RivFishbonesSubsPartMgr::buildParts( const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize )
|
||||
{
|
||||
RimWellPath* wellPath = nullptr;
|
||||
m_rimFishbonesSubs->firstAncestorOrThisOfTypeAsserted( wellPath );
|
||||
|
@@ -266,10 +266,7 @@ void RivGridPartMgr::updateCellResultColor( size_t timeStepIndex, RimEclipseCell
|
||||
}
|
||||
else
|
||||
{
|
||||
RivTextureCoordsCreator texturer( cellResultColors,
|
||||
timeStepIndex,
|
||||
m_grid->gridIndex(),
|
||||
m_surfaceGenerator.quadToCellFaceMapper() );
|
||||
RivTextureCoordsCreator texturer( cellResultColors, timeStepIndex, m_grid->gridIndex(), m_surfaceGenerator.quadToCellFaceMapper() );
|
||||
if ( !texturer.isValid() )
|
||||
{
|
||||
return;
|
||||
@@ -278,13 +275,10 @@ void RivGridPartMgr::updateCellResultColor( size_t timeStepIndex, RimEclipseCell
|
||||
if ( cellResultColors->isCompletionTypeSelected() )
|
||||
{
|
||||
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval =
|
||||
RivTextureCoordsCreator::createPipeInCellEvaluator( cellResultColors,
|
||||
timeStepIndex,
|
||||
m_grid->gridIndex() );
|
||||
RivTextureCoordsCreator::createPipeInCellEvaluator( cellResultColors, timeStepIndex, m_grid->gridIndex() );
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
|
||||
texturer.setResultToTextureMapper(
|
||||
new RivCompletionTypeResultToTextureMapper( mapper, pipeInCellEval.p() ) );
|
||||
texturer.setResultToTextureMapper( new RivCompletionTypeResultToTextureMapper( mapper, pipeInCellEval.p() ) );
|
||||
effectiveOpacityLevel = 0.5;
|
||||
}
|
||||
|
||||
@@ -318,17 +312,16 @@ void RivGridPartMgr::updateCellEdgeResultColor( size_t timeStepIn
|
||||
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>( m_surfaceFaces->drawable() );
|
||||
if ( dg )
|
||||
{
|
||||
cvf::ref<cvf::Effect> eff =
|
||||
RivScalarMapperUtils::createCellEdgeEffect( dg,
|
||||
m_surfaceGenerator.quadToCellFaceMapper(),
|
||||
m_grid->gridIndex(),
|
||||
timeStepIndex,
|
||||
cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
m_opacityLevel,
|
||||
m_defaultColor,
|
||||
caf::FC_NONE,
|
||||
cellResultColors->reservoirView()->isLightingDisabled() );
|
||||
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect( dg,
|
||||
m_surfaceGenerator.quadToCellFaceMapper(),
|
||||
m_grid->gridIndex(),
|
||||
timeStepIndex,
|
||||
cellResultColors,
|
||||
cellEdgeResultColors,
|
||||
m_opacityLevel,
|
||||
m_defaultColor,
|
||||
caf::FC_NONE,
|
||||
cellResultColors->reservoirView()->isLightingDisabled() );
|
||||
|
||||
m_surfaceFaces->setEffect( eff.p() );
|
||||
|
||||
|
@@ -65,9 +65,7 @@ public:
|
||||
void updateCellColor( cvf::Color4f color );
|
||||
void updateCellResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
|
||||
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors );
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors, RimCellEdgeColors* cellEdgeResultColors );
|
||||
|
||||
void appendPartsToModel( cvf::ModelBasicList* model );
|
||||
|
||||
|
@@ -115,8 +115,7 @@ void RivMeasurementPartMgr::clearGeometryCache()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivMeasurementPartMgr::buildPolyLineParts( const cvf::Camera* camera,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform )
|
||||
void RivMeasurementPartMgr::buildPolyLineParts( const cvf::Camera* camera, const caf::DisplayCoordTransform* displayCoordTransform )
|
||||
{
|
||||
auto pointsInDisplay = displayCoordTransform->transformToDisplayCoords( m_measurement->pointsInDomainCoords() );
|
||||
|
||||
@@ -147,8 +146,7 @@ void RivMeasurementPartMgr::buildPolyLineParts( const cvf::Camera*
|
||||
}
|
||||
|
||||
// Measurement points
|
||||
cvf::ref<cvf::DrawableGeo> polylinePointsGeo =
|
||||
RivPolylineGenerator::createPointsFromPolylineDrawable( pointsInDisplay );
|
||||
cvf::ref<cvf::DrawableGeo> polylinePointsGeo = RivPolylineGenerator::createPointsFromPolylineDrawable( pointsInDisplay );
|
||||
if ( polylinePointsGeo.notNull() )
|
||||
{
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
@@ -179,7 +177,7 @@ void RivMeasurementPartMgr::buildPolyLineParts( const cvf::Camera*
|
||||
if ( pointsInDisplay.size() > 1 )
|
||||
{
|
||||
bool negativeXDir = false;
|
||||
cvf::Vec3d lastV = pointsInDisplay[pointsInDisplay.size() - 1] - pointsInDisplay[pointsInDisplay.size() - 2];
|
||||
cvf::Vec3d lastV = pointsInDisplay[pointsInDisplay.size() - 1] - pointsInDisplay[pointsInDisplay.size() - 2];
|
||||
if ( lastV.x() < 0.0 )
|
||||
{
|
||||
negativeXDir = true;
|
||||
|
@@ -75,8 +75,7 @@ void RivNNCGeometryGenerator::computeArrays()
|
||||
std::vector<size_t> triangleToNNC;
|
||||
|
||||
const cvf::Vec3f offset( m_offset );
|
||||
long long numConnections =
|
||||
static_cast<long long>( m_nncIndexes.empty() ? m_nncData->allConnections().size() : m_nncIndexes.size() );
|
||||
long long numConnections = static_cast<long long>( m_nncIndexes.empty() ? m_nncData->allConnections().size() : m_nncIndexes.size() );
|
||||
|
||||
bool isVisibilityCalcActive = m_cellVisibility.notNull() && m_grid.notNull();
|
||||
std::vector<RigCell>* allCells = nullptr;
|
||||
@@ -163,8 +162,7 @@ void RivNNCGeometryGenerator::textureCoordinates( cvf::Vec2fArray*
|
||||
textureCoords->resize( numVertices );
|
||||
cvf::Vec2f* rawPtr = textureCoords->ptr();
|
||||
const std::vector<double>* nncResultVals = nullptr;
|
||||
if ( resultType == RiaDefines::ResultCatType::STATIC_NATIVE ||
|
||||
resultType == RiaDefines::ResultCatType::FORMATION_NAMES ||
|
||||
if ( resultType == RiaDefines::ResultCatType::STATIC_NATIVE || resultType == RiaDefines::ResultCatType::FORMATION_NAMES ||
|
||||
resultType == RiaDefines::ResultCatType::ALLAN_DIAGRAMS )
|
||||
{
|
||||
nncResultVals = m_nncData->staticConnectionScalarResult( resVarAddr );
|
||||
|
@@ -42,10 +42,7 @@ class RigEclipseResultAddress;
|
||||
class RivNNCGeometryGenerator : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RivNNCGeometryGenerator( bool includeAllan,
|
||||
RigNNCData* nncData,
|
||||
const cvf::Vec3d& offset,
|
||||
const std::vector<size_t>& nncIndexes );
|
||||
RivNNCGeometryGenerator( bool includeAllan, RigNNCData* nncData, const cvf::Vec3d& offset, const std::vector<size_t>& nncIndexes );
|
||||
|
||||
~RivNNCGeometryGenerator() override;
|
||||
|
||||
|
@@ -245,8 +245,8 @@ cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateLine( const cvf::Ve
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateExtrudedCylinder( double radius,
|
||||
size_t crossSectionNodeCount,
|
||||
cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateExtrudedCylinder( double radius,
|
||||
size_t crossSectionNodeCount,
|
||||
const cvf::Vec3dArray* cylinderCenterCoords )
|
||||
{
|
||||
CVF_ASSERT( cylinderCenterCoords != nullptr );
|
||||
@@ -372,19 +372,15 @@ cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateExtrudedCylinder( d
|
||||
}
|
||||
|
||||
// Last quad closing the cylinder
|
||||
quadVertexArray->add(
|
||||
crossSectionVertices[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + 0] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 1 ) * crossSectionNodeCount ) + 0] );
|
||||
quadVertexArray->add(
|
||||
crossSectionVertices[( ( segmentIdx + 1 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 1 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
|
||||
quadNormalArray->add(
|
||||
cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + 0] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + 0] );
|
||||
quadNormalArray->add(
|
||||
cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
}
|
||||
|
||||
CVF_ASSERT( vertexCount == quadVertexArray->size() );
|
||||
@@ -400,8 +396,8 @@ cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateExtrudedCylinder( d
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateVariableRadiusTube( size_t crossSectionNodeCount,
|
||||
const cvf::Vec3dArray* cylinderCenterCoords,
|
||||
cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateVariableRadiusTube( size_t crossSectionNodeCount,
|
||||
const cvf::Vec3dArray* cylinderCenterCoords,
|
||||
const std::vector<double>& radii )
|
||||
{
|
||||
CVF_ASSERT( cylinderCenterCoords != nullptr );
|
||||
@@ -468,12 +464,7 @@ cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateVariableRadiusTube(
|
||||
orient2 = ( nextDir ^ orient1 ).getNormalized();
|
||||
|
||||
std::vector<cvf::Vec3d> extrudedNodes;
|
||||
computeCircle( radii[nextCcIdx],
|
||||
crossSectionNodeCount,
|
||||
( *cylinderCenterCoords )[nextCcIdx],
|
||||
orient1,
|
||||
orient2,
|
||||
&extrudedNodes );
|
||||
computeCircle( radii[nextCcIdx], crossSectionNodeCount, ( *cylinderCenterCoords )[nextCcIdx], orient1, orient2, &extrudedNodes );
|
||||
|
||||
// Insert the next set of vertices and calculate normals for segment
|
||||
for ( size_t i = 0; i < extrudedNodes.size(); i++ )
|
||||
@@ -548,19 +539,15 @@ cvf::ref<cvf::DrawableGeo> RivPipeGeometryGenerator::generateVariableRadiusTube(
|
||||
}
|
||||
|
||||
// Last quad closing the cylinder
|
||||
quadVertexArray->add(
|
||||
crossSectionVertices[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + 0] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 1 ) * crossSectionNodeCount ) + 0] );
|
||||
quadVertexArray->add(
|
||||
crossSectionVertices[( ( segmentIdx + 1 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadVertexArray->add( crossSectionVertices[( ( segmentIdx + 1 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
|
||||
quadNormalArray->add(
|
||||
cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + 0] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + 0] );
|
||||
quadNormalArray->add(
|
||||
cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
quadNormalArray->add( cylinderSegmentNormals[( ( segmentIdx + 0 ) * crossSectionNodeCount ) + crossSectionNodeCount - 1] );
|
||||
}
|
||||
|
||||
CVF_ASSERT( vertexCount == quadVertexArray->size() );
|
||||
|
@@ -54,9 +54,7 @@ public:
|
||||
void pipeSurfaceTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<double>& segmentResults,
|
||||
const cvf::ScalarMapper* mapper ) const;
|
||||
void centerlineTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<double>& segmentResults,
|
||||
const cvf::ScalarMapper* mapper ) const;
|
||||
void centerlineTextureCoords( cvf::Vec2fArray* textureCoords, const std::vector<double>& segmentResults, const cvf::ScalarMapper* mapper ) const;
|
||||
|
||||
void setFirstVisibleSegmentIndex( size_t segmentIndex );
|
||||
size_t segmentIndexFromTriangleIndex( size_t triangleIndex ) const;
|
||||
@@ -85,9 +83,8 @@ private:
|
||||
std::vector<cvf::Vec3d>* nodes );
|
||||
|
||||
static cvf::ref<cvf::DrawableGeo> generateLine( const cvf::Vec3dArray* coords );
|
||||
static cvf::ref<cvf::DrawableGeo> generateExtrudedCylinder( double radius,
|
||||
size_t crossSectionNodeCount,
|
||||
const cvf::Vec3dArray* cylinderCenterCoords );
|
||||
static cvf::ref<cvf::DrawableGeo>
|
||||
generateExtrudedCylinder( double radius, size_t crossSectionNodeCount, const cvf::Vec3dArray* cylinderCenterCoords );
|
||||
static cvf::ref<cvf::DrawableGeo> generateVariableRadiusTube( size_t crossSectionNodeCount,
|
||||
const cvf::Vec3dArray* cylinderCenterCoords,
|
||||
const std::vector<double>& radii );
|
||||
|
@@ -25,8 +25,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivPolylineGenerator::createLineAlongPolylineDrawable( const std::vector<cvf::Vec3d>& polyLine, bool closeLine )
|
||||
cvf::ref<cvf::DrawableGeo> RivPolylineGenerator::createLineAlongPolylineDrawable( const std::vector<cvf::Vec3d>& polyLine, bool closeLine )
|
||||
{
|
||||
std::vector<std::vector<cvf::Vec3d>> polyLines;
|
||||
polyLines.push_back( polyLine );
|
||||
@@ -36,9 +35,8 @@ cvf::ref<cvf::DrawableGeo>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivPolylineGenerator::createLineAlongPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines,
|
||||
bool closeLine )
|
||||
cvf::ref<cvf::DrawableGeo> RivPolylineGenerator::createLineAlongPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines,
|
||||
bool closeLine )
|
||||
{
|
||||
std::vector<cvf::uint> lineIndices;
|
||||
std::vector<cvf::Vec3f> vertices;
|
||||
@@ -96,8 +94,7 @@ cvf::ref<cvf::DrawableGeo> RivPolylineGenerator::createPointsFromPolylineDrawabl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivPolylineGenerator::createPointsFromPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines )
|
||||
cvf::ref<cvf::DrawableGeo> RivPolylineGenerator::createPointsFromPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines )
|
||||
{
|
||||
std::vector<cvf::Vec3f> vertices;
|
||||
|
||||
|
@@ -34,12 +34,10 @@ class DrawableGeo;
|
||||
class RivPolylineGenerator : public cvf::Object
|
||||
{
|
||||
public:
|
||||
static cvf::ref<cvf::DrawableGeo> createLineAlongPolylineDrawable( const std::vector<cvf::Vec3d>& polyLine,
|
||||
bool closeLine = false );
|
||||
static cvf::ref<cvf::DrawableGeo>
|
||||
createLineAlongPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines, bool closeLine = false );
|
||||
static cvf::ref<cvf::DrawableGeo> createLineAlongPolylineDrawable( const std::vector<cvf::Vec3d>& polyLine, bool closeLine = false );
|
||||
static cvf::ref<cvf::DrawableGeo> createLineAlongPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines,
|
||||
bool closeLine = false );
|
||||
|
||||
static cvf::ref<cvf::DrawableGeo> createPointsFromPolylineDrawable( const std::vector<cvf::Vec3d>& polyLine );
|
||||
static cvf::ref<cvf::DrawableGeo>
|
||||
createPointsFromPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines );
|
||||
static cvf::ref<cvf::DrawableGeo> createPointsFromPolylineDrawable( const std::vector<std::vector<cvf::Vec3d>>& polyLines );
|
||||
};
|
||||
|
@@ -46,9 +46,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivPolylinePartMgr::RivPolylinePartMgr( Rim3dView* view,
|
||||
RimPolylinesDataInterface* polylineInterface,
|
||||
caf::PdmObject* collection )
|
||||
RivPolylinePartMgr::RivPolylinePartMgr( Rim3dView* view, RimPolylinesDataInterface* polylineInterface, caf::PdmObject* collection )
|
||||
: m_rimView( view )
|
||||
, m_polylineInterface( polylineInterface )
|
||||
, m_viewCollection( collection )
|
||||
@@ -65,8 +63,7 @@ RivPolylinePartMgr::~RivPolylinePartMgr()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivPolylinePartMgr::isPolylinesInBoundingBox( std::vector<std::vector<cvf::Vec3d>> polyline,
|
||||
const cvf::BoundingBox& boundingBox )
|
||||
bool RivPolylinePartMgr::isPolylinesInBoundingBox( std::vector<std::vector<cvf::Vec3d>> polyline, const cvf::BoundingBox& boundingBox )
|
||||
{
|
||||
auto effectiveBoundingBox = RiaBoundingBoxTools::inflate( boundingBox, 3 );
|
||||
for ( const auto& pts : polyline )
|
||||
@@ -82,8 +79,7 @@ bool RivPolylinePartMgr::isPolylinesInBoundingBox( std::vector<std::vector<cvf::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* displayXf,
|
||||
const cvf::BoundingBox& boundingBox )
|
||||
void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* displayXf, const cvf::BoundingBox& boundingBox )
|
||||
{
|
||||
auto polylineDef = m_polylineInterface->polyLinesData();
|
||||
if ( polylineDef.isNull() || polylineDef->polyLines().size() == 0 )
|
||||
|
@@ -59,9 +59,8 @@ private:
|
||||
void buildPolylineParts( const caf::DisplayCoordTransform* displayXf, const cvf::BoundingBox& boundingBox );
|
||||
|
||||
std::vector<std::vector<cvf::Vec3d>> getPolylinesPointsInDomain( bool snapToPlaneZ, double planeZ );
|
||||
std::vector<std::vector<cvf::Vec3d>>
|
||||
transformPolylinesPointsToDisplay( const std::vector<std::vector<cvf::Vec3d>>& pointsInDomain,
|
||||
const caf::DisplayCoordTransform* displayXf );
|
||||
std::vector<std::vector<cvf::Vec3d>> transformPolylinesPointsToDisplay( const std::vector<std::vector<cvf::Vec3d>>& pointsInDomain,
|
||||
const caf::DisplayCoordTransform* displayXf );
|
||||
|
||||
bool collectionVisible();
|
||||
|
||||
|
@@ -43,8 +43,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivReachCircleAnnotationPartMgr::RivReachCircleAnnotationPartMgr( Rim3dView* view,
|
||||
RimReachCircleAnnotationInView* annotationInView )
|
||||
RivReachCircleAnnotationPartMgr::RivReachCircleAnnotationPartMgr( Rim3dView* view, RimReachCircleAnnotationInView* annotationInView )
|
||||
: m_rimView( view )
|
||||
, m_rimAnnotationInView( annotationInView )
|
||||
{
|
||||
@@ -75,9 +74,8 @@ void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransfo
|
||||
auto* collection = annotationCollection();
|
||||
if ( collection )
|
||||
{
|
||||
std::vector<Vec3d> pointsInDomain =
|
||||
computeCirclePointsInDomain( collection->snapAnnotations(), collection->annotationPlaneZ() );
|
||||
std::vector<cvf::Vec3d> points = displayXf->transformToDisplayCoords( pointsInDomain );
|
||||
std::vector<Vec3d> pointsInDomain = computeCirclePointsInDomain( collection->snapAnnotations(), collection->annotationPlaneZ() );
|
||||
std::vector<cvf::Vec3d> points = displayXf->transformToDisplayCoords( pointsInDomain );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( points );
|
||||
|
||||
@@ -99,16 +97,16 @@ void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransfo
|
||||
|
||||
// Center point part
|
||||
{
|
||||
auto centerPos = displayXf->transformToDisplayCoord( rimAnnotation->centerPoint() );
|
||||
double symbolSize = 20;
|
||||
double xMin = centerPos.x() - symbolSize / 2.0;
|
||||
double xMax = xMin + symbolSize;
|
||||
double yMin = centerPos.y() - symbolSize / 2.0;
|
||||
double yMax = yMin + symbolSize;
|
||||
double z = centerPos.z();
|
||||
std::vector<Vec3d> line1 = { { xMin, yMin, z }, { xMax, yMax, z } };
|
||||
std::vector<Vec3d> line2 = { { xMax, yMin, z }, { xMin, yMax, z } };
|
||||
std::vector<std::vector<Vec3d>> symbol = { line1, line2 };
|
||||
auto centerPos = displayXf->transformToDisplayCoord( rimAnnotation->centerPoint() );
|
||||
double symbolSize = 20;
|
||||
double xMin = centerPos.x() - symbolSize / 2.0;
|
||||
double xMax = xMin + symbolSize;
|
||||
double yMin = centerPos.y() - symbolSize / 2.0;
|
||||
double yMax = yMin + symbolSize;
|
||||
double z = centerPos.z();
|
||||
std::vector<Vec3d> line1 = { { xMin, yMin, z }, { xMax, yMax, z } };
|
||||
std::vector<Vec3d> line2 = { { xMax, yMin, z }, { xMin, yMax, z } };
|
||||
std::vector<std::vector<Vec3d>> symbol = { line1, line2 };
|
||||
cvf::ref<cvf::DrawableGeo> drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( symbol );
|
||||
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
|
@@ -140,8 +140,8 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
|
||||
rivFaultPart->appendOppositeFaultFacesToModel( &parts );
|
||||
}
|
||||
|
||||
if ( faultCollection->showFaultFaces() || faultCollection->showOppositeFaultFaces() ||
|
||||
faultCollection->showNNCs() || forceDisplayOfFault )
|
||||
if ( faultCollection->showFaultFaces() || faultCollection->showOppositeFaultFaces() || faultCollection->showNNCs() ||
|
||||
forceDisplayOfFault )
|
||||
{
|
||||
rivFaultPart->appendMeshLinePartsToModel( &parts );
|
||||
}
|
||||
|
@@ -55,9 +55,7 @@ public:
|
||||
void setOpacityLevel( float opacity );
|
||||
void applySingleColorEffect();
|
||||
void updateColors( size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors );
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors, RimCellEdgeColors* cellEdgeResultColors );
|
||||
|
||||
void appendPartsToModel( cvf::ModelBasicList* model );
|
||||
|
||||
|
@@ -33,9 +33,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirPartMgr::clearAndSetReservoir( RivCellSetEnum cellSetType,
|
||||
RimEclipseCase* eclipseCase,
|
||||
RimEclipseView* reservoirView )
|
||||
void RivReservoirPartMgr::clearAndSetReservoir( RivCellSetEnum cellSetType, RimEclipseCase* eclipseCase, RimEclipseView* reservoirView )
|
||||
{
|
||||
m_allGrids.clear();
|
||||
|
||||
|
@@ -62,18 +62,14 @@ public:
|
||||
|
||||
void updateCellColor( cvf::Color4f color );
|
||||
void updateCellResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors );
|
||||
void updateCellEdgeResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors, RimCellEdgeColors* cellEdgeResultColors );
|
||||
|
||||
void appendGridPartsToModel( cvf::ModelBasicList* model, const std::vector<size_t>& gridIdxes );
|
||||
void appendGridPartsToModel( cvf::ModelBasicList* model );
|
||||
|
||||
// Faults
|
||||
void updateFaultColors( size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
|
||||
void updateFaultCellEdgeResultColor( size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors );
|
||||
void updateFaultCellEdgeResultColor( size_t timeStepIndex, RimEclipseCellColors* cellResultColors, RimCellEdgeColors* cellEdgeResultColors );
|
||||
void appendFaultPartsToModel( cvf::ModelBasicList* model );
|
||||
void appendFaultLabelPartsToModel( cvf::ModelBasicList* model );
|
||||
|
||||
|
@@ -107,12 +107,8 @@ void RivReservoirSimWellsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelB
|
||||
|
||||
for ( size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++wIdx )
|
||||
{
|
||||
m_wellPipesPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model,
|
||||
frameIndex,
|
||||
m_reservoirView->displayCoordTransform().p() );
|
||||
m_wellHeadPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model,
|
||||
frameIndex,
|
||||
m_reservoirView->displayCoordTransform().p() );
|
||||
m_wellPipesPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model, frameIndex, m_reservoirView->displayCoordTransform().p() );
|
||||
m_wellHeadPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model, frameIndex, m_reservoirView->displayCoordTransform().p() );
|
||||
}
|
||||
|
||||
// Well disks
|
||||
@@ -129,9 +125,7 @@ void RivReservoirSimWellsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelB
|
||||
|
||||
for ( size_t wIdx = 0; wIdx != m_wellDiskPartMgrs.size(); ++wIdx )
|
||||
{
|
||||
m_wellDiskPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model,
|
||||
frameIndex,
|
||||
m_reservoirView->displayCoordTransform().p() );
|
||||
m_wellDiskPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model, frameIndex, m_reservoirView->displayCoordTransform().p() );
|
||||
}
|
||||
|
||||
// Well spheres
|
||||
|
@@ -248,16 +248,14 @@ void RivReservoirViewPartMgr::ensureDynamicGeometryPartsCreated( RivCellSetEnum
|
||||
{
|
||||
if ( geometryType == PROPERTY_FILTERED )
|
||||
{
|
||||
if ( frameIndex >= m_propFilteredGeometryFramesNeedsRegen.size() ||
|
||||
m_propFilteredGeometryFramesNeedsRegen[frameIndex] )
|
||||
if ( frameIndex >= m_propFilteredGeometryFramesNeedsRegen.size() || m_propFilteredGeometryFramesNeedsRegen[frameIndex] )
|
||||
{
|
||||
createPropertyFilteredNoneWellCellGeometry( frameIndex );
|
||||
}
|
||||
}
|
||||
else if ( geometryType == PROPERTY_FILTERED_WELL_CELLS )
|
||||
{
|
||||
if ( frameIndex >= m_propFilteredWellGeometryFramesNeedsRegen.size() ||
|
||||
m_propFilteredWellGeometryFramesNeedsRegen[frameIndex] )
|
||||
if ( frameIndex >= m_propFilteredWellGeometryFramesNeedsRegen.size() || m_propFilteredWellGeometryFramesNeedsRegen[frameIndex] )
|
||||
{
|
||||
createPropertyFilteredWellGeometry( frameIndex );
|
||||
}
|
||||
@@ -291,10 +289,7 @@ void RivReservoirViewPartMgr::createGeometry( RivCellSetEnum geometryType )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirViewPartMgr::computeVisibility( cvf::UByteArray* cellVisibility,
|
||||
RivCellSetEnum geometryType,
|
||||
RigGridBase* grid,
|
||||
size_t gridIdx )
|
||||
void RivReservoirViewPartMgr::computeVisibility( cvf::UByteArray* cellVisibility, RivCellSetEnum geometryType, RigGridBase* grid, size_t gridIdx )
|
||||
{
|
||||
RigEclipseCaseData* eclipseCase = m_reservoirView->eclipseCase()->eclipseCaseData();
|
||||
auto activeCellInfo = m_reservoirView->currentActiveCellInfo();
|
||||
@@ -305,13 +300,7 @@ void RivReservoirViewPartMgr::computeVisibility( cvf::UByteArray* cellVisibility
|
||||
computeOverriddenCellVisibility( cellVisibility, grid );
|
||||
break;
|
||||
case ACTIVE:
|
||||
computeNativeVisibility( cellVisibility,
|
||||
grid,
|
||||
activeCellInfo,
|
||||
eclipseCase->wellCellsInGrid( gridIdx ),
|
||||
false,
|
||||
false,
|
||||
true );
|
||||
computeNativeVisibility( cellVisibility, grid, activeCellInfo, eclipseCase->wellCellsInGrid( gridIdx ), false, false, true );
|
||||
break;
|
||||
case ALL_WELL_CELLS:
|
||||
copyByteArray( cellVisibility, eclipseCase->wellCellsInGrid( gridIdx ) );
|
||||
@@ -363,11 +352,7 @@ void RivReservoirViewPartMgr::computeVisibility( cvf::UByteArray* cellVisibility
|
||||
ensureStaticGeometryPartsCreated( ACTIVE );
|
||||
|
||||
nativeVisibility = m_geometries[ACTIVE].cellVisibility( gridIdx );
|
||||
computeFilterVisibility( geometryType,
|
||||
cellVisibility,
|
||||
grid,
|
||||
nativeVisibility.p(),
|
||||
m_reservoirView->cellFilterCollection() );
|
||||
computeFilterVisibility( geometryType, cellVisibility, grid, nativeVisibility.p(), m_reservoirView->cellFilterCollection() );
|
||||
}
|
||||
break;
|
||||
case RANGE_FILTERED_INACTIVE:
|
||||
@@ -376,11 +361,7 @@ void RivReservoirViewPartMgr::computeVisibility( cvf::UByteArray* cellVisibility
|
||||
ensureStaticGeometryPartsCreated( INACTIVE );
|
||||
|
||||
nativeVisibility = m_geometries[INACTIVE].cellVisibility( gridIdx );
|
||||
computeFilterVisibility( geometryType,
|
||||
cellVisibility,
|
||||
grid,
|
||||
nativeVisibility.p(),
|
||||
m_reservoirView->cellFilterCollection() );
|
||||
computeFilterVisibility( geometryType, cellVisibility, grid, nativeVisibility.p(), m_reservoirView->cellFilterCollection() );
|
||||
}
|
||||
break;
|
||||
case RANGE_FILTERED_WELL_CELLS:
|
||||
@@ -389,11 +370,7 @@ void RivReservoirViewPartMgr::computeVisibility( cvf::UByteArray* cellVisibility
|
||||
ensureStaticGeometryPartsCreated( ALL_WELL_CELLS );
|
||||
|
||||
nativeVisibility = m_geometries[ALL_WELL_CELLS].cellVisibility( gridIdx );
|
||||
computeFilterVisibility( geometryType,
|
||||
cellVisibility,
|
||||
grid,
|
||||
nativeVisibility.p(),
|
||||
m_reservoirView->cellFilterCollection() );
|
||||
computeFilterVisibility( geometryType, cellVisibility, grid, nativeVisibility.p(), m_reservoirView->cellFilterCollection() );
|
||||
}
|
||||
break;
|
||||
case VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER:
|
||||
@@ -455,12 +432,9 @@ void RivReservoirViewPartMgr::createPropertyFilteredNoneWellCellGeometry( size_t
|
||||
m_propFilteredGeometryFramesNeedsRegen.resize( frameIndex + 1, true );
|
||||
}
|
||||
|
||||
if ( m_propFilteredGeometryFrames[frameIndex].isNull() )
|
||||
m_propFilteredGeometryFrames[frameIndex] = new RivReservoirPartMgr;
|
||||
if ( m_propFilteredGeometryFrames[frameIndex].isNull() ) m_propFilteredGeometryFrames[frameIndex] = new RivReservoirPartMgr;
|
||||
|
||||
m_propFilteredGeometryFrames[frameIndex]->clearAndSetReservoir( PROPERTY_FILTERED,
|
||||
m_reservoirView->eclipseCase(),
|
||||
m_reservoirView );
|
||||
m_propFilteredGeometryFrames[frameIndex]->clearAndSetReservoir( PROPERTY_FILTERED, m_reservoirView->eclipseCase(), m_reservoirView );
|
||||
m_propFilteredGeometryFrames[frameIndex]->setTransform( m_scaleTransform.p() );
|
||||
|
||||
std::vector<RigGridBase*> grids;
|
||||
@@ -538,8 +512,7 @@ void RivReservoirViewPartMgr::createPropertyFilteredWellGeometry( size_t frameIn
|
||||
m_propFilteredWellGeometryFramesNeedsRegen.resize( frameIndex + 1, true );
|
||||
}
|
||||
|
||||
if ( m_propFilteredWellGeometryFrames[frameIndex].isNull() )
|
||||
m_propFilteredWellGeometryFrames[frameIndex] = new RivReservoirPartMgr;
|
||||
if ( m_propFilteredWellGeometryFrames[frameIndex].isNull() ) m_propFilteredWellGeometryFrames[frameIndex] = new RivReservoirPartMgr;
|
||||
|
||||
m_propFilteredWellGeometryFrames[frameIndex]->clearAndSetReservoir( PROPERTY_FILTERED_WELL_CELLS,
|
||||
m_reservoirView->eclipseCase(),
|
||||
@@ -671,8 +644,7 @@ void RivReservoirViewPartMgr::computeOverriddenCellVisibility( cvf::UByteArray*
|
||||
cvf::ref<cvf::UByteArray> totCellVisibility = masterView->currentTotalCellVisibility();
|
||||
#else
|
||||
// Could get something more like
|
||||
std::vector<std::vector<cvf::UByteArray*>> gridsWithCellSetVisibility =
|
||||
masterView->getAllGridsCurrentCellSetsCellVisibility();
|
||||
std::vector<std::vector<cvf::UByteArray*>> gridsWithCellSetVisibility = masterView->getAllGridsCurrentCellSetsCellVisibility();
|
||||
#endif
|
||||
|
||||
CVF_ASSERT( cellVisibility != nullptr );
|
||||
@@ -706,8 +678,7 @@ void RivReservoirViewPartMgr::computeOverriddenCellVisibility( cvf::UByteArray*
|
||||
int cellSetCount = gridsWithCellSetVisibility[masterCaseCells.gridIndex[mcIdx]].size();
|
||||
for ( int csIdx = 0; csIdx < cellSetCount; ++csIdx )
|
||||
{
|
||||
( *cellVisibility )[lcIdx] |=
|
||||
gridsWithCellSetVisibility[masterCaseCells.gridIndex[mcIdx]][masterCaseCells.cellIndex[mcIdx]];
|
||||
( *cellVisibility )[lcIdx] |= gridsWithCellSetVisibility[masterCaseCells.gridIndex[mcIdx]][masterCaseCells.cellIndex[mcIdx]];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -781,8 +752,7 @@ void RivReservoirViewPartMgr::computeFilterVisibility( RivCellSetEnum
|
||||
parentGridVisibilities = reservoirGridPartMgr->cellVisibility( parentGridIndex );
|
||||
}
|
||||
|
||||
bool hasAdditiveFilters = cellFilterColl->hasActiveIncludeFilters() ||
|
||||
m_reservoirView->wellCollection()->hasVisibleWellCells();
|
||||
bool hasAdditiveFilters = cellFilterColl->hasActiveIncludeFilters() || m_reservoirView->wellCollection()->hasVisibleWellCells();
|
||||
|
||||
#pragma omp parallel for
|
||||
for ( int cellIndex = 0; cellIndex < static_cast<int>( grid->cellCount() ); cellIndex++ )
|
||||
@@ -809,8 +779,7 @@ void RivReservoirViewPartMgr::computeFilterVisibility( RivCellSetEnum
|
||||
|
||||
if ( hasAdditiveFilters )
|
||||
{
|
||||
nativeRangeVisibility =
|
||||
gridCellRangeFilter.isCellVisible( mainGridI, mainGridJ, mainGridK, isInSubGridArea );
|
||||
nativeRangeVisibility = gridCellRangeFilter.isCellVisible( mainGridI, mainGridJ, mainGridK, isInSubGridArea );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -818,9 +787,8 @@ void RivReservoirViewPartMgr::computeFilterVisibility( RivCellSetEnum
|
||||
nativeRangeVisibility = ( *nativeVisibility )[cellIndex];
|
||||
}
|
||||
|
||||
( *cellVisibility )[cellIndex] =
|
||||
( visibleDueToParentGrid || nativeRangeVisibility ) &&
|
||||
!gridCellRangeFilter.isCellExcluded( mainGridI, mainGridJ, mainGridK, isInSubGridArea );
|
||||
( *cellVisibility )[cellIndex] = ( visibleDueToParentGrid || nativeRangeVisibility ) &&
|
||||
!gridCellRangeFilter.isCellExcluded( mainGridI, mainGridJ, mainGridK, isInSubGridArea );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -947,9 +915,7 @@ void RivReservoirViewPartMgr::updateCellColor( RivCellSetEnum geometryType, size
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirViewPartMgr::updateCellResultColor( RivCellSetEnum geometryType,
|
||||
size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors )
|
||||
void RivReservoirViewPartMgr::updateCellResultColor( RivCellSetEnum geometryType, size_t timeStepIndex, RimEclipseCellColors* cellResultColors )
|
||||
{
|
||||
RivReservoirPartMgr* pmgr = reservoirPartManager( geometryType, timeStepIndex );
|
||||
pmgr->updateCellResultColor( timeStepIndex, cellResultColors );
|
||||
@@ -982,14 +948,12 @@ void RivReservoirViewPartMgr::updateFaultCellEdgeResultColor( RivCellSetEnum
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const cvf::UByteArray*
|
||||
RivReservoirViewPartMgr::cellVisibility( RivCellSetEnum geometryType, size_t gridIndex, size_t timeStepIndex )
|
||||
const cvf::UByteArray* RivReservoirViewPartMgr::cellVisibility( RivCellSetEnum geometryType, size_t gridIndex, size_t timeStepIndex )
|
||||
{
|
||||
ensureDynamicGeometryPartsCreated( geometryType, timeStepIndex );
|
||||
ensureStaticGeometryPartsCreated( geometryType );
|
||||
|
||||
RivReservoirPartMgr* pmgr =
|
||||
( const_cast<RivReservoirViewPartMgr*>( this ) )->reservoirPartManager( geometryType, timeStepIndex );
|
||||
RivReservoirPartMgr* pmgr = ( const_cast<RivReservoirViewPartMgr*>( this ) )->reservoirPartManager( geometryType, timeStepIndex );
|
||||
|
||||
return pmgr->cellVisibility( gridIndex ).p();
|
||||
}
|
||||
@@ -1016,9 +980,7 @@ RivReservoirPartMgr* RivReservoirViewPartMgr::reservoirPartManager( RivCellSetEn
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirViewPartMgr::updateFaultColors( RivCellSetEnum geometryType,
|
||||
size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors )
|
||||
void RivReservoirViewPartMgr::updateFaultColors( RivCellSetEnum geometryType, size_t timeStepIndex, RimEclipseCellColors* cellResultColors )
|
||||
{
|
||||
if ( geometryType == PROPERTY_FILTERED && timeStepIndex >= m_propFilteredGeometryFrames.size() )
|
||||
{
|
||||
@@ -1037,8 +999,7 @@ void RivReservoirViewPartMgr::updateFaultColors( RivCellSetEnum geometryT
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirViewPartMgr::appendFaultsStaticGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
RivCellSetEnum geometryType )
|
||||
void RivReservoirViewPartMgr::appendFaultsStaticGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType )
|
||||
{
|
||||
if ( geometryType >= PROPERTY_FILTERED ) return;
|
||||
|
||||
@@ -1103,9 +1064,7 @@ void RivReservoirViewPartMgr::appendFaultsStaticGeometryPartsToModel( cvf::Model
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirViewPartMgr::appendFaultsDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
RivCellSetEnum geometryType,
|
||||
size_t frameIndex )
|
||||
void RivReservoirViewPartMgr::appendFaultsDynamicGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex )
|
||||
{
|
||||
if ( geometryType == PROPERTY_FILTERED )
|
||||
{
|
||||
@@ -1125,7 +1084,7 @@ void RivReservoirViewPartMgr::appendFaultsDynamicGeometryPartsToModel( cvf::Mode
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivCellSetEnum RivReservoirViewPartMgr::geometryTypeForFaultLabels( const std::set<RivCellSetEnum>& geometryTypes,
|
||||
bool showFaultsOutsideFilters ) const
|
||||
bool showFaultsOutsideFilters ) const
|
||||
{
|
||||
for ( RivCellSetEnum cellSetType : geometryTypes )
|
||||
{
|
||||
@@ -1149,8 +1108,7 @@ RivCellSetEnum RivReservoirViewPartMgr::geometryTypeForFaultLabels( const std::s
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirViewPartMgr::appendFaultLabelsStaticGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
RivCellSetEnum geometryType )
|
||||
void RivReservoirViewPartMgr::appendFaultLabelsStaticGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType )
|
||||
{
|
||||
ensureStaticGeometryPartsCreated( geometryType );
|
||||
m_geometries[geometryType].appendFaultLabelPartsToModel( model );
|
||||
@@ -1200,8 +1158,7 @@ void RivReservoirViewPartMgr::forceWatertightGeometryOnForType( RivCellSetEnum g
|
||||
{
|
||||
for ( size_t i = 0; i < m_propFilteredWellGeometryFrames.size(); ++i )
|
||||
{
|
||||
if ( m_propFilteredWellGeometryFrames[i].p() )
|
||||
m_propFilteredWellGeometryFrames[i]->forceWatertightGeometryOn();
|
||||
if ( m_propFilteredWellGeometryFrames[i].p() ) m_propFilteredWellGeometryFrames[i]->forceWatertightGeometryOn();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1223,8 +1180,7 @@ void RivReservoirViewPartMgr::clearWatertightGeometryFlags()
|
||||
|
||||
for ( size_t i = 0; i < m_propFilteredWellGeometryFrames.size(); ++i )
|
||||
{
|
||||
if ( m_propFilteredWellGeometryFrames[i].p() )
|
||||
m_propFilteredWellGeometryFrames[i]->clearWatertightGeometryFlag();
|
||||
if ( m_propFilteredWellGeometryFrames[i].p() ) m_propFilteredWellGeometryFrames[i]->clearWatertightGeometryFlag();
|
||||
}
|
||||
|
||||
for ( int i = 0; i < PROPERTY_FILTERED; i++ )
|
||||
|
@@ -55,9 +55,7 @@ public:
|
||||
void scheduleGeometryRegen( RivCellSetEnum geometryType );
|
||||
const cvf::UByteArray* cellVisibility( RivCellSetEnum geometryType, size_t gridIndex, size_t frameIndex );
|
||||
|
||||
void appendStaticGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
RivCellSetEnum geometryType,
|
||||
const std::vector<size_t>& gridIndices );
|
||||
void appendStaticGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType, const std::vector<size_t>& gridIndices );
|
||||
void ensureStaticGeometryPartsCreated( RivCellSetEnum geometryType );
|
||||
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
@@ -83,17 +81,12 @@ public:
|
||||
RimCellEdgeColors* cellEdgeResultColors );
|
||||
|
||||
// Fault labels
|
||||
RivCellSetEnum geometryTypeForFaultLabels( const std::set<RivCellSetEnum>& geometryTypes,
|
||||
bool showFaultsOutsideFilters ) const;
|
||||
void appendFaultLabelsStaticGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType );
|
||||
void appendFaultLabelsDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
RivCellSetEnum geometryType,
|
||||
size_t frameIndex );
|
||||
RivCellSetEnum geometryTypeForFaultLabels( const std::set<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters ) const;
|
||||
void appendFaultLabelsStaticGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType );
|
||||
void appendFaultLabelsDynamicGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex );
|
||||
|
||||
// Element Vector Result
|
||||
void appendElementVectorResultDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
RivCellSetEnum geometryType,
|
||||
size_t frameIndex );
|
||||
void appendElementVectorResultDynamicGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex );
|
||||
|
||||
void forceWatertightGeometryOnForType( RivCellSetEnum geometryType );
|
||||
void clearWatertightGeometryFlags();
|
||||
|
@@ -32,8 +32,7 @@
|
||||
class RivResultToTextureMapper : public cvf::Object
|
||||
{
|
||||
public:
|
||||
explicit RivResultToTextureMapper( const cvf::ScalarMapper* scalarMapper,
|
||||
const RigPipeInCellEvaluator* pipeInCellEvaluator )
|
||||
explicit RivResultToTextureMapper( const cvf::ScalarMapper* scalarMapper, const RigPipeInCellEvaluator* pipeInCellEvaluator )
|
||||
: m_scalarMapper( scalarMapper )
|
||||
, m_pipeInCellEvaluator( pipeInCellEvaluator )
|
||||
{
|
||||
|
@@ -79,17 +79,16 @@ void RivScalarMapperUtils::applyTernaryTextureResultsToPart( cvf::Part*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Effect>
|
||||
RivScalarMapperUtils::createCellEdgeEffect( cvf::DrawableGeo* dg,
|
||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||
size_t gridIndex,
|
||||
size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
float opacityLevel,
|
||||
cvf::Color3f defaultColor,
|
||||
caf::FaceCulling faceCulling,
|
||||
bool disableLighting )
|
||||
cvf::ref<cvf::Effect> RivScalarMapperUtils::createCellEdgeEffect( cvf::DrawableGeo* dg,
|
||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||
size_t gridIndex,
|
||||
size_t timeStepIndex,
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
RimCellEdgeColors* cellEdgeResultColors,
|
||||
float opacityLevel,
|
||||
cvf::Color3f defaultColor,
|
||||
caf::FaceCulling faceCulling,
|
||||
bool disableLighting )
|
||||
{
|
||||
CellEdgeEffectGenerator cellFaceEffectGen( cellEdgeResultColors->legendConfig()->scalarMapper() );
|
||||
|
||||
@@ -170,7 +169,7 @@ cvf::ref<cvf::Effect> RivScalarMapperUtils::createScalarMapperEffect( const cvf:
|
||||
cvf::ref<cvf::Effect> RivScalarMapperUtils::createTernaryScalarMapperEffect( const RivTernaryScalarMapper* mapper,
|
||||
float opacityLevel,
|
||||
caf::FaceCulling faceCulling,
|
||||
bool disableLighting )
|
||||
bool disableLighting )
|
||||
{
|
||||
CVF_ASSERT( mapper );
|
||||
|
||||
|
@@ -44,14 +44,13 @@ class RimCellEdgeColors;
|
||||
class RivScalarMapperUtils
|
||||
{
|
||||
public:
|
||||
static void
|
||||
applyTextureResultsToPart( cvf::Part* part,
|
||||
static void applyTextureResultsToPart( cvf::Part* part,
|
||||
cvf::Vec2fArray* textureCoords,
|
||||
const cvf::ScalarMapper* mapper,
|
||||
float opacityLevel,
|
||||
caf::FaceCulling faceCulling,
|
||||
bool disableLighting,
|
||||
const cvf::Color3f& undefColor = cvf::Color3f( RiaColorTables::undefinedCellColor() ) );
|
||||
const cvf::Color3f& undefColor = cvf::Color3f( RiaColorTables::undefinedCellColor() ) );
|
||||
static void applyTernaryTextureResultsToPart( cvf::Part* part,
|
||||
cvf::Vec2fArray* textureCoords,
|
||||
const RivTernaryScalarMapper* mapper,
|
||||
@@ -76,7 +75,7 @@ private:
|
||||
float opacityLevel,
|
||||
caf::FaceCulling faceCulling,
|
||||
bool disableLighting,
|
||||
const cvf::Color3f& undefColor = cvf::Color3f( RiaColorTables::undefinedCellColor() ) );
|
||||
const cvf::Color3f& undefColor = cvf::Color3f( RiaColorTables::undefinedCellColor() ) );
|
||||
static cvf::ref<cvf::Effect> createTernaryScalarMapperEffect( const RivTernaryScalarMapper* mapper,
|
||||
float opacityLevel,
|
||||
caf::FaceCulling faceCulling,
|
||||
|
@@ -33,8 +33,7 @@ class RivWellConnectionFactorGeometryGenerator;
|
||||
class RivSimWellConnectionSourceInfo : public cvf::Object
|
||||
{
|
||||
public:
|
||||
explicit RivSimWellConnectionSourceInfo( RimSimWellInView* simWellInView,
|
||||
RivWellConnectionFactorGeometryGenerator* geometryGenerator );
|
||||
explicit RivSimWellConnectionSourceInfo( RimSimWellInView* simWellInView, RivWellConnectionFactorGeometryGenerator* geometryGenerator );
|
||||
|
||||
RimSimWellInView* simWellInView() const;
|
||||
|
||||
|
@@ -202,11 +202,10 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
|
||||
|
||||
if ( doFlatten )
|
||||
{
|
||||
std::vector<cvf::Mat4d> flatningCSs =
|
||||
RivSectionFlattener::calculateFlatteningCSsForPolyline( m_pipeBranchesCLCoords[brIdx],
|
||||
cvf::Vec3d::Z_AXIS,
|
||||
flattenedStartOffset,
|
||||
&flattenedStartOffset );
|
||||
std::vector<cvf::Mat4d> flatningCSs = RivSectionFlattener::calculateFlatteningCSsForPolyline( m_pipeBranchesCLCoords[brIdx],
|
||||
cvf::Vec3d::Z_AXIS,
|
||||
flattenedStartOffset,
|
||||
&flattenedStartOffset );
|
||||
for ( size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx )
|
||||
{
|
||||
( *cvfCoords )[cIdx] = ( ( *cvfCoords )[cIdx] ).getTransformedPoint( flatningCSs[cIdx] );
|
||||
@@ -280,18 +279,15 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
|
||||
|
||||
const RigWellPath* wellPath = wellPaths[brIdx];
|
||||
|
||||
RigEclipseWellLogExtractor* extractor =
|
||||
RiaExtractionTools::findOrCreateSimWellExtractor( m_simWellInView, wellPath );
|
||||
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::findOrCreateSimWellExtractor( m_simWellInView, wellPath );
|
||||
if ( extractor )
|
||||
{
|
||||
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections =
|
||||
extractor->cellIntersectionInfosAlongWellPath();
|
||||
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath();
|
||||
|
||||
for ( const auto& intersectionInfo : wellPathCellIntersections )
|
||||
{
|
||||
size_t globalCellIndex = intersectionInfo.globCellIndex;
|
||||
const RigWellResultPoint* wResCell =
|
||||
wResFrame->findResultCellWellHeadIncluded( 0, globalCellIndex );
|
||||
const RigWellResultPoint* wResCell = wResFrame->findResultCellWellHeadIncluded( 0, globalCellIndex );
|
||||
|
||||
if ( !wResCell || !wResCell->isValid() )
|
||||
{
|
||||
@@ -332,18 +328,15 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
|
||||
radius *= 2.0; // Enlarge the radius slightly to make the connection factor visible if geometry
|
||||
// scale factor is set to 1.0
|
||||
|
||||
pbd.m_connectionFactorGeometryGenerator =
|
||||
new RivWellConnectionFactorGeometryGenerator( completionVizDataItems, radius );
|
||||
pbd.m_connectionFactorGeometryGenerator = new RivWellConnectionFactorGeometryGenerator( completionVizDataItems, radius );
|
||||
|
||||
cvf::ScalarMapper* scalarMapper = virtualPerforationResult->legendConfig()->scalarMapper();
|
||||
cvf::ref<cvf::Part> part =
|
||||
pbd.m_connectionFactorGeometryGenerator->createSurfacePart( scalarMapper,
|
||||
eclipseView->isLightingDisabled() );
|
||||
pbd.m_connectionFactorGeometryGenerator->createSurfacePart( scalarMapper, eclipseView->isLightingDisabled() );
|
||||
if ( part.notNull() )
|
||||
{
|
||||
cvf::ref<RivSimWellConnectionSourceInfo> simWellSourceInfo =
|
||||
new RivSimWellConnectionSourceInfo( m_simWellInView,
|
||||
pbd.m_connectionFactorGeometryGenerator.p() );
|
||||
new RivSimWellConnectionSourceInfo( m_simWellInView, pbd.m_connectionFactorGeometryGenerator.p() );
|
||||
part->setSourceInfo( simWellSourceInfo.p() );
|
||||
}
|
||||
|
||||
@@ -424,8 +417,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
|
||||
|
||||
if ( cellIds[wcIdx].isCell() )
|
||||
{
|
||||
wResCell = wResFrame->findResultCellWellHeadExcluded( cellIds[wcIdx].m_gridIndex,
|
||||
cellIds[wcIdx].m_gridCellIndex );
|
||||
wResCell = wResFrame->findResultCellWellHeadExcluded( cellIds[wcIdx].m_gridIndex, cellIds[wcIdx].m_gridCellIndex );
|
||||
}
|
||||
|
||||
if ( wResCell )
|
||||
@@ -467,8 +459,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
|
||||
|
||||
if ( wellBranch.m_surfaceDrawable.notNull() )
|
||||
{
|
||||
cvf::ref<cvf::Vec2fArray> surfTexCoords =
|
||||
const_cast<cvf::Vec2fArray*>( wellBranch.m_surfaceDrawable->textureCoordArray() );
|
||||
cvf::ref<cvf::Vec2fArray> surfTexCoords = const_cast<cvf::Vec2fArray*>( wellBranch.m_surfaceDrawable->textureCoordArray() );
|
||||
if ( surfTexCoords.isNull() )
|
||||
{
|
||||
surfTexCoords = new cvf::Vec2fArray;
|
||||
@@ -497,8 +488,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
|
||||
// Find or create texture coords array for pipe center line
|
||||
if ( wellBranch.m_centerLineDrawable.notNull() )
|
||||
{
|
||||
cvf::ref<cvf::Vec2fArray> lineTexCoords =
|
||||
const_cast<cvf::Vec2fArray*>( wellBranch.m_centerLineDrawable->textureCoordArray() );
|
||||
cvf::ref<cvf::Vec2fArray> lineTexCoords = const_cast<cvf::Vec2fArray*>( wellBranch.m_centerLineDrawable->textureCoordArray() );
|
||||
|
||||
if ( lineTexCoords.isNull() )
|
||||
{
|
||||
|
@@ -52,15 +52,13 @@ public:
|
||||
|
||||
~RivSimWellPipesPartMgr() override;
|
||||
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
size_t frameIndex,
|
||||
const caf::DisplayCoordTransform* displayXf );
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex, const caf::DisplayCoordTransform* displayXf );
|
||||
|
||||
void appendFlattenedDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
size_t frameIndex,
|
||||
const caf::DisplayCoordTransform* displayXf,
|
||||
double flattenedIntersectionExtentLength,
|
||||
int branchIndex );
|
||||
double flattenedIntersectionExtentLength,
|
||||
int branchIndex );
|
||||
|
||||
void updatePipeResultColor( size_t frameIndex );
|
||||
|
||||
|
@@ -36,14 +36,8 @@ class RimGeoMechCase;
|
||||
class RivSingleCellPartGenerator
|
||||
{
|
||||
public:
|
||||
RivSingleCellPartGenerator( RigEclipseCaseData* rigCaseData,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
const cvf::Vec3d& displayModelOffset );
|
||||
RivSingleCellPartGenerator( RimGeoMechCase* rimGeoMechCase,
|
||||
size_t gridIndex,
|
||||
size_t cellIndex,
|
||||
const cvf::Vec3d& displayModelOffset );
|
||||
RivSingleCellPartGenerator( RigEclipseCaseData* rigCaseData, size_t gridIndex, size_t cellIndex, const cvf::Vec3d& displayModelOffset );
|
||||
RivSingleCellPartGenerator( RimGeoMechCase* rimGeoMechCase, size_t gridIndex, size_t cellIndex, const cvf::Vec3d& displayModelOffset );
|
||||
|
||||
cvf::ref<cvf::Part> createPart( const cvf::Color3f color );
|
||||
|
||||
|
@@ -96,8 +96,7 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicL
|
||||
|
||||
for ( int partIdx = 0; partIdx < femParts->partCount(); partIdx++ )
|
||||
{
|
||||
std::vector<caf::Ten3f> vertexTensors =
|
||||
resultCollection->tensors( address, partIdx, localTimeStepIndex, frameIndex );
|
||||
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors( address, partIdx, localTimeStepIndex, frameIndex );
|
||||
if ( vertexTensors.empty() ) continue;
|
||||
|
||||
const RigFemPart* part = femParts->part( partIdx );
|
||||
@@ -111,13 +110,11 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicL
|
||||
|
||||
calculatePrincipalsAndDirections( elmTensors, &elmPrincipals, &elmPrincipalDirections );
|
||||
|
||||
std::vector<RivGeoMechPartMgrCache::Key> partKeys =
|
||||
m_rimReservoirView->vizLogic()->keysToVisiblePartMgrs( viewerStepIndex );
|
||||
std::vector<RivGeoMechPartMgrCache::Key> partKeys = m_rimReservoirView->vizLogic()->keysToVisiblePartMgrs( viewerStepIndex );
|
||||
|
||||
RigFemPartNodes nodes = part->nodes();
|
||||
|
||||
float arrowConstantScaling =
|
||||
0.5 * m_rimReservoirView->tensorResults()->sizeScale() * part->characteristicElementSize();
|
||||
float arrowConstantScaling = 0.5 * m_rimReservoirView->tensorResults()->sizeScale() * part->characteristicElementSize();
|
||||
|
||||
double min, max;
|
||||
m_rimReservoirView->tensorResults()->mappingRange( &min, &max );
|
||||
@@ -138,18 +135,16 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicL
|
||||
|
||||
auto mgr = partMgr->femPartMgrs()[partIdx];
|
||||
{
|
||||
const RivFemPartGeometryGenerator* surfaceGenerator = mgr->surfaceGenerator();
|
||||
const std::vector<size_t>& quadVerticesToNodeIdxMapping = surfaceGenerator->quadVerticesToNodeIdxMapping();
|
||||
const std::vector<size_t>& quadVerticesToElmIdx = surfaceGenerator->quadVerticesToGlobalElmIdx();
|
||||
const RivFemPartGeometryGenerator* surfaceGenerator = mgr->surfaceGenerator();
|
||||
const std::vector<size_t>& quadVerticesToNodeIdxMapping = surfaceGenerator->quadVerticesToNodeIdxMapping();
|
||||
const std::vector<size_t>& quadVerticesToElmIdx = surfaceGenerator->quadVerticesToGlobalElmIdx();
|
||||
|
||||
for ( int quadVertex = 0; quadVertex < static_cast<int>( quadVerticesToNodeIdxMapping.size() );
|
||||
quadVertex += 4 )
|
||||
for ( int quadVertex = 0; quadVertex < static_cast<int>( quadVerticesToNodeIdxMapping.size() ); quadVertex += 4 )
|
||||
{
|
||||
cvf::Vec3f center = nodes.coordinates.at( quadVerticesToNodeIdxMapping[quadVertex] ) +
|
||||
nodes.coordinates.at( quadVerticesToNodeIdxMapping[quadVertex + 2] );
|
||||
|
||||
cvf::Vec3d displayCoord =
|
||||
m_rimReservoirView->displayCoordTransform()->transformToDisplayCoord( cvf::Vec3d( center / 2 ) );
|
||||
cvf::Vec3d displayCoord = m_rimReservoirView->displayCoordTransform()->transformToDisplayCoord( cvf::Vec3d( center / 2 ) );
|
||||
|
||||
cvf::Vec3f faceNormal = calculateFaceNormal( nodes, quadVerticesToNodeIdxMapping, quadVertex );
|
||||
|
||||
@@ -332,7 +327,7 @@ cvf::ref<cvf::Part> RivTensorResultPartMgr::createPart( const std::vector<Tensor
|
||||
}
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( indices );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> drawable = new cvf::DrawableGeo();
|
||||
|
||||
@@ -352,7 +347,7 @@ cvf::ref<cvf::Part> RivTensorResultPartMgr::createPart( const std::vector<Tensor
|
||||
cvf::ScalarMapper* activeScalerMapper = nullptr;
|
||||
|
||||
cvf::ref<cvf::ScalarMapperDiscreteLinear> discreteScalarMapper = new cvf::ScalarMapperDiscreteLinear;
|
||||
auto vectorColors = m_rimReservoirView->tensorResults()->vectorColors();
|
||||
auto vectorColors = m_rimReservoirView->tensorResults()->vectorColors();
|
||||
if ( vectorColors == RimTensorResults::RESULT_COLORS )
|
||||
{
|
||||
activeScalerMapper = m_rimReservoirView->tensorResults()->arrowColorLegendConfig()->scalarMapper();
|
||||
@@ -391,7 +386,7 @@ cvf::ref<cvf::Part> RivTensorResultPartMgr::createPart( const std::vector<Tensor
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTensorResultPartMgr::createOneColorPerPrincipalScalarMapper( const RimTensorResults::TensorColors& colorSet,
|
||||
cvf::ScalarMapperDiscreteLinear* scalarMapper )
|
||||
cvf::ScalarMapperDiscreteLinear* scalarMapper )
|
||||
{
|
||||
CVF_ASSERT( scalarMapper );
|
||||
|
||||
@@ -422,7 +417,7 @@ void RivTensorResultPartMgr::createOneColorPerPrincipalScalarMapper( const RimTe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTensorResultPartMgr::createOneColorPerPrincipalTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
void RivTensorResultPartMgr::createOneColorPerPrincipalTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<TensorVisualization>& tensorVisualizations,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
@@ -488,15 +483,14 @@ bool RivTensorResultPartMgr::isTensorAddress( RigFemResultAddress address )
|
||||
bool RivTensorResultPartMgr::isValid( cvf::Vec3f resultVector )
|
||||
{
|
||||
// nan
|
||||
if ( resultVector.x() != resultVector.x() || resultVector.y() != resultVector.y() ||
|
||||
resultVector.z() != resultVector.z() )
|
||||
if ( resultVector.x() != resultVector.x() || resultVector.y() != resultVector.y() || resultVector.z() != resultVector.z() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// inf
|
||||
if ( resultVector.x() == HUGE_VAL || resultVector.y() == HUGE_VAL || resultVector.z() == HUGE_VAL ||
|
||||
resultVector.x() == -HUGE_VAL || resultVector.y() == -HUGE_VAL || resultVector.z() == -HUGE_VAL )
|
||||
if ( resultVector.x() == HUGE_VAL || resultVector.y() == HUGE_VAL || resultVector.z() == HUGE_VAL || resultVector.x() == -HUGE_VAL ||
|
||||
resultVector.y() == -HUGE_VAL || resultVector.z() == -HUGE_VAL )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -50,20 +50,12 @@ public:
|
||||
RivTensorResultPartMgr( RimGeoMechView* reservoirView );
|
||||
~RivTensorResultPartMgr() override;
|
||||
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
int viewerStepIndex,
|
||||
int localTimeStepIndex,
|
||||
int frameIndex ) const;
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, int viewerStepIndex, int localTimeStepIndex, int frameIndex ) const;
|
||||
|
||||
private:
|
||||
struct TensorVisualization
|
||||
{
|
||||
TensorVisualization( cvf::Vec3f vertex,
|
||||
cvf::Vec3f result,
|
||||
cvf::Vec3f faceNormal,
|
||||
bool isPressure,
|
||||
int princial,
|
||||
float principalValue )
|
||||
TensorVisualization( cvf::Vec3f vertex, cvf::Vec3f result, cvf::Vec3f faceNormal, bool isPressure, int princial, float principalValue )
|
||||
: vertex( vertex )
|
||||
, result( result )
|
||||
, faceNormal( faceNormal )
|
||||
@@ -80,17 +72,15 @@ private:
|
||||
};
|
||||
|
||||
private:
|
||||
static void calculateElementTensors( const RigFemPart& part,
|
||||
const std::vector<caf::Ten3f>& vertexTensors,
|
||||
std::vector<caf::Ten3f>* elmTensors );
|
||||
static void
|
||||
calculateElementTensors( const RigFemPart& part, const std::vector<caf::Ten3f>& vertexTensors, std::vector<caf::Ten3f>* elmTensors );
|
||||
|
||||
static void calculatePrincipalsAndDirections( const std::vector<caf::Ten3f>& tensors,
|
||||
std::array<std::vector<float>, 3>* principals,
|
||||
std::vector<std::array<cvf::Vec3f, 3>>* principalDirections );
|
||||
|
||||
static cvf::Vec3f calculateFaceNormal( const RigFemPartNodes& nodes,
|
||||
const std::vector<size_t>& quadVerticesToNodeIdxMapping,
|
||||
int quadVertex );
|
||||
static cvf::Vec3f
|
||||
calculateFaceNormal( const RigFemPartNodes& nodes, const std::vector<size_t>& quadVerticesToNodeIdxMapping, int quadVertex );
|
||||
|
||||
cvf::ref<cvf::Part> createPart( const std::vector<TensorVisualization>& tensorVisualizations ) const;
|
||||
|
||||
|
@@ -32,8 +32,7 @@
|
||||
class RivTernaryResultToTextureMapper : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RivTernaryResultToTextureMapper( const RivTernaryScalarMapper* scalarMapper,
|
||||
const RigPipeInCellEvaluator* pipeInCellEvaluator )
|
||||
RivTernaryResultToTextureMapper( const RivTernaryScalarMapper* scalarMapper, const RigPipeInCellEvaluator* pipeInCellEvaluator )
|
||||
: m_scalarMapper( scalarMapper )
|
||||
, m_pipeInCellEvaluator( pipeInCellEvaluator )
|
||||
{
|
||||
|
@@ -58,9 +58,7 @@ void RivTernarySaturationOverlayItem::setAxisLabelsColor( const cvf::Color3f& co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTernarySaturationOverlayItem::render( cvf::OpenGLContext* oglContext,
|
||||
const cvf::Vec2i& position,
|
||||
const cvf::Vec2ui& size )
|
||||
void RivTernarySaturationOverlayItem::render( cvf::OpenGLContext* oglContext, const cvf::Vec2i& position, const cvf::Vec2ui& size )
|
||||
{
|
||||
renderGeneric( oglContext, position, size, false );
|
||||
}
|
||||
@@ -68,9 +66,7 @@ void RivTernarySaturationOverlayItem::render( cvf::OpenGLContext* oglContext,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTernarySaturationOverlayItem::renderSoftware( cvf::OpenGLContext* oglContext,
|
||||
const cvf::Vec2i& position,
|
||||
const cvf::Vec2ui& size )
|
||||
void RivTernarySaturationOverlayItem::renderSoftware( cvf::OpenGLContext* oglContext, const cvf::Vec2i& position, const cvf::Vec2ui& size )
|
||||
{
|
||||
renderGeneric( oglContext, position, size, true );
|
||||
}
|
||||
@@ -78,10 +74,7 @@ void RivTernarySaturationOverlayItem::renderSoftware( cvf::OpenGLContext* oglCon
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Set up camera/viewport and render
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTernarySaturationOverlayItem::renderGeneric( cvf::OpenGLContext* oglContext,
|
||||
const cvf::Vec2i& position,
|
||||
const cvf::Vec2ui& size,
|
||||
bool software )
|
||||
void RivTernarySaturationOverlayItem::renderGeneric( cvf::OpenGLContext* oglContext, const cvf::Vec2i& position, const cvf::Vec2ui& size, bool software )
|
||||
{
|
||||
if ( size.x() <= 0 || size.y() <= 0 )
|
||||
{
|
||||
@@ -146,8 +139,7 @@ void RivTernarySaturationOverlayItem::renderGeneric( cvf::OpenGLContext* oglCont
|
||||
|
||||
cvf::uint sgasRangeTextWidth = this->font()->textExtent( m_sgasRange ).x();
|
||||
textPosY -= lineHeightInPixels;
|
||||
textDrawer.addText( m_sgasRange,
|
||||
cvf::Vec2f( static_cast<float>( ( size.x() / 2 ) - sgasRangeTextWidth / 2 ), textPosY ) );
|
||||
textDrawer.addText( m_sgasRange, cvf::Vec2f( static_cast<float>( ( size.x() / 2 ) - sgasRangeTextWidth / 2 ), textPosY ) );
|
||||
}
|
||||
|
||||
textDrawer.addText( "SWAT", cvf::Vec2f( (float)border, (float)( lineHeightInPixels + border ) ) );
|
||||
@@ -155,9 +147,7 @@ void RivTernarySaturationOverlayItem::renderGeneric( cvf::OpenGLContext* oglCont
|
||||
|
||||
{
|
||||
cvf::uint soilTextWidth = this->font()->textExtent( "SOIL" ).x();
|
||||
textDrawer.addText( "SOIL",
|
||||
cvf::Vec2f( static_cast<float>( size.x() - soilTextWidth - border ),
|
||||
lineHeightInPixels + border ) );
|
||||
textDrawer.addText( "SOIL", cvf::Vec2f( static_cast<float>( size.x() - soilTextWidth - border ), lineHeightInPixels + border ) );
|
||||
|
||||
cvf::uint soilRangeTextWidth = this->font()->textExtent( m_soilRange ).x();
|
||||
float soilRangePos = static_cast<float>( size.x() ) - soilRangeTextWidth - border;
|
||||
@@ -240,9 +230,7 @@ void RivTernarySaturationOverlayItem::renderAxisImmediateMode( float
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTernarySaturationOverlayItem::setRangeText( const cvf::String& soilRange,
|
||||
const cvf::String& sgasRange,
|
||||
const cvf::String& swatRange )
|
||||
void RivTernarySaturationOverlayItem::setRangeText( const cvf::String& soilRange, const cvf::String& sgasRange, const cvf::String& swatRange )
|
||||
{
|
||||
m_soilRange = soilRange;
|
||||
m_sgasRange = sgasRange;
|
||||
|
@@ -51,11 +51,7 @@ private:
|
||||
void renderSoftware( cvf::OpenGLContext* oglContext, const cvf::Vec2i& position, const cvf::Vec2ui& size ) override;
|
||||
|
||||
void renderGeneric( cvf::OpenGLContext* oglContext, const cvf::Vec2i& position, const cvf::Vec2ui& size, bool software );
|
||||
void renderAxisImmediateMode( float upperY,
|
||||
float lowerBoundY,
|
||||
float border,
|
||||
unsigned int totalWidth,
|
||||
cvf::OpenGLContext* oglContext );
|
||||
void renderAxisImmediateMode( float upperY, float lowerBoundY, float border, unsigned int totalWidth, cvf::OpenGLContext* oglContext );
|
||||
|
||||
private:
|
||||
cvf::String m_soilRange;
|
||||
|
@@ -48,7 +48,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivTernaryScalarMapperEffectGenerator::RivTernaryScalarMapperEffectGenerator( const RivTernaryScalarMapper* scalarMapper,
|
||||
caf::PolygonOffset polygonOffset )
|
||||
caf::PolygonOffset polygonOffset )
|
||||
: m_undefinedColor( RiaColorTables::undefinedCellColor() )
|
||||
{
|
||||
m_scalarMapper = scalarMapper;
|
||||
@@ -123,8 +123,7 @@ void RivTernaryScalarMapperEffectGenerator::updateForShaderBasedRendering( cvf::
|
||||
cvf::ref<cvf::ShaderProgram> prog = gen.generate();
|
||||
eff->setShaderProgram( prog.p() );
|
||||
|
||||
if ( !m_disableLighting )
|
||||
prog->setDefaultUniform( new cvf::UniformFloat( "u_ecLightPosition", cvf::Vec3f( 0.5, 5.0, 7.0 ) ) );
|
||||
if ( !m_disableLighting ) prog->setDefaultUniform( new cvf::UniformFloat( "u_ecLightPosition", cvf::Vec3f( 0.5, 5.0, 7.0 ) ) );
|
||||
|
||||
// Result mapping texture
|
||||
|
||||
@@ -188,8 +187,7 @@ void RivTernaryScalarMapperEffectGenerator::updateCommonEffect( cvf::Effect* eff
|
||||
|
||||
if ( m_polygonOffset != caf::PO_NONE )
|
||||
{
|
||||
cvf::ref<cvf::RenderStatePolygonOffset> polyOffset =
|
||||
EffectGenerator::createAndConfigurePolygonOffsetRenderState( m_polygonOffset );
|
||||
cvf::ref<cvf::RenderStatePolygonOffset> polyOffset = EffectGenerator::createAndConfigurePolygonOffsetRenderState( m_polygonOffset );
|
||||
effect->setRenderState( polyOffset.p() );
|
||||
}
|
||||
|
||||
@@ -234,17 +232,13 @@ void RivTernaryScalarMapperEffectGenerator::updateCommonEffect( cvf::Effect* eff
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivTernaryScalarMapperEffectGenerator::isEqual( const EffectGenerator* other ) const
|
||||
{
|
||||
const RivTernaryScalarMapperEffectGenerator* otherTextureResultEffect =
|
||||
dynamic_cast<const RivTernaryScalarMapperEffectGenerator*>( other );
|
||||
const RivTernaryScalarMapperEffectGenerator* otherTextureResultEffect = dynamic_cast<const RivTernaryScalarMapperEffectGenerator*>( other );
|
||||
|
||||
if ( otherTextureResultEffect )
|
||||
{
|
||||
if ( m_scalarMapper.p() == otherTextureResultEffect->m_scalarMapper &&
|
||||
m_polygonOffset == otherTextureResultEffect->m_polygonOffset &&
|
||||
m_opacityLevel == otherTextureResultEffect->m_opacityLevel &&
|
||||
m_undefinedColor == otherTextureResultEffect->m_undefinedColor &&
|
||||
m_faceCulling == otherTextureResultEffect->m_faceCulling &&
|
||||
m_enableDepthWrite == otherTextureResultEffect->m_enableDepthWrite &&
|
||||
if ( m_scalarMapper.p() == otherTextureResultEffect->m_scalarMapper && m_polygonOffset == otherTextureResultEffect->m_polygonOffset &&
|
||||
m_opacityLevel == otherTextureResultEffect->m_opacityLevel && m_undefinedColor == otherTextureResultEffect->m_undefinedColor &&
|
||||
m_faceCulling == otherTextureResultEffect->m_faceCulling && m_enableDepthWrite == otherTextureResultEffect->m_enableDepthWrite &&
|
||||
m_disableLighting == otherTextureResultEffect->m_disableLighting )
|
||||
{
|
||||
cvf::ref<cvf::TextureImage> texImg2 = new cvf::TextureImage;
|
||||
@@ -262,14 +256,13 @@ bool RivTernaryScalarMapperEffectGenerator::isEqual( const EffectGenerator* othe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::EffectGenerator* RivTernaryScalarMapperEffectGenerator::copy() const
|
||||
{
|
||||
RivTernaryScalarMapperEffectGenerator* scEffGen =
|
||||
new RivTernaryScalarMapperEffectGenerator( m_scalarMapper.p(), m_polygonOffset );
|
||||
scEffGen->m_textureImage = m_textureImage;
|
||||
scEffGen->m_opacityLevel = m_opacityLevel;
|
||||
scEffGen->m_undefinedColor = m_undefinedColor;
|
||||
scEffGen->m_faceCulling = m_faceCulling;
|
||||
scEffGen->m_enableDepthWrite = m_enableDepthWrite;
|
||||
scEffGen->m_disableLighting = m_disableLighting;
|
||||
RivTernaryScalarMapperEffectGenerator* scEffGen = new RivTernaryScalarMapperEffectGenerator( m_scalarMapper.p(), m_polygonOffset );
|
||||
scEffGen->m_textureImage = m_textureImage;
|
||||
scEffGen->m_opacityLevel = m_opacityLevel;
|
||||
scEffGen->m_undefinedColor = m_undefinedColor;
|
||||
scEffGen->m_faceCulling = m_faceCulling;
|
||||
scEffGen->m_enableDepthWrite = m_enableDepthWrite;
|
||||
scEffGen->m_disableLighting = m_disableLighting;
|
||||
|
||||
return scEffGen;
|
||||
}
|
||||
@@ -279,20 +272,15 @@ caf::EffectGenerator* RivTernaryScalarMapperEffectGenerator::copy() const
|
||||
/// but to make the comparison fast only some sampling points are used. If both pointers are nullptr,
|
||||
/// they are considered equal.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivTernaryScalarMapperEffectGenerator::isImagesEqual( const cvf::TextureImage* texImg1,
|
||||
const cvf::TextureImage* texImg2 )
|
||||
bool RivTernaryScalarMapperEffectGenerator::isImagesEqual( const cvf::TextureImage* texImg1, const cvf::TextureImage* texImg2 )
|
||||
{
|
||||
if ( texImg1 == nullptr && texImg2 == nullptr ) return true;
|
||||
|
||||
if ( texImg1 != nullptr && texImg2 != nullptr && texImg1->height() == texImg2->height() &&
|
||||
texImg1->width() == texImg2->width() && texImg1->width() > 0 && texImg1->height() > 0 &&
|
||||
texImg1->pixel( 0, 0 ) == texImg2->pixel( 0, 0 ) &&
|
||||
texImg1->pixel( texImg1->width() - 1, texImg1->height() - 1 ) ==
|
||||
texImg2->pixel( texImg1->width() - 1, texImg1->height() - 1 ) &&
|
||||
texImg1->pixel( texImg1->width() / 2, texImg1->height() / 2 ) ==
|
||||
texImg2->pixel( texImg1->width() / 2, texImg1->height() / 2 ) &&
|
||||
texImg1->pixel( texImg1->width() / 4, texImg1->height() / 4 ) ==
|
||||
texImg2->pixel( texImg1->width() / 4, texImg1->height() / 4 ) &&
|
||||
if ( texImg1 != nullptr && texImg2 != nullptr && texImg1->height() == texImg2->height() && texImg1->width() == texImg2->width() &&
|
||||
texImg1->width() > 0 && texImg1->height() > 0 && texImg1->pixel( 0, 0 ) == texImg2->pixel( 0, 0 ) &&
|
||||
texImg1->pixel( texImg1->width() - 1, texImg1->height() - 1 ) == texImg2->pixel( texImg1->width() - 1, texImg1->height() - 1 ) &&
|
||||
texImg1->pixel( texImg1->width() / 2, texImg1->height() / 2 ) == texImg2->pixel( texImg1->width() / 2, texImg1->height() / 2 ) &&
|
||||
texImg1->pixel( texImg1->width() / 4, texImg1->height() / 4 ) == texImg2->pixel( texImg1->width() / 4, texImg1->height() / 4 ) &&
|
||||
texImg1->pixel( texImg1->width() / 2 + texImg1->width() / 4, texImg1->height() / 2 + texImg1->height() / 4 ) ==
|
||||
texImg2->pixel( texImg1->width() / 2 + texImg1->width() / 4, texImg1->height() / 2 + texImg1->height() / 4 ) )
|
||||
{
|
||||
|
@@ -39,11 +39,11 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipseResultDefinition* cellResultColors,
|
||||
RimTernaryLegendConfig* ternaryLegendConfig,
|
||||
RimSimWellInViewCollection* simWellInViewCollection,
|
||||
size_t timeStepIndex,
|
||||
size_t gridIndex,
|
||||
RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipseResultDefinition* cellResultColors,
|
||||
RimTernaryLegendConfig* ternaryLegendConfig,
|
||||
RimSimWellInViewCollection* simWellInViewCollection,
|
||||
size_t timeStepIndex,
|
||||
size_t gridIndex,
|
||||
const cvf::StructGridQuadToCellFaceMapper* quadMapper )
|
||||
{
|
||||
CVF_ASSERT( quadMapper );
|
||||
@@ -57,24 +57,21 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipse
|
||||
|
||||
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
|
||||
|
||||
cvf::ref<RigResultAccessor> soil =
|
||||
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::soil() ) );
|
||||
cvf::ref<RigResultAccessor> sgas =
|
||||
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::sgas() ) );
|
||||
cvf::ref<RigResultAccessor> swat =
|
||||
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::swat() ) );
|
||||
cvf::ref<RigResultAccessor> soil = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::soil() ) );
|
||||
cvf::ref<RigResultAccessor> sgas = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::sgas() ) );
|
||||
cvf::ref<RigResultAccessor> swat = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::swat() ) );
|
||||
|
||||
m_resultAccessor = new RigTernaryResultAccessor();
|
||||
m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() );
|
||||
@@ -106,24 +103,21 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipse
|
||||
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
|
||||
|
||||
size_t gridIndex = 0;
|
||||
cvf::ref<RigResultAccessor> soil =
|
||||
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::soil() ) );
|
||||
cvf::ref<RigResultAccessor> sgas =
|
||||
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::sgas() ) );
|
||||
cvf::ref<RigResultAccessor> swat =
|
||||
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::swat() ) );
|
||||
cvf::ref<RigResultAccessor> soil = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::soil() ) );
|
||||
cvf::ref<RigResultAccessor> sgas = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::sgas() ) );
|
||||
cvf::ref<RigResultAccessor> swat = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resTimeStepIdx,
|
||||
RigEclipseResultAddress( RiaResultNames::swat() ) );
|
||||
|
||||
m_resultAccessor = new RigTernaryResultAccessor();
|
||||
m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() );
|
||||
@@ -145,8 +139,7 @@ void RivTernaryTextureCoordsCreator::createTextureCoords( cvf::Vec2fArray* quadT
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivTernaryTextureCoordsCreator::createTextureCoords( cvf::Vec2fArray* triTextureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdx )
|
||||
void RivTernaryTextureCoordsCreator::createTextureCoords( cvf::Vec2fArray* triTextureCoords, const std::vector<size_t>& triangleToCellIdx )
|
||||
{
|
||||
CVF_ASSERT( m_quadMapper.isNull() );
|
||||
|
||||
|
@@ -82,10 +82,8 @@ void RivTextAnnotationPartMgr::buildParts( const caf::DisplayCoordTransform* dis
|
||||
auto collection = annotationCollection();
|
||||
if ( !collection ) return;
|
||||
|
||||
cvf::Vec3d anchorPositionInDomain =
|
||||
getAnchorPointInDomain( collection->snapAnnotations(), collection->annotationPlaneZ() );
|
||||
cvf::Vec3d labelPositionInDomain =
|
||||
getLabelPointInDomain( collection->snapAnnotations(), collection->annotationPlaneZ() );
|
||||
cvf::Vec3d anchorPositionInDomain = getAnchorPointInDomain( collection->snapAnnotations(), collection->annotationPlaneZ() );
|
||||
cvf::Vec3d labelPositionInDomain = getLabelPointInDomain( collection->snapAnnotations(), collection->annotationPlaneZ() );
|
||||
|
||||
cvf::Vec3d anchorPosition = displayXf->transformToDisplayCoord( anchorPositionInDomain );
|
||||
cvf::Vec3d labelPosition = displayXf->transformToDisplayCoord( labelPositionInDomain );
|
||||
|
@@ -32,9 +32,7 @@
|
||||
class RivTextLabelSourceInfo : public RivObjectSourceInfo
|
||||
{
|
||||
public:
|
||||
explicit RivTextLabelSourceInfo( caf::PdmObject* pdmObject,
|
||||
const cvf::String& text,
|
||||
const cvf::Vec3f& positionDisplayCoord );
|
||||
explicit RivTextLabelSourceInfo( caf::PdmObject* pdmObject, const cvf::String& text, const cvf::Vec3f& positionDisplayCoord );
|
||||
|
||||
cvf::String text() const;
|
||||
cvf::Vec3f textPositionDisplayCoord() const;
|
||||
|
@@ -48,11 +48,9 @@ RivTextureCoordsCreator::RivTextureCoordsCreator( RimEclipseCellColors*
|
||||
m_quadMapper = quadMapper;
|
||||
CVF_ASSERT( quadMapper && eclipseCase );
|
||||
|
||||
m_resultAccessor =
|
||||
RigResultAccessorFactory::createFromResultDefinition( eclipseCase, gridIndex, timeStepIndex, cellResultColors );
|
||||
m_resultAccessor = RigResultAccessorFactory::createFromResultDefinition( eclipseCase, gridIndex, timeStepIndex, cellResultColors );
|
||||
|
||||
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval =
|
||||
createPipeInCellEvaluator( cellResultColors, timeStepIndex, gridIndex );
|
||||
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval = createPipeInCellEvaluator( cellResultColors, timeStepIndex, gridIndex );
|
||||
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
|
||||
@@ -92,14 +90,10 @@ void RivTextureCoordsCreator::setResultToTextureMapper( RivResultToTextureMapper
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigPipeInCellEvaluator* RivTextureCoordsCreator::createPipeInCellEvaluator( RimEclipseCellColors* cellColors,
|
||||
size_t timeStep,
|
||||
size_t gridIndex )
|
||||
RigPipeInCellEvaluator* RivTextureCoordsCreator::createPipeInCellEvaluator( RimEclipseCellColors* cellColors, size_t timeStep, size_t gridIndex )
|
||||
{
|
||||
return new RigPipeInCellEvaluator( cellColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities(
|
||||
timeStep ),
|
||||
cellColors->reservoirView()->eclipseCase()->eclipseCaseData()->gridCellToResultWellIndex(
|
||||
gridIndex ) );
|
||||
return new RigPipeInCellEvaluator( cellColors->reservoirView()->wellCollection()->resultWellGeometryVisibilities( timeStep ),
|
||||
cellColors->reservoirView()->eclipseCase()->eclipseCaseData()->gridCellToResultWellIndex( gridIndex ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -45,8 +45,7 @@ public:
|
||||
void createTextureCoords( cvf::Vec2fArray* quadTextureCoords );
|
||||
void setResultToTextureMapper( RivResultToTextureMapper* textureMapper );
|
||||
|
||||
static RigPipeInCellEvaluator*
|
||||
createPipeInCellEvaluator( RimEclipseCellColors* cellColors, size_t timeStep, size_t gridIndex );
|
||||
static RigPipeInCellEvaluator* createPipeInCellEvaluator( RimEclipseCellColors* cellColors, size_t timeStep, size_t gridIndex );
|
||||
|
||||
private:
|
||||
static void createTextureCoords( cvf::Vec2fArray* quadTextureCoords,
|
||||
|
@@ -32,7 +32,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivWellConnectionFactorGeometryGenerator::RivWellConnectionFactorGeometryGenerator( std::vector<CompletionVizData>& completionVizData,
|
||||
float radius )
|
||||
float radius )
|
||||
: m_completionVizData( completionVizData )
|
||||
, m_radius( radius )
|
||||
, m_trianglesPerConnection( 0 )
|
||||
@@ -49,8 +49,7 @@ RivWellConnectionFactorGeometryGenerator::~RivWellConnectionFactorGeometryGenera
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part> RivWellConnectionFactorGeometryGenerator::createSurfacePart( const cvf::ScalarMapper* scalarMapper,
|
||||
bool disableLighting )
|
||||
cvf::ref<cvf::Part> RivWellConnectionFactorGeometryGenerator::createSurfacePart( const cvf::ScalarMapper* scalarMapper, bool disableLighting )
|
||||
{
|
||||
if ( !scalarMapper ) return nullptr;
|
||||
|
||||
@@ -106,10 +105,7 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createSurfa
|
||||
std::vector<cvf::Vec3f> verticesForOneObject;
|
||||
std::vector<cvf::uint> indicesForOneObject;
|
||||
|
||||
RivWellConnectionFactorGeometryGenerator::createSimplifiedStarGeometry( &verticesForOneObject,
|
||||
&indicesForOneObject,
|
||||
m_radius,
|
||||
m_radius * 0.3f );
|
||||
RivWellConnectionFactorGeometryGenerator::createSimplifiedStarGeometry( &verticesForOneObject, &indicesForOneObject, m_radius, m_radius * 0.3f );
|
||||
|
||||
m_trianglesPerConnection = indicesForOneObject.size() / 3;
|
||||
|
||||
@@ -123,8 +119,7 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createSurfa
|
||||
|
||||
for ( const auto& item : m_completionVizData )
|
||||
{
|
||||
auto rotMatrix =
|
||||
cvf::Mat4f( cvf::GeometryTools::rotationMatrixBetweenVectors( cvf::Vec3d::Y_AXIS, item.m_direction ) );
|
||||
auto rotMatrix = cvf::Mat4f( cvf::GeometryTools::rotationMatrixBetweenVectors( cvf::Vec3d::Y_AXIS, item.m_direction ) );
|
||||
|
||||
cvf::uint indexOffset = static_cast<cvf::uint>( vertices->size() );
|
||||
|
||||
|
@@ -68,15 +68,10 @@ private:
|
||||
size_t mapFromTriangleToConnectionIndex( cvf::uint triangleIndex ) const;
|
||||
cvf::ref<cvf::DrawableGeo> createSurfaceGeometry();
|
||||
|
||||
static void createStarGeometry( std::vector<cvf::Vec3f>* vertices,
|
||||
std::vector<cvf::uint>* indices,
|
||||
float radius,
|
||||
float thickness );
|
||||
static void createStarGeometry( std::vector<cvf::Vec3f>* vertices, std::vector<cvf::uint>* indices, float radius, float thickness );
|
||||
|
||||
static void createSimplifiedStarGeometry( std::vector<cvf::Vec3f>* vertices,
|
||||
std::vector<cvf::uint>* indices,
|
||||
float radius,
|
||||
float thickness );
|
||||
static void
|
||||
createSimplifiedStarGeometry( std::vector<cvf::Vec3f>* vertices, std::vector<cvf::uint>* indices, float radius, float thickness );
|
||||
|
||||
private:
|
||||
std::vector<CompletionVizData> m_completionVizData;
|
||||
|
@@ -48,8 +48,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivWellConnectionFactorPartMgr::RivWellConnectionFactorPartMgr( RimWellPath* well,
|
||||
RimVirtualPerforationResults* virtualPerforationResult )
|
||||
RivWellConnectionFactorPartMgr::RivWellConnectionFactorPartMgr( RimWellPath* well, RimVirtualPerforationResults* virtualPerforationResult )
|
||||
: m_rimWellPath( well )
|
||||
, m_virtualPerforationResult( virtualPerforationResult )
|
||||
{
|
||||
@@ -79,8 +78,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
|
||||
|
||||
const RigMainGrid* mainGrid = eclipseCase->mainGrid();
|
||||
|
||||
const RigVirtualPerforationTransmissibilities* trans =
|
||||
eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||
const RigVirtualPerforationTransmissibilities* trans = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||
if ( !trans ) return;
|
||||
|
||||
auto completionsForWellPath = trans->multipleCompletionsPerEclipseCell( m_rimWellPath, frameIndex );
|
||||
@@ -103,8 +101,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
|
||||
|
||||
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections;
|
||||
{
|
||||
RigEclipseWellLogExtractor* extractor =
|
||||
RiaExtractionTools::findOrCreateWellLogExtractor( m_rimWellPath, eclipseCase );
|
||||
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::findOrCreateWellLogExtractor( m_rimWellPath, eclipseCase );
|
||||
if ( extractor )
|
||||
{
|
||||
wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath();
|
||||
@@ -172,8 +169,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
|
||||
|
||||
double transmissibility = completionData.transmissibility();
|
||||
|
||||
completionVizDataItems.push_back(
|
||||
CompletionVizData( displayCoord, direction, transmissibility, completionsForCell.first ) );
|
||||
completionVizDataItems.push_back( CompletionVizData( displayCoord, direction, transmissibility, completionsForCell.first ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,8 +177,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
|
||||
{
|
||||
double characteristicCellSize = eclView->ownerCase()->characteristicCellSize();
|
||||
|
||||
double radius =
|
||||
m_rimWellPath->wellPathRadius( characteristicCellSize ) * m_virtualPerforationResult->geometryScaleFactor();
|
||||
double radius = m_rimWellPath->wellPathRadius( characteristicCellSize ) * m_virtualPerforationResult->geometryScaleFactor();
|
||||
radius *= 2.0; // Enlarge the radius slightly to make the connection factor visible if geometry scale factor is
|
||||
// set to 1.0
|
||||
|
||||
@@ -193,8 +188,7 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
|
||||
cvf::ref<cvf::Part> part = m_geometryGenerator->createSurfacePart( scalarMapper, eclView->isLightingDisabled() );
|
||||
if ( part.notNull() )
|
||||
{
|
||||
cvf::ref<RivWellConnectionSourceInfo> sourceInfo =
|
||||
new RivWellConnectionSourceInfo( m_rimWellPath, m_geometryGenerator.p() );
|
||||
cvf::ref<RivWellConnectionSourceInfo> sourceInfo = new RivWellConnectionSourceInfo( m_rimWellPath, m_geometryGenerator.p() );
|
||||
part->setSourceInfo( sourceInfo.p() );
|
||||
|
||||
model->addPart( part.p() );
|
||||
|
@@ -24,8 +24,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivWellConnectionSourceInfo::RivWellConnectionSourceInfo( RimWellPath* wellPath,
|
||||
RivWellConnectionFactorGeometryGenerator* geometryGenerator )
|
||||
RivWellConnectionSourceInfo::RivWellConnectionSourceInfo( RimWellPath* wellPath, RivWellConnectionFactorGeometryGenerator* geometryGenerator )
|
||||
: m_wellPath( wellPath )
|
||||
, m_geometryGenerator( geometryGenerator )
|
||||
{
|
||||
|
@@ -33,8 +33,7 @@ class RivWellConnectionFactorGeometryGenerator;
|
||||
class RivWellConnectionSourceInfo : public cvf::Object
|
||||
{
|
||||
public:
|
||||
explicit RivWellConnectionSourceInfo( RimWellPath* wellPath,
|
||||
RivWellConnectionFactorGeometryGenerator* geometryGenerator );
|
||||
explicit RivWellConnectionSourceInfo( RimWellPath* wellPath, RivWellConnectionFactorGeometryGenerator* geometryGenerator );
|
||||
|
||||
RimWellPath* wellPath() const;
|
||||
|
||||
|
@@ -66,12 +66,10 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
|
||||
if ( !m_rimWell->showWell() ) return;
|
||||
if ( !m_rimWell->simWellData()->hasWellResult( frameIndex ) ) return;
|
||||
if ( !m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_isOpen ) return;
|
||||
if ( m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_productionType ==
|
||||
RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
|
||||
if ( m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_productionType == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
|
||||
return;
|
||||
|
||||
bool isProducer = ( m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_productionType ==
|
||||
RiaDefines::WellProductionType::PRODUCER );
|
||||
bool isProducer = ( m_rimWell->simWellData()->wellResultFrame( frameIndex )->m_productionType == RiaDefines::WellProductionType::PRODUCER );
|
||||
double pipeRadius = m_rimWell->pipeRadius();
|
||||
|
||||
cvf::Vec3d wellHeadTop;
|
||||
@@ -105,8 +103,8 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
|
||||
wellHeadBottom = displayCordXf->transformToDisplayCoord( wellHeadBottom );
|
||||
wellHeadTop.z() += characteristicCellSize;
|
||||
|
||||
cvf::Vec3d activeCellsBoundingBoxMax = displayCordXf->transformToDisplayCoord(
|
||||
m_rimReservoirView->currentActiveCellInfo()->geometryBoundingBox().max() );
|
||||
cvf::Vec3d activeCellsBoundingBoxMax =
|
||||
displayCordXf->transformToDisplayCoord( m_rimReservoirView->currentActiveCellInfo()->geometryBoundingBox().max() );
|
||||
mainArrowZHeight = activeCellsBoundingBoxMax.z() + 1.5 * characteristicCellSize; // Above the bbox somewhat;
|
||||
|
||||
if ( isProducer )
|
||||
@@ -139,8 +137,8 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
|
||||
RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
|
||||
continue;
|
||||
|
||||
bool isOtherProducer = ( otherWell->simWellData()->wellResultFrame( frameIndex )->m_productionType ==
|
||||
RiaDefines::WellProductionType::PRODUCER );
|
||||
bool isOtherProducer =
|
||||
( otherWell->simWellData()->wellResultFrame( frameIndex )->m_productionType == RiaDefines::WellProductionType::PRODUCER );
|
||||
|
||||
{
|
||||
std::string otherWellName = otherWell->name().toStdString();
|
||||
@@ -177,9 +175,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
|
||||
std::pair<double, double> injProdFluxPair =
|
||||
flowResults->injectorProducerPairFluxes( injectorName, producerName, static_cast<int>( frameIndex ) );
|
||||
std::pair<double, double> injProdFluxPairXF =
|
||||
flowResults->injectorProducerPairFluxes( crossFlowInjectorName,
|
||||
crossFlowProducerName,
|
||||
static_cast<int>( frameIndex ) );
|
||||
flowResults->injectorProducerPairFluxes( crossFlowInjectorName, crossFlowProducerName, static_cast<int>( frameIndex ) );
|
||||
|
||||
const double fluxThreshold = 0.0; // Todo : Needs threshold in Gui
|
||||
|
||||
@@ -202,8 +198,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
|
||||
{
|
||||
cvf::Vec3f startPoint = cvf::Vec3f( 0.5 * ( wellHeadTop + otherWellHeadTop ) );
|
||||
if ( m_useCurvedArrows ) startPoint.z() = mainArrowZHeight;
|
||||
cvf::Vec3f endPoint =
|
||||
cvf::Vec3f( wellHeadTop + ( 3 * pipeRadius * ( otherWellHeadTop - wellHeadTop ).getNormalized() ) );
|
||||
cvf::Vec3f endPoint = cvf::Vec3f( wellHeadTop + ( 3 * pipeRadius * ( otherWellHeadTop - wellHeadTop ).getNormalized() ) );
|
||||
cvf::Color4f arrowColor( otherWell->wellPipeColor() );
|
||||
|
||||
if ( fabs( injProdFluxPair.first ) > fluxThreshold && fabs( injProdFluxPair.second ) > fluxThreshold )
|
||||
@@ -213,8 +208,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
|
||||
startPoint.z() -= 0.5 * characteristicCellSize;
|
||||
endPoint.z() -= 0.5 * characteristicCellSize;
|
||||
}
|
||||
cvf::ref<cvf::Part> arrowPart =
|
||||
createArrowPart( startPoint, endPoint, width, isProducer, arrowColor, enableLighting );
|
||||
cvf::ref<cvf::Part> arrowPart = createArrowPart( startPoint, endPoint, width, isProducer, arrowColor, enableLighting );
|
||||
model->addPart( arrowPart.p() );
|
||||
}
|
||||
|
||||
@@ -222,8 +216,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
|
||||
{
|
||||
startPoint.z() -= 0.5 * characteristicCellSize;
|
||||
endPoint.z() -= 0.5 * characteristicCellSize;
|
||||
cvf::ref<cvf::Part> arrowPart =
|
||||
createArrowPart( startPoint, endPoint, widthXf, !isProducer, arrowColor, enableLighting );
|
||||
cvf::ref<cvf::Part> arrowPart = createArrowPart( startPoint, endPoint, widthXf, !isProducer, arrowColor, enableLighting );
|
||||
model->addPart( arrowPart.p() );
|
||||
}
|
||||
}
|
||||
@@ -259,10 +252,8 @@ cvf::ref<cvf::Part> RivWellConnectionsPartMgr::createArrowPart( const cvf::Vec3f
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivWellConnectionsPartMgr::createArrowGeometry( const cvf::Vec3f& startPoint,
|
||||
const cvf::Vec3f& endPoint,
|
||||
double width,
|
||||
bool useArrowEnd )
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivWellConnectionsPartMgr::createArrowGeometry( const cvf::Vec3f& startPoint, const cvf::Vec3f& endPoint, double width, bool useArrowEnd )
|
||||
{
|
||||
// Vertex layout
|
||||
// _ - _
|
||||
@@ -276,10 +267,9 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionsPartMgr::createArrowGeometry( const
|
||||
4, 6, 7, 9, 8, 4, 8, 9, 11, 10, 4, 10, 11, 20, 19,
|
||||
4, 19, 20, 13, 12, 4, 12, 13, 15, 14, 3, 16, 17, 18 };
|
||||
|
||||
static const cvf::uint injectorArrowFaceList[8 * 5 + 8] = { 4, 0, 1, 3, 2, 4, 2, 3, 5, 4, 4, 4,
|
||||
5, 7, 6, 4, 6, 7, 9, 8, 4, 8, 9, 11,
|
||||
10, 4, 10, 11, 20, 19, 4, 19, 20, 13, 12, 4,
|
||||
12, 13, 15, 14, 3, 14, 18, 16, 3, 18, 15, 17 };
|
||||
static const cvf::uint injectorArrowFaceList[8 * 5 + 8] = { 4, 0, 1, 3, 2, 4, 2, 3, 5, 4, 4, 4, 5, 7, 6, 4,
|
||||
6, 7, 9, 8, 4, 8, 9, 11, 10, 4, 10, 11, 20, 19, 4, 19,
|
||||
20, 13, 12, 4, 12, 13, 15, 14, 3, 14, 18, 16, 3, 18, 15, 17 };
|
||||
|
||||
cvf::Vec3f endPointInTopPlane = endPoint;
|
||||
if ( m_useCurvedArrows ) endPointInTopPlane.z() = startPoint.z();
|
||||
@@ -309,26 +299,26 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionsPartMgr::createArrowGeometry( const
|
||||
( *arrowVertexArray )[2] = endStart * fromTo + startPoint + widthVector;
|
||||
( *arrowVertexArray )[3] = endStart * fromTo + startPoint - widthVector;
|
||||
|
||||
( *arrowVertexArray )[4] = ( 1 * endStep + endStart ) * fromTo + startPoint + widthVector +
|
||||
0.250f * heightScaleVec; // 0.0250f * heightDiff;
|
||||
( *arrowVertexArray )[5] = ( 1 * endStep + endStart ) * fromTo + startPoint - widthVector +
|
||||
0.250f * heightScaleVec; // 0.0250f * heightDiff;
|
||||
( *arrowVertexArray )[6] = ( 2 * endStep + endStart ) * fromTo + startPoint + widthVector +
|
||||
0.750f * heightScaleVec; // 0.0750f * heightDiff;
|
||||
( *arrowVertexArray )[7] = ( 2 * endStep + endStart ) * fromTo + startPoint - widthVector +
|
||||
0.750f * heightScaleVec; // 0.0750f * heightDiff;
|
||||
( *arrowVertexArray )[8] = ( 3 * endStep + endStart ) * fromTo + startPoint + widthVector +
|
||||
1.000f * heightScaleVec; // 0.1000f * heightDiff;
|
||||
( *arrowVertexArray )[9] = ( 3 * endStep + endStart ) * fromTo + startPoint - widthVector +
|
||||
1.000f * heightScaleVec; // 0.1000f * heightDiff;
|
||||
( *arrowVertexArray )[10] = ( 4 * endStep + endStart ) * fromTo + startPoint + widthVector +
|
||||
0.875f * heightScaleVec; // 0.0875f * heightDiff;
|
||||
( *arrowVertexArray )[11] = ( 4 * endStep + endStart ) * fromTo + startPoint - widthVector +
|
||||
0.875f * heightScaleVec; // 0.0875f * heightDiff;
|
||||
( *arrowVertexArray )[19] = ( 4.7f * endStep + endStart ) * fromTo + startPoint + widthVector +
|
||||
0.400f * heightScaleVec; // 0.0875f * heightDiff;
|
||||
( *arrowVertexArray )[20] = ( 4.7f * endStep + endStart ) * fromTo + startPoint - widthVector +
|
||||
0.400f * heightScaleVec; // 0.0875f * heightDiff;
|
||||
( *arrowVertexArray )[4] = ( 1 * endStep + endStart ) * fromTo + startPoint + widthVector + 0.250f * heightScaleVec; // 0.0250f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[5] = ( 1 * endStep + endStart ) * fromTo + startPoint - widthVector + 0.250f * heightScaleVec; // 0.0250f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[6] = ( 2 * endStep + endStart ) * fromTo + startPoint + widthVector + 0.750f * heightScaleVec; // 0.0750f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[7] = ( 2 * endStep + endStart ) * fromTo + startPoint - widthVector + 0.750f * heightScaleVec; // 0.0750f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[8] = ( 3 * endStep + endStart ) * fromTo + startPoint + widthVector + 1.000f * heightScaleVec; // 0.1000f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[9] = ( 3 * endStep + endStart ) * fromTo + startPoint - widthVector + 1.000f * heightScaleVec; // 0.1000f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[10] = ( 4 * endStep + endStart ) * fromTo + startPoint + widthVector + 0.875f * heightScaleVec; // 0.0875f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[11] = ( 4 * endStep + endStart ) * fromTo + startPoint - widthVector + 0.875f * heightScaleVec; // 0.0875f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[19] = ( 4.7f * endStep + endStart ) * fromTo + startPoint + widthVector + 0.400f * heightScaleVec; // 0.0875f *
|
||||
// heightDiff;
|
||||
( *arrowVertexArray )[20] = ( 4.7f * endStep + endStart ) * fromTo + startPoint - widthVector + 0.400f * heightScaleVec; // 0.0875f *
|
||||
// heightDiff;
|
||||
|
||||
( *arrowVertexArray )[12] = ( 5 * endStep + endStart ) * fromTo + startPoint + widthVector;
|
||||
( *arrowVertexArray )[13] = ( 5 * endStep + endStart ) * fromTo + startPoint - widthVector;
|
||||
@@ -338,10 +328,8 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionsPartMgr::createArrowGeometry( const
|
||||
|
||||
if ( useArrowEnd )
|
||||
{
|
||||
( *arrowVertexArray )[16] = ( 6 * endStep + endStart ) * fromTo + startPoint + 1.6f * widthVector -
|
||||
0.5f * heightDiff;
|
||||
( *arrowVertexArray )[17] = ( 6 * endStep + endStart ) * fromTo + startPoint - 1.6f * widthVector -
|
||||
0.5f * heightDiff;
|
||||
( *arrowVertexArray )[16] = ( 6 * endStep + endStart ) * fromTo + startPoint + 1.6f * widthVector - 0.5f * heightDiff;
|
||||
( *arrowVertexArray )[17] = ( 6 * endStep + endStart ) * fromTo + startPoint - 1.6f * widthVector - 0.5f * heightDiff;
|
||||
( *arrowVertexArray )[18] = 1.0f * fromTo + startPoint - 1.0f * heightDiff;
|
||||
}
|
||||
else
|
||||
|
@@ -51,14 +51,13 @@ public:
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex );
|
||||
|
||||
private:
|
||||
cvf::ref<cvf::Part> createArrowPart( const cvf::Vec3f& startPoint,
|
||||
const cvf::Vec3f& endPoint,
|
||||
float width,
|
||||
bool isProducer,
|
||||
const cvf::Color4f& arrowColor,
|
||||
bool enableLighting );
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
createArrowGeometry( const cvf::Vec3f& startPoint, const cvf::Vec3f& endPoint, double width, bool useArrowEnd );
|
||||
cvf::ref<cvf::Part> createArrowPart( const cvf::Vec3f& startPoint,
|
||||
const cvf::Vec3f& endPoint,
|
||||
float width,
|
||||
bool isProducer,
|
||||
const cvf::Color4f& arrowColor,
|
||||
bool enableLighting );
|
||||
cvf::ref<cvf::DrawableGeo> createArrowGeometry( const cvf::Vec3f& startPoint, const cvf::Vec3f& endPoint, double width, bool useArrowEnd );
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_rimReservoirView;
|
||||
|
@@ -108,8 +108,7 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
|
||||
cvf::ref<RivSimWellPipeSourceInfo> sourceInfo = new RivSimWellPipeSourceInfo( m_rimWell, 0 );
|
||||
|
||||
// Well disk geometry
|
||||
double arrowLength =
|
||||
characteristicCellSize * simWellInViewCollection()->wellHeadScaleFactor() * m_rimWell->wellHeadScaleFactor();
|
||||
double arrowLength = characteristicCellSize * simWellInViewCollection()->wellHeadScaleFactor() * m_rimWell->wellHeadScaleFactor();
|
||||
|
||||
cvf::Vec3d diskPosition = whEndPos;
|
||||
diskPosition.z() += pipeRadius + arrowLength * 2.0;
|
||||
@@ -253,20 +252,14 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
|
||||
|
||||
if ( gasFraction > valueThresholdForLabel )
|
||||
{
|
||||
auto p = createTextAndLocation( aggregatedFraction + gasFraction / 2.0,
|
||||
diskPosition,
|
||||
ijScaleFactor,
|
||||
diskData.gasSigned() );
|
||||
auto p = createTextAndLocation( aggregatedFraction + gasFraction / 2.0, diskPosition, ijScaleFactor, diskData.gasSigned() );
|
||||
labelsWithPosition.push_back( p );
|
||||
aggregatedFraction += gasFraction;
|
||||
}
|
||||
|
||||
if ( waterFraction > valueThresholdForLabel )
|
||||
{
|
||||
auto p = createTextAndLocation( aggregatedFraction + waterFraction / 2.0,
|
||||
diskPosition,
|
||||
ijScaleFactor,
|
||||
diskData.waterSigned() );
|
||||
auto p = createTextAndLocation( aggregatedFraction + waterFraction / 2.0, diskPosition, ijScaleFactor, diskData.waterSigned() );
|
||||
|
||||
labelsWithPosition.push_back( p );
|
||||
aggregatedFraction += waterFraction;
|
||||
|
@@ -54,17 +54,13 @@ public:
|
||||
RivWellDiskPartMgr( RimSimWellInView* well );
|
||||
~RivWellDiskPartMgr() override;
|
||||
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
size_t frameIndex,
|
||||
const caf::DisplayCoordTransform* displayXf );
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex, const caf::DisplayCoordTransform* displayXf );
|
||||
|
||||
private:
|
||||
void buildWellDiskParts( size_t frameIndex, const caf::DisplayCoordTransform* displayXf );
|
||||
|
||||
std::pair<cvf::String, cvf::Vec3f> createTextAndLocation( const double aggregatedFraction,
|
||||
cvf::Vec3d diskPosition,
|
||||
double ijScaleFactor,
|
||||
const double fraction );
|
||||
std::pair<cvf::String, cvf::Vec3f>
|
||||
createTextAndLocation( const double aggregatedFraction, cvf::Vec3d diskPosition, double ijScaleFactor, const double fraction );
|
||||
|
||||
void clearAllGeometry();
|
||||
Rim3dView* viewWithSettings();
|
||||
|
@@ -94,8 +94,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* mo
|
||||
double characteristicCellSize = eclView.ownerCase()->characteristicCellSize();
|
||||
|
||||
cvf::Collection<cvf::Part> parts;
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate =
|
||||
dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
|
||||
if ( stimPlanFracTemplate )
|
||||
{
|
||||
@@ -151,8 +150,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* mo
|
||||
|
||||
auto fractureMatrix = m_rimFracture->transformMatrix();
|
||||
|
||||
if ( m_rimFracture->fractureTemplate() &&
|
||||
m_rimFracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH )
|
||||
if ( m_rimFracture->fractureTemplate() && m_rimFracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH )
|
||||
{
|
||||
cvf::Vec3d partTranslation = distanceToCenterLine * cvf::Vec3d( fractureMatrix.col( 2 ) );
|
||||
|
||||
@@ -186,9 +184,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* mo
|
||||
|
||||
cvf::Vec3d partTranslation = scaleFactor * cvf::Vec3d( fractureMatrix.col( 2 ) );
|
||||
|
||||
RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( model,
|
||||
maskOfFractureAreasOutsideGrid.p(),
|
||||
partTranslation );
|
||||
RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( model, maskOfFractureAreasOutsideGrid.p(), partTranslation );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,8 +216,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* mo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString RivWellFracturePartMgr::resultInfoText( const RimEclipseView& activeView,
|
||||
cvf::Vec3d domainIntersectionPoint ) const
|
||||
const QString RivWellFracturePartMgr::resultInfoText( const RimEclipseView& activeView, cvf::Vec3d domainIntersectionPoint ) const
|
||||
{
|
||||
QString text;
|
||||
|
||||
@@ -403,8 +398,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createEllipseSurfacePart( const RimE
|
||||
cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfacePart( const RimEclipseView& activeView )
|
||||
{
|
||||
CVF_ASSERT( m_rimFracture );
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate =
|
||||
dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
CVF_ASSERT( stimPlanFracTemplate );
|
||||
|
||||
auto displayCoordTransform = activeView.displayCoordTransform();
|
||||
@@ -483,7 +477,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfa
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> geo = buildDrawableGeoFromTriangles( triIndicesToInclude, nodeDisplayCoords );
|
||||
cvf::ref<cvf::DrawableGeo> geo = buildDrawableGeoFromTriangles( triIndicesToInclude, nodeDisplayCoords );
|
||||
const cvf::ScalarMapper* scalarMapper = legendConfig->scalarMapper();
|
||||
CVF_ASSERT( scalarMapper );
|
||||
|
||||
@@ -499,8 +493,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfa
|
||||
}
|
||||
geo->setTextureCoordArray( textureCoords.p() );
|
||||
|
||||
cvf::ref<cvf::Part> surfacePart =
|
||||
createScalarMapperPart( geo.p(), scalarMapper, m_rimFracture, activeView.isLightingDisabled() );
|
||||
cvf::ref<cvf::Part> surfacePart = createScalarMapperPart( geo.p(), scalarMapper, m_rimFracture, activeView.isLightingDisabled() );
|
||||
|
||||
return surfacePart;
|
||||
}
|
||||
@@ -508,16 +501,14 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfa
|
||||
{
|
||||
// No result is mapped, show the entire StimPlan surface with default color
|
||||
|
||||
return createSingleColorSurfacePart( triangleIndices,
|
||||
nodeDisplayCoords,
|
||||
activeView.fractureColors()->defaultColor() );
|
||||
return createSingleColorSurfacePart( triangleIndices, nodeDisplayCoords, activeView.fractureColors()->defaultColor() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part> RivWellFracturePartMgr::createSingleColorSurfacePart( const std::vector<cvf::uint>& triangleIndices,
|
||||
cvf::ref<cvf::Part> RivWellFracturePartMgr::createSingleColorSurfacePart( const std::vector<cvf::uint>& triangleIndices,
|
||||
const std::vector<cvf::Vec3f>& nodeCoords,
|
||||
const cvf::Color3f& color )
|
||||
{
|
||||
@@ -542,8 +533,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createSingleColorSurfacePart( const
|
||||
cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePart( const RimEclipseView& activeView )
|
||||
{
|
||||
CVF_ASSERT( m_rimFracture );
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate =
|
||||
dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
CVF_ASSERT( stimPlanFracTemplate );
|
||||
|
||||
if ( !m_rimFracture->fractureGrid() ) return nullptr;
|
||||
@@ -559,8 +549,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
|
||||
std::vector<RigFractureCell> stimPlanCells = m_rimFracture->fractureGrid()->fractureCells();
|
||||
|
||||
RimRegularLegendConfig* legendConfig = nullptr;
|
||||
if ( activeView.fractureColors() && activeView.fractureColors()->isChecked() &&
|
||||
activeView.fractureColors()->activeLegend() )
|
||||
if ( activeView.fractureColors() && activeView.fractureColors()->isChecked() && activeView.fractureColors()->activeLegend() )
|
||||
{
|
||||
legendConfig = activeView.fractureColors()->activeLegend();
|
||||
|
||||
@@ -569,10 +558,9 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
|
||||
QString resultNameFromColors = activeView.fractureColors()->uiResultName();
|
||||
QString resultUnitFromColors = activeView.fractureColors()->unit();
|
||||
|
||||
std::vector<double> prCellResults =
|
||||
stimPlanFracTemplate->fractureGridResults( resultNameFromColors,
|
||||
resultUnitFromColors,
|
||||
stimPlanFracTemplate->activeTimeStepIndex() );
|
||||
std::vector<double> prCellResults = stimPlanFracTemplate->fractureGridResults( resultNameFromColors,
|
||||
resultUnitFromColors,
|
||||
stimPlanFracTemplate->activeTimeStepIndex() );
|
||||
|
||||
textureCoords->reserve( prCellResults.size() * 4 );
|
||||
|
||||
@@ -609,9 +597,8 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
|
||||
std::vector<cvf::Vec3f> nodeDisplayCoords =
|
||||
transformToFractureDisplayCoords( stimPlanMeshVertices, fractureXf, *displayCoordTransform );
|
||||
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
|
||||
std::vector<cvf::Vec3f> nodeDisplayCoords = transformToFractureDisplayCoords( stimPlanMeshVertices, fractureXf, *displayCoordTransform );
|
||||
|
||||
std::vector<cvf::uint> triIndicesToInclude;
|
||||
|
||||
@@ -638,8 +625,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
|
||||
cvf::ref<cvf::DrawableGeo> geo = buildDrawableGeoFromTriangles( triIndicesToInclude, nodeDisplayCoords );
|
||||
geo->setTextureCoordArray( textureCoords.p() );
|
||||
|
||||
cvf::ref<cvf::Part> surfacePart =
|
||||
createScalarMapperPart( geo.p(), scalarMapper, m_rimFracture, activeView.isLightingDisabled() );
|
||||
cvf::ref<cvf::Part> surfacePart = createScalarMapperPart( geo.p(), scalarMapper, m_rimFracture, activeView.isLightingDisabled() );
|
||||
|
||||
return surfacePart;
|
||||
}
|
||||
@@ -647,9 +633,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePar
|
||||
{
|
||||
// No result is mapped, show the entire StimPlan surface with default color
|
||||
|
||||
return createSingleColorSurfacePart( triIndicesToInclude,
|
||||
nodeDisplayCoords,
|
||||
activeView.fractureColors()->defaultColor() );
|
||||
return createSingleColorSurfacePart( triIndicesToInclude, nodeDisplayCoords, activeView.fractureColors()->defaultColor() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,8 +664,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createContainmentMaskPart( const Rim
|
||||
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
activeView.firstAncestorOrThisOfType( eclipseCase );
|
||||
auto reservoirCellIndicesOpenForFlow =
|
||||
RimFractureContainmentTools::reservoirCellIndicesOpenForFlow( eclipseCase, m_rimFracture );
|
||||
auto reservoirCellIndicesOpenForFlow = RimFractureContainmentTools::reservoirCellIndicesOpenForFlow( eclipseCase, m_rimFracture );
|
||||
|
||||
for ( size_t resCellIdx : cellCandidates )
|
||||
{
|
||||
@@ -741,8 +724,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createContainmentMaskPart( const Rim
|
||||
|
||||
for ( size_t idx : triangleIndices )
|
||||
{
|
||||
maskTriangles.push_back(
|
||||
cvf::Vec3f( displCoordTrans->transformToDisplayCoord( clippedPolygon[idx] ) ) );
|
||||
maskTriangles.push_back( cvf::Vec3f( displCoordTrans->transformToDisplayCoord( clippedPolygon[idx] ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -848,8 +830,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createMaskOfFractureOutsideGrid( con
|
||||
activeView.mainGrid()->cellCornerVertices( resCellIdx, corners.data() );
|
||||
|
||||
std::vector<std::vector<cvf::Vec3d>> eclCellPolygons;
|
||||
bool hasIntersection =
|
||||
RigHexIntersectionTools::planeHexIntersectionPolygons( corners, frMx, eclCellPolygons );
|
||||
bool hasIntersection = RigHexIntersectionTools::planeHexIntersectionPolygons( corners, frMx, eclCellPolygons );
|
||||
|
||||
if ( !hasIntersection || eclCellPolygons.empty() ) continue;
|
||||
|
||||
@@ -940,8 +921,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createMaskOfFractureOutsideGrid( con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellFracturePartMgr::appendFracturePerforationLengthParts( const RimEclipseView& activeView,
|
||||
cvf::ModelBasicList* model )
|
||||
void RivWellFracturePartMgr::appendFracturePerforationLengthParts( const RimEclipseView& activeView, cvf::ModelBasicList* model )
|
||||
{
|
||||
if ( !m_rimFracture->isChecked() ) return;
|
||||
|
||||
@@ -1002,8 +982,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanMeshPart( const RimEcl
|
||||
{
|
||||
if ( !m_rimFracture->fractureTemplate() ) return nullptr;
|
||||
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate =
|
||||
dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
RimMeshFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimMeshFractureTemplate*>( m_rimFracture->fractureTemplate() );
|
||||
if ( !stimPlanFracTemplate ) return nullptr;
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> stimPlanMeshGeo = createStimPlanMeshDrawable( stimPlanFracTemplate, activeView );
|
||||
@@ -1030,8 +1009,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanMeshPart( const RimEcl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellFracturePartMgr::createVisibleFracturePolygons( RimMeshFractureTemplate* stimPlanFracTemplate,
|
||||
const RimEclipseView& activeView )
|
||||
void RivWellFracturePartMgr::createVisibleFracturePolygons( RimMeshFractureTemplate* stimPlanFracTemplate, const RimEclipseView& activeView )
|
||||
{
|
||||
if ( !m_rimFracture->fractureGrid() ) return;
|
||||
|
||||
@@ -1041,9 +1019,7 @@ void RivWellFracturePartMgr::createVisibleFracturePolygons( RimMeshFractureTempl
|
||||
QString resultUnitFromColors = activeView.fractureColors()->unit();
|
||||
|
||||
std::vector<double> prCellResults =
|
||||
stimPlanFracTemplate->fractureGridResults( resultNameFromColors,
|
||||
resultUnitFromColors,
|
||||
stimPlanFracTemplate->activeTimeStepIndex() );
|
||||
stimPlanFracTemplate->fractureGridResults( resultNameFromColors, resultUnitFromColors, stimPlanFracTemplate->activeTimeStepIndex() );
|
||||
|
||||
m_visibleFracturePolygons.clear();
|
||||
for ( size_t cIdx = 0; cIdx < stimPlanCells.size(); ++cIdx )
|
||||
@@ -1061,7 +1037,7 @@ void RivWellFracturePartMgr::createVisibleFracturePolygons( RimMeshFractureTempl
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable( RimMeshFractureTemplate* stimPlanFracTemplate,
|
||||
const RimEclipseView& activeView )
|
||||
const RimEclipseView& activeView )
|
||||
{
|
||||
if ( !m_rimFracture->fractureGrid() ) return nullptr;
|
||||
|
||||
@@ -1075,9 +1051,7 @@ cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable( R
|
||||
QString resultUnitFromColors = activeView.fractureColors()->unit();
|
||||
|
||||
std::vector<double> prCellResults =
|
||||
stimPlanFracTemplate->fractureGridResults( resultNameFromColors,
|
||||
resultUnitFromColors,
|
||||
stimPlanFracTemplate->activeTimeStepIndex() );
|
||||
stimPlanFracTemplate->fractureGridResults( resultNameFromColors, resultUnitFromColors, stimPlanFracTemplate->activeTimeStepIndex() );
|
||||
|
||||
for ( size_t cIdx = 0; cIdx < stimPlanCells.size(); ++cIdx )
|
||||
{
|
||||
@@ -1107,8 +1081,7 @@ cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable( R
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> stimPlanMeshGeo = new cvf::DrawableGeo;
|
||||
stimPlanMeshGeo->setVertexArray( stimPlanMeshVertexList );
|
||||
cvf::ref<cvf::UIntArray> indices =
|
||||
cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( stimPlanMeshVertexList );
|
||||
cvf::ref<cvf::UIntArray> indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( stimPlanMeshVertexList );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUInt> prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES );
|
||||
prim->setIndices( indices.p() );
|
||||
|
||||
@@ -1150,10 +1123,9 @@ std::vector<cvf::Vec3d> RivWellFracturePartMgr::fractureBorderPolygon()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3f>
|
||||
RivWellFracturePartMgr::transformToFractureDisplayCoords( const std::vector<cvf::Vec3f>& coordinatesVector,
|
||||
cvf::Mat4d m,
|
||||
const caf::DisplayCoordTransform& displayCoordTransform )
|
||||
std::vector<cvf::Vec3f> RivWellFracturePartMgr::transformToFractureDisplayCoords( const std::vector<cvf::Vec3f>& coordinatesVector,
|
||||
cvf::Mat4d m,
|
||||
const caf::DisplayCoordTransform& displayCoordTransform )
|
||||
{
|
||||
std::vector<cvf::Vec3f> polygonInDisplayCoords;
|
||||
polygonInDisplayCoords.reserve( coordinatesVector.size() );
|
||||
@@ -1172,9 +1144,8 @@ std::vector<cvf::Vec3f>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::DrawableGeo>
|
||||
RivWellFracturePartMgr::buildDrawableGeoFromTriangles( const std::vector<cvf::uint>& triangleIndices,
|
||||
const std::vector<cvf::Vec3f>& nodeCoords )
|
||||
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::buildDrawableGeoFromTriangles( const std::vector<cvf::uint>& triangleIndices,
|
||||
const std::vector<cvf::Vec3f>& nodeCoords )
|
||||
{
|
||||
CVF_ASSERT( triangleIndices.size() > 0 );
|
||||
CVF_ASSERT( nodeCoords.size() > 0 );
|
||||
@@ -1207,9 +1178,7 @@ cvf::ref<cvf::Transform> RivWellFracturePartMgr::createLocalTransformFromTransla
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( cvf::ModelBasicList* model,
|
||||
cvf::Part* part,
|
||||
const cvf::Vec3d& translation )
|
||||
void RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( cvf::ModelBasicList* model, cvf::Part* part, const cvf::Vec3d& translation )
|
||||
{
|
||||
{
|
||||
cvf::ref<cvf::Transform> partTransform = RivWellFracturePartMgr::createLocalTransformFromTranslation( translation );
|
||||
@@ -1222,8 +1191,7 @@ void RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( cvf::Model
|
||||
// Create a copy of the part to be able to assign a transformation matrix representing the translation in the
|
||||
// opposite direction
|
||||
|
||||
cvf::ref<cvf::Transform> partTransform =
|
||||
RivWellFracturePartMgr::createLocalTransformFromTranslation( -translation );
|
||||
cvf::ref<cvf::Transform> partTransform = RivWellFracturePartMgr::createLocalTransformFromTranslation( -translation );
|
||||
|
||||
auto copy = part->shallowCopy();
|
||||
copy->setTransform( partTransform.p() );
|
||||
|
@@ -79,8 +79,7 @@ private:
|
||||
void appendFracturePerforationLengthParts( const RimEclipseView& activeView, cvf::ModelBasicList* model );
|
||||
|
||||
cvf::ref<cvf::Part> createStimPlanMeshPart( const RimEclipseView& activeView );
|
||||
cvf::ref<cvf::DrawableGeo> createStimPlanMeshDrawable( RimMeshFractureTemplate* stimPlanFracTemplate,
|
||||
const RimEclipseView& activeView );
|
||||
cvf::ref<cvf::DrawableGeo> createStimPlanMeshDrawable( RimMeshFractureTemplate* stimPlanFracTemplate, const RimEclipseView& activeView );
|
||||
|
||||
void createVisibleFracturePolygons( RimMeshFractureTemplate* stimPlanFracTemplate, const RimEclipseView& activeView );
|
||||
|
||||
@@ -91,18 +90,15 @@ private:
|
||||
RimFracture* fracture,
|
||||
bool disableLighting );
|
||||
|
||||
static std::vector<cvf::Vec3f>
|
||||
transformToFractureDisplayCoords( const std::vector<cvf::Vec3f>& polygon,
|
||||
cvf::Mat4d m,
|
||||
const caf::DisplayCoordTransform& displayCoordTransform );
|
||||
static std::vector<cvf::Vec3f> transformToFractureDisplayCoords( const std::vector<cvf::Vec3f>& polygon,
|
||||
cvf::Mat4d m,
|
||||
const caf::DisplayCoordTransform& displayCoordTransform );
|
||||
|
||||
static cvf::ref<cvf::DrawableGeo> buildDrawableGeoFromTriangles( const std::vector<cvf::uint>& triangleIndices,
|
||||
const std::vector<cvf::Vec3f>& nodeCoords );
|
||||
|
||||
static cvf::ref<cvf::Transform> createLocalTransformFromTranslation( const cvf::Vec3d& translation );
|
||||
static void addPartAtPositiveAndNegativeTranslation( cvf::ModelBasicList* model,
|
||||
cvf::Part* part,
|
||||
const cvf::Vec3d& translation );
|
||||
static void addPartAtPositiveAndNegativeTranslation( cvf::ModelBasicList* model, cvf::Part* part, const cvf::Vec3d& translation );
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimFracture> m_rimFracture;
|
||||
|
@@ -70,10 +70,7 @@ RivWellHeadPartMgr::~RivWellHeadPartMgr()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellHeadPartMgr::buildWellHeadParts( size_t frameIndex,
|
||||
const caf::DisplayCoordTransform* displayXf,
|
||||
bool doFlatten,
|
||||
double xOffset )
|
||||
void RivWellHeadPartMgr::buildWellHeadParts( size_t frameIndex, const caf::DisplayCoordTransform* displayXf, bool doFlatten, double xOffset )
|
||||
{
|
||||
clearAllGeometry();
|
||||
|
||||
@@ -179,8 +176,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t f
|
||||
}
|
||||
}
|
||||
|
||||
double arrowLength =
|
||||
characteristicCellSize * simWellInViewCollection()->wellHeadScaleFactor() * m_rimWell->wellHeadScaleFactor();
|
||||
double arrowLength = characteristicCellSize * simWellInViewCollection()->wellHeadScaleFactor() * m_rimWell->wellHeadScaleFactor();
|
||||
|
||||
if ( wellResultFrame->m_isOpen )
|
||||
{
|
||||
|
@@ -44,18 +44,16 @@ public:
|
||||
RivWellHeadPartMgr( RimSimWellInView* well );
|
||||
~RivWellHeadPartMgr() override;
|
||||
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
size_t frameIndex,
|
||||
const caf::DisplayCoordTransform* displayXf );
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex, const caf::DisplayCoordTransform* displayXf );
|
||||
void appendFlattenedDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
size_t frameIndex,
|
||||
const caf::DisplayCoordTransform* displayXf,
|
||||
double xOffset );
|
||||
|
||||
private:
|
||||
void buildWellHeadParts( size_t frameIndex, const caf::DisplayCoordTransform* displayXf, bool doFlatten, double xOffset );
|
||||
void clearAllGeometry();
|
||||
Rim3dView* viewWithSettings();
|
||||
void buildWellHeadParts( size_t frameIndex, const caf::DisplayCoordTransform* displayXf, bool doFlatten, double xOffset );
|
||||
void clearAllGeometry();
|
||||
Rim3dView* viewWithSettings();
|
||||
RimSimWellInViewCollection* simWellInViewCollection();
|
||||
|
||||
private:
|
||||
|
@@ -151,8 +151,7 @@ bool RivWellPathPartMgr::isWellPathEnabled( const cvf::BoundingBox& wellPathClip
|
||||
|
||||
if ( wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF ) return false;
|
||||
|
||||
if ( wellPathCollection->wellPathVisibility() == RimWellPathCollection::ALL_ON && m_rimWellPath->showWellPath() == false )
|
||||
return false;
|
||||
if ( wellPathCollection->wellPathVisibility() == RimWellPathCollection::ALL_ON && m_rimWellPath->showWellPath() == false ) return false;
|
||||
|
||||
if ( !isWellPathWithinBoundingBox( wellPathClipBoundingBox ) ) return false;
|
||||
|
||||
@@ -162,8 +161,7 @@ bool RivWellPathPartMgr::isWellPathEnabled( const cvf::BoundingBox& wellPathClip
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::appendStaticFracturePartsToModel( cvf::ModelBasicList* model,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
void RivWellPathPartMgr::appendStaticFracturePartsToModel( cvf::ModelBasicList* model, const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
{
|
||||
if ( m_rimView.isNull() ) return;
|
||||
|
||||
@@ -237,10 +235,7 @@ void RivWellPathPartMgr::appendWellPathAttributesToModel( cvf::ModelBasicList*
|
||||
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo( attribute );
|
||||
|
||||
cvf::Collection<cvf::Part> parts;
|
||||
geoGenerator.tubeWithCenterLinePartsAndVariableWidth( &parts,
|
||||
displayCoords,
|
||||
radii,
|
||||
attribute->defaultComponentColor() );
|
||||
geoGenerator.tubeWithCenterLinePartsAndVariableWidth( &parts, displayCoords, radii, attribute->defaultComponentColor() );
|
||||
for ( auto part : parts )
|
||||
{
|
||||
part->setSourceInfo( objectSourceInfo.p() );
|
||||
@@ -272,10 +267,7 @@ void RivWellPathPartMgr::appendWellPathAttributesToModel( cvf::ModelBasicList*
|
||||
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo( attribute );
|
||||
|
||||
cvf::Collection<cvf::Part> parts;
|
||||
geoGenerator.tubeWithCenterLinePartsAndVariableWidth( &parts,
|
||||
displayCoords,
|
||||
radii,
|
||||
attribute->defaultComponentColor() );
|
||||
geoGenerator.tubeWithCenterLinePartsAndVariableWidth( &parts, displayCoords, radii, attribute->defaultComponentColor() );
|
||||
for ( auto part : parts )
|
||||
{
|
||||
part->setSourceInfo( objectSourceInfo.p() );
|
||||
@@ -357,8 +349,7 @@ void RivWellPathPartMgr::appendWellMeasurementsToModel( cvf::ModelBasicList*
|
||||
cvf::Collection<cvf::Part> parts;
|
||||
|
||||
// Use the view legend config to find color, if only one type of measurement is selected.
|
||||
cvf::Color3f color = cvf::Color3f(
|
||||
wellMeasurementInView->legendConfig()->scalarMapper()->mapToColor( wellMeasurement->value() ) );
|
||||
cvf::Color3f color = cvf::Color3f( wellMeasurementInView->legendConfig()->scalarMapper()->mapToColor( wellMeasurement->value() ) );
|
||||
|
||||
geoGenerator.tubeWithCenterLinePartsAndVariableWidth( &parts, displayCoords, radii, color );
|
||||
for ( auto part : parts )
|
||||
@@ -425,9 +416,7 @@ void RivWellPathPartMgr::appendPerforationsToModel( cvf::ModelBasicList*
|
||||
vector<cvf::Vec3d> perfIntervalCL;
|
||||
{
|
||||
pair<vector<cvf::Vec3d>, vector<double>> perfintervalCoordsAndMD =
|
||||
wellPathGeometry->clippedPointSubset( perforation->startMD(),
|
||||
perforation->endMD(),
|
||||
&horizontalLengthAlongWellPath );
|
||||
wellPathGeometry->clippedPointSubset( perforation->startMD(), perforation->endMD(), &horizontalLengthAlongWellPath );
|
||||
perfIntervalCL = perfintervalCoordsAndMD.first;
|
||||
}
|
||||
|
||||
@@ -440,9 +429,7 @@ void RivWellPathPartMgr::appendPerforationsToModel( cvf::ModelBasicList*
|
||||
vector<cvf::Mat4d> flatningCSs =
|
||||
RivSectionFlattener::calculateFlatteningCSsForPolyline( perfIntervalCL,
|
||||
cvf::Vec3d::Z_AXIS,
|
||||
{ horizontalLengthAlongWellPath,
|
||||
0.0,
|
||||
perfIntervalCL[0].z() },
|
||||
{ horizontalLengthAlongWellPath, 0.0, perfIntervalCL[0].z() },
|
||||
&dummy );
|
||||
|
||||
for ( size_t cIdx = 0; cIdx < perfIntervalCL.size(); ++cIdx )
|
||||
@@ -508,8 +495,8 @@ void RivWellPathPartMgr::appendPerforationValvesToModel( cvf::ModelBasicList*
|
||||
std::vector<cvf::Vec3d> displayCoords;
|
||||
for ( double mdRelativeToStart : measuredDepthsRelativeToStartMD )
|
||||
{
|
||||
displayCoords.push_back( displayCoordTransform->transformToDisplayCoord(
|
||||
m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(
|
||||
displayCoords.push_back(
|
||||
displayCoordTransform->transformToDisplayCoord( m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(
|
||||
mdRelativeToStart * 0.333 * wellPathRadius + startMD ) ) );
|
||||
}
|
||||
|
||||
@@ -565,8 +552,8 @@ void RivWellPathPartMgr::appendPerforationValvesToModel( cvf::ModelBasicList*
|
||||
for ( double mdRelativeToStart : measuredDepthsRelativeToStartMD )
|
||||
{
|
||||
displayCoords.push_back( displayCoordTransform->transformToDisplayCoord(
|
||||
m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(
|
||||
mdRelativeToStart * 0.333 * wellPathRadius + startMD ) ) );
|
||||
m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath( mdRelativeToStart * 0.333 * wellPathRadius +
|
||||
startMD ) ) );
|
||||
}
|
||||
|
||||
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo( valve );
|
||||
@@ -590,7 +577,7 @@ void RivWellPathPartMgr::appendPerforationValvesToModel( cvf::ModelBasicList*
|
||||
void RivWellPathPartMgr::appendVirtualTransmissibilitiesToModel( cvf::ModelBasicList* model,
|
||||
size_t timeStepIndex,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
double characteristicCellSize )
|
||||
double characteristicCellSize )
|
||||
{
|
||||
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( m_rimView.p() );
|
||||
if ( !eclView ) return;
|
||||
@@ -601,12 +588,10 @@ void RivWellPathPartMgr::appendVirtualTransmissibilitiesToModel( cvf::ModelBasic
|
||||
eclView->firstAncestorOrThisOfType( eclipseCase );
|
||||
if ( !eclipseCase ) return;
|
||||
|
||||
const RigVirtualPerforationTransmissibilities* trans =
|
||||
eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||
const RigVirtualPerforationTransmissibilities* trans = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||
if ( trans )
|
||||
{
|
||||
m_wellConnectionFactorPartMgr =
|
||||
new RivWellConnectionFactorPartMgr( m_rimWellPath, eclView->virtualPerforationResult() );
|
||||
m_wellConnectionFactorPartMgr = new RivWellConnectionFactorPartMgr( m_rimWellPath, eclView->virtualPerforationResult() );
|
||||
|
||||
m_wellConnectionFactorPartMgr->appendDynamicGeometryPartsToModel( model, timeStepIndex );
|
||||
}
|
||||
@@ -667,13 +652,12 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d
|
||||
if ( doFlatten )
|
||||
{
|
||||
cvf::Vec3d dummy;
|
||||
std::vector<cvf::Mat4d> flatningCSs =
|
||||
RivSectionFlattener::calculateFlatteningCSsForPolyline( clippedWellPathCenterLine,
|
||||
cvf::Vec3d::Z_AXIS,
|
||||
{ horizontalLengthAlongWellToClipPoint,
|
||||
0.0,
|
||||
clippedWellPathCenterLine[0].z() },
|
||||
&dummy );
|
||||
std::vector<cvf::Mat4d> flatningCSs = RivSectionFlattener::calculateFlatteningCSsForPolyline( clippedWellPathCenterLine,
|
||||
cvf::Vec3d::Z_AXIS,
|
||||
{ horizontalLengthAlongWellToClipPoint,
|
||||
0.0,
|
||||
clippedWellPathCenterLine[0].z() },
|
||||
&dummy );
|
||||
|
||||
for ( size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx )
|
||||
{
|
||||
@@ -883,8 +867,8 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel( cvf::ModelBasicList*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::appendFlattenedStaticGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
{
|
||||
if ( !wellPathClipBoundingBox.isValid() ) return;
|
||||
if ( !isWellPathWithinBoundingBox( wellPathClipBoundingBox ) ) return;
|
||||
@@ -962,8 +946,8 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicList*
|
||||
void RivWellPathPartMgr::appendFlattenedDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
|
||||
size_t timeStepIndex,
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
{
|
||||
CVF_ASSERT( model );
|
||||
|
||||
@@ -1009,8 +993,7 @@ RimWellPathCollection* RivWellPathPartMgr::wellPathCollection() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RivWellPathPartMgr::wellPathRadius( double characteristicCellSize, RimWellPathCollection* wellPathCollection )
|
||||
{
|
||||
return wellPathCollection->wellPathRadiusScaleFactor() * m_rimWellPath->wellPathRadiusScaleFactor() *
|
||||
characteristicCellSize;
|
||||
return wellPathCollection->wellPathRadiusScaleFactor() * m_rimWellPath->wellPathRadiusScaleFactor() * characteristicCellSize;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1020,8 +1003,7 @@ double RivWellPathPartMgr::wellMeasurementRadius( double
|
||||
const RimWellPathCollection* wellPathCollection,
|
||||
const RimWellMeasurementInView* wellMeasurementInView )
|
||||
{
|
||||
return wellPathCollection->wellPathRadiusScaleFactor() * wellMeasurementInView->radiusScaleFactor() *
|
||||
characteristicCellSize;
|
||||
return wellPathCollection->wellPathRadiusScaleFactor() * wellMeasurementInView->radiusScaleFactor() * characteristicCellSize;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1089,8 +1071,7 @@ void RivWellPathPartMgr::appendWellIntegrityIntervalsToModel( cvf::ModelBasicLis
|
||||
transformedVertices.push_back( cvf::Vec3f( displayCoordTransform->transformToDisplayCoord( v ) ) );
|
||||
}
|
||||
|
||||
cvf::ref<cvf::Part> boxpart =
|
||||
RivBoxGeometryGenerator::createBoxFromVertices( transformedVertices, cvf::Color3f::ORCHID );
|
||||
cvf::ref<cvf::Part> boxpart = RivBoxGeometryGenerator::createBoxFromVertices( transformedVertices, cvf::Color3f::ORCHID );
|
||||
boxpart->setSourceInfo( objectSourceInfo.p() );
|
||||
model->addPart( boxpart.p() );
|
||||
}
|
||||
|
@@ -126,10 +126,10 @@ private:
|
||||
|
||||
void clearAllBranchData();
|
||||
inline RimWellPathCollection* wellPathCollection() const;
|
||||
inline double wellPathRadius( double characteristicCellSize, RimWellPathCollection* wellPathCollection );
|
||||
double wellMeasurementRadius( double characteristicCellSize,
|
||||
const RimWellPathCollection* wellPathCollection,
|
||||
const RimWellMeasurementInView* wellMeasurementInView );
|
||||
inline double wellPathRadius( double characteristicCellSize, RimWellPathCollection* wellPathCollection );
|
||||
double wellMeasurementRadius( double characteristicCellSize,
|
||||
const RimWellPathCollection* wellPathCollection,
|
||||
const RimWellMeasurementInView* wellMeasurementInView );
|
||||
|
||||
bool isWellPathWithinBoundingBox( const cvf::BoundingBox& wellPathClipBoundingBox ) const;
|
||||
|
||||
|
@@ -81,8 +81,7 @@ double RivWellPathSourceInfo::measuredDepth( size_t triangleIndex, const cvf::Ve
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RivWellPathSourceInfo::closestPointOnCenterLine( size_t triangleIndex,
|
||||
const cvf::Vec3d& globalIntersectionInDomain ) const
|
||||
cvf::Vec3d RivWellPathSourceInfo::closestPointOnCenterLine( size_t triangleIndex, const cvf::Vec3d& globalIntersectionInDomain ) const
|
||||
{
|
||||
size_t firstSegmentIndex = cvf::UNDEFINED_SIZE_T;
|
||||
double norm = 0.0;
|
||||
@@ -130,6 +129,5 @@ void RivWellPathSourceInfo::normalizedIntersection( size_t triangleIn
|
||||
size_t RivWellPathSourceInfo::segmentIndex( size_t triangleIndex ) const
|
||||
{
|
||||
CAF_ASSERT( m_wellPath.notNull() );
|
||||
return m_pipeGeomGenerator->segmentIndexFromTriangleIndex( triangleIndex ) +
|
||||
m_wellPath->wellPathGeometry()->uniqueStartIndex();
|
||||
return m_pipeGeomGenerator->segmentIndexFromTriangleIndex( triangleIndex ) + m_wellPath->wellPathGeometry()->uniqueStartIndex();
|
||||
}
|
||||
|
@@ -54,18 +54,14 @@ void RivWellPathsPartMgr::appendStaticGeometryPartsToModel( cvf::ModelBasicList*
|
||||
|
||||
for ( auto& partMgr : m_wellPathsPartMgrs )
|
||||
{
|
||||
partMgr->appendStaticGeometryPartsToModel( model,
|
||||
displayCoordTransform,
|
||||
characteristicCellSize,
|
||||
wellPathClipBoundingBox );
|
||||
partMgr->appendStaticGeometryPartsToModel( model, displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathsPartMgr::appendStaticFracturePartsToModel( cvf::ModelBasicList* model,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
void RivWellPathsPartMgr::appendStaticFracturePartsToModel( cvf::ModelBasicList* model, const cvf::BoundingBox& wellPathClipBoundingBox )
|
||||
{
|
||||
if ( !isWellPathVisible() ) return;
|
||||
|
||||
@@ -90,11 +86,7 @@ void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicList
|
||||
|
||||
for ( auto& partMgr : m_wellPathsPartMgrs )
|
||||
{
|
||||
partMgr->appendDynamicGeometryPartsToModel( model,
|
||||
timeStepIndex,
|
||||
displayCoordTransform,
|
||||
characteristicCellSize,
|
||||
wellPathClipBoundingBox );
|
||||
partMgr->appendDynamicGeometryPartsToModel( model, timeStepIndex, displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -119,8 +119,7 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicLi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf::Vec3f, cvf::Color3f>>& centerColorPairs,
|
||||
bool isWellOpen )
|
||||
cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf::Vec3f, cvf::Color3f>>& centerColorPairs, bool isWellOpen )
|
||||
{
|
||||
cvf::ref<cvf::Vec3fArray> vertices = new cvf::Vec3fArray;
|
||||
cvf::ref<cvf::Vec3fArray> vecRes = new cvf::Vec3fArray;
|
||||
@@ -156,7 +155,7 @@ cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf
|
||||
|
||||
cvf::GeometryBuilderTriangles builder;
|
||||
double characteristicCellSize = m_rimReservoirView->mainGrid()->characteristicIJCellSize();
|
||||
double cellRadius = m_rimReservoirView->wellCollection()->spheresScaleFactor() * characteristicCellSize;
|
||||
double cellRadius = m_rimReservoirView->wellCollection()->spheresScaleFactor() * characteristicCellSize;
|
||||
|
||||
if ( isWellOpen )
|
||||
{
|
||||
@@ -180,8 +179,7 @@ cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf
|
||||
{
|
||||
cvf::ref<cvf::OpenGLContext> oglContext = m_rimReservoirView->viewer()->cvfOpenGLContext();
|
||||
cvf::OpenGLResourceManager* resourceManager = oglContext->resourceManager();
|
||||
cvf::ref<cvf::ShaderProgram> vectorProgram =
|
||||
resourceManager->getLinkedVectorDrawerShaderProgram( oglContext.p() );
|
||||
cvf::ref<cvf::ShaderProgram> vectorProgram = resourceManager->getLinkedVectorDrawerShaderProgram( oglContext.p() );
|
||||
|
||||
eff->setShaderProgram( vectorProgram.p() );
|
||||
}
|
||||
@@ -195,8 +193,7 @@ cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RivWellSpheresPartMgr::wellCellColor( const RigWellResultFrame* wellResultFrame,
|
||||
const RigWellResultPoint& wellResultPoint )
|
||||
cvf::Color3f RivWellSpheresPartMgr::wellCellColor( const RigWellResultFrame* wellResultFrame, const RigWellResultPoint& wellResultPoint )
|
||||
{
|
||||
// Colours should be synchronized with RivWellPipesPartMgr::updatePipeResultColor
|
||||
|
||||
|
@@ -54,7 +54,7 @@ public:
|
||||
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex );
|
||||
|
||||
private:
|
||||
cvf::Color3f wellCellColor( const RigWellResultFrame* wellResultFrame, const RigWellResultPoint& wellResultPoint );
|
||||
cvf::Color3f wellCellColor( const RigWellResultFrame* wellResultFrame, const RigWellResultPoint& wellResultPoint );
|
||||
cvf::ref<cvf::Part> createPart( std::vector<std::pair<cvf::Vec3f, cvf::Color3f>>& centerColorPairs, bool isWellOpen );
|
||||
|
||||
private:
|
||||
|
@@ -119,9 +119,8 @@ void RivStreamlinesPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicLi
|
||||
void RivStreamlinesPartMgr::updateAnimation()
|
||||
{
|
||||
RimStreamlineInViewCollection* streamlineCollection = m_rimReservoirView->streamlineCollection();
|
||||
if ( streamlineCollection &&
|
||||
( streamlineCollection->visualizationMode() == RimStreamlineInViewCollection::VisualizationMode::ANIMATION ||
|
||||
streamlineCollection->visualizationMode() == RimStreamlineInViewCollection::VisualizationMode::MANUAL ) )
|
||||
if ( streamlineCollection && ( streamlineCollection->visualizationMode() == RimStreamlineInViewCollection::VisualizationMode::ANIMATION ||
|
||||
streamlineCollection->visualizationMode() == RimStreamlineInViewCollection::VisualizationMode::MANUAL ) )
|
||||
{
|
||||
for ( Streamline& streamline : m_streamlines )
|
||||
{
|
||||
@@ -135,8 +134,7 @@ void RivStreamlinesPartMgr::updateAnimation()
|
||||
size_t startIndex = 0;
|
||||
size_t endIndex = primitiveSet->indices()->size();
|
||||
|
||||
if ( streamlineCollection->visualizationMode() ==
|
||||
RimStreamlineInViewCollection::VisualizationMode::ANIMATION )
|
||||
if ( streamlineCollection->visualizationMode() == RimStreamlineInViewCollection::VisualizationMode::ANIMATION )
|
||||
{
|
||||
streamline.incrementAnimationIndex( streamlineCollection->animationSpeed() );
|
||||
|
||||
@@ -164,8 +162,7 @@ void RivStreamlinesPartMgr::updateAnimation()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Part> RivStreamlinesPartMgr::createPart( const RimStreamlineInViewCollection& streamlineCollection,
|
||||
Streamline& streamline )
|
||||
cvf::ref<cvf::Part> RivStreamlinesPartMgr::createPart( const RimStreamlineInViewCollection& streamlineCollection, Streamline& streamline )
|
||||
{
|
||||
cvf::ref<caf::DisplayCoordTransform> displayCordXf = m_rimReservoirView->displayCoordTransform();
|
||||
|
||||
@@ -188,9 +185,8 @@ cvf::ref<cvf::Part> RivStreamlinesPartMgr::createPart( const RimStreamlineInView
|
||||
}
|
||||
}
|
||||
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUIntScoped> indexedUIntLine =
|
||||
new cvf::PrimitiveSetIndexedUIntScoped( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexedArrayLine = new cvf::UIntArray( indices );
|
||||
cvf::ref<cvf::PrimitiveSetIndexedUIntScoped> indexedUIntLine = new cvf::PrimitiveSetIndexedUIntScoped( cvf::PrimitiveType::PT_LINES );
|
||||
cvf::ref<cvf::UIntArray> indexedArrayLine = new cvf::UIntArray( indices );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> drawable = new cvf::DrawableGeo();
|
||||
|
||||
|
@@ -80,12 +80,9 @@ private:
|
||||
};
|
||||
|
||||
private:
|
||||
cvf::ref<cvf::Part> createPart( const RimStreamlineInViewCollection& streamlineCollection,
|
||||
Streamline& streamlineVisualization );
|
||||
cvf::ref<cvf::Part> createPart( const RimStreamlineInViewCollection& streamlineCollection, Streamline& streamlineVisualization );
|
||||
|
||||
void createResultColorTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const Streamline& streamline,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
void createResultColorTextureCoords( cvf::Vec2fArray* textureCoords, const Streamline& streamline, const cvf::ScalarMapper* mapper );
|
||||
|
||||
void setAlpha( cvf::ref<cvf::Part> part, float alpha );
|
||||
|
||||
|
@@ -23,8 +23,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivReservoirSurfaceIntersectionSourceInfo::RivReservoirSurfaceIntersectionSourceInfo(
|
||||
RivSurfaceIntersectionGeometryGenerator* geometryGenerator )
|
||||
RivReservoirSurfaceIntersectionSourceInfo::RivReservoirSurfaceIntersectionSourceInfo( RivSurfaceIntersectionGeometryGenerator* geometryGenerator )
|
||||
: m_intersectionGeometryGenerator( geometryGenerator )
|
||||
{
|
||||
CVF_ASSERT( m_intersectionGeometryGenerator.notNull() );
|
||||
|
@@ -63,7 +63,7 @@ cvf::ref<caf::DisplayCoordTransform> displayCoordTransform( const RimIntersectio
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivSurfaceIntersectionGeometryGenerator::RivSurfaceIntersectionGeometryGenerator( RimSurfaceInView* surfInView,
|
||||
RivSurfaceIntersectionGeometryGenerator::RivSurfaceIntersectionGeometryGenerator( RimSurfaceInView* surfInView,
|
||||
const RivIntersectionHexGridInterface* grid )
|
||||
: m_surfaceInView( surfInView )
|
||||
, m_hexGrid( grid )
|
||||
@@ -104,8 +104,7 @@ public:
|
||||
if ( isFace( cellFaceForEachClippedTriangleEdge[triVxIdx] ) )
|
||||
{
|
||||
const RigFault* fault =
|
||||
m_hexGrid->findFaultFromCellIndexAndCellFace( globalCellIdx,
|
||||
(FaceType)cellFaceForEachClippedTriangleEdge[triVxIdx] );
|
||||
m_hexGrid->findFaultFromCellIndexAndCellFace( globalCellIdx, (FaceType)cellFaceForEachClippedTriangleEdge[triVxIdx] );
|
||||
if ( fault )
|
||||
{
|
||||
cvf::Vec3d highestVx = p0.z() > p1.z() ? p0 : p1;
|
||||
@@ -217,12 +216,11 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays()
|
||||
m_hexGrid->cellCornerVertices( globalCellIdx, &cellCorners[0] );
|
||||
m_hexGrid->cellCornerIndices( globalCellIdx, &cornerIndices[0] );
|
||||
|
||||
int triangleCount =
|
||||
caf::HexGridIntersectionTools::planeHexIntersectionMCTet( plane,
|
||||
&cellCorners[0],
|
||||
&cornerIndices[0],
|
||||
&hexPlaneCutTriangleVxes,
|
||||
&cellFaceForEachTriangleEdge );
|
||||
int triangleCount = caf::HexGridIntersectionTools::planeHexIntersectionMCTet( plane,
|
||||
&cellCorners[0],
|
||||
&cornerIndices[0],
|
||||
&hexPlaneCutTriangleVxes,
|
||||
&cellFaceForEachTriangleEdge );
|
||||
|
||||
if ( triangleCount == 0 ) continue;
|
||||
|
||||
@@ -268,33 +266,18 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays()
|
||||
|
||||
// Accumulate mesh lines
|
||||
|
||||
meshAcc.accumulateMeshLines( cellFaceForEachClippedTriangleEdge,
|
||||
triVxIdx + 0,
|
||||
globalCellIdx,
|
||||
point0,
|
||||
point1 );
|
||||
meshAcc.accumulateMeshLines( cellFaceForEachClippedTriangleEdge,
|
||||
triVxIdx + 1,
|
||||
globalCellIdx,
|
||||
point1,
|
||||
point2 );
|
||||
meshAcc.accumulateMeshLines( cellFaceForEachClippedTriangleEdge,
|
||||
triVxIdx + 2,
|
||||
globalCellIdx,
|
||||
point2,
|
||||
point0 );
|
||||
meshAcc.accumulateMeshLines( cellFaceForEachClippedTriangleEdge, triVxIdx + 0, globalCellIdx, point0, point1 );
|
||||
meshAcc.accumulateMeshLines( cellFaceForEachClippedTriangleEdge, triVxIdx + 1, globalCellIdx, point1, point2 );
|
||||
meshAcc.accumulateMeshLines( cellFaceForEachClippedTriangleEdge, triVxIdx + 2, globalCellIdx, point2, point0 );
|
||||
|
||||
// Mapping to cell index
|
||||
|
||||
m_triangleToCellIdxMap.push_back( globalCellIdx );
|
||||
|
||||
// Interpolation from nodes
|
||||
m_triVxToCellCornerWeights.emplace_back(
|
||||
RivIntersectionVertexWeights( cornerIndices, cornerWeights0 ) );
|
||||
m_triVxToCellCornerWeights.emplace_back(
|
||||
RivIntersectionVertexWeights( cornerIndices, cornerWeights1 ) );
|
||||
m_triVxToCellCornerWeights.emplace_back(
|
||||
RivIntersectionVertexWeights( cornerIndices, cornerWeights2 ) );
|
||||
m_triVxToCellCornerWeights.emplace_back( RivIntersectionVertexWeights( cornerIndices, cornerWeights0 ) );
|
||||
m_triVxToCellCornerWeights.emplace_back( RivIntersectionVertexWeights( cornerIndices, cornerWeights1 ) );
|
||||
m_triVxToCellCornerWeights.emplace_back( RivIntersectionVertexWeights( cornerIndices, cornerWeights2 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -364,8 +347,7 @@ cvf::ref<cvf::DrawableGeo> RivSurfaceIntersectionGeometryGenerator::createFaultM
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<std::pair<QString, cvf::Vec3d>>&
|
||||
RivSurfaceIntersectionGeometryGenerator::faultMeshLabelAndAnchorPositions()
|
||||
const std::vector<std::pair<QString, cvf::Vec3d>>& RivSurfaceIntersectionGeometryGenerator::faultMeshLabelAndAnchorPositions()
|
||||
{
|
||||
return m_faultMeshLabelAndAnchorPositions;
|
||||
}
|
||||
@@ -382,8 +364,7 @@ const std::vector<size_t>& RivSurfaceIntersectionGeometryGenerator::triangleToCe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RivIntersectionVertexWeights>&
|
||||
RivSurfaceIntersectionGeometryGenerator::triangleVxToCellCornerInterpolationWeights() const
|
||||
const std::vector<RivIntersectionVertexWeights>& RivSurfaceIntersectionGeometryGenerator::triangleVxToCellCornerInterpolationWeights() const
|
||||
{
|
||||
CVF_ASSERT( m_triangleVxes->size() );
|
||||
return m_triVxToCellCornerWeights;
|
||||
|
@@ -55,7 +55,7 @@ RivSurfacePartMgr::RivSurfacePartMgr( RimSurfaceInView* surface )
|
||||
CVF_ASSERT( surface );
|
||||
|
||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = m_surfaceInView->createHexGridInterface();
|
||||
m_intersectionGenerator = new RivSurfaceIntersectionGeometryGenerator( m_surfaceInView, hexGrid.p() );
|
||||
m_intersectionGenerator = new RivSurfaceIntersectionGeometryGenerator( m_surfaceInView, hexGrid.p() );
|
||||
|
||||
m_intersectionFacesTextureCoords = new cvf::Vec2fArray;
|
||||
m_nativeTrianglesTextureCoords = new cvf::Vec2fArray;
|
||||
@@ -187,8 +187,7 @@ void RivSurfacePartMgr::updateNativeSurfaceColors()
|
||||
}
|
||||
else
|
||||
{
|
||||
caf::SurfaceEffectGenerator surfaceGenBehind( cvf::Color4f( m_surfaceInView->surface()->color() ),
|
||||
caf::PO_POS_LARGE );
|
||||
caf::SurfaceEffectGenerator surfaceGenBehind( cvf::Color4f( m_surfaceInView->surface()->color() ), caf::PO_POS_LARGE );
|
||||
|
||||
cvf::ref<cvf::Effect> effBehind = surfaceGenBehind.generateCachedEffect();
|
||||
if ( m_nativeTrianglesPart.notNull() )
|
||||
@@ -237,8 +236,7 @@ QString RivSurfacePartMgr::resultInfoText( Rim3dView* view, uint hitPart, cvf::V
|
||||
|
||||
if ( m_surfaceInView->surfaceResultDefinition()->isChecked() )
|
||||
{
|
||||
const auto& values =
|
||||
m_usedSurfaceData->propertyValues( m_surfaceInView->surfaceResultDefinition()->propertyName() );
|
||||
const auto& values = m_usedSurfaceData->propertyValues( m_surfaceInView->surfaceResultDefinition()->propertyName() );
|
||||
if ( values.empty() ) return "";
|
||||
|
||||
const auto& ind = m_usedSurfaceData->triangleIndices();
|
||||
@@ -260,11 +258,9 @@ QString RivSurfacePartMgr::resultInfoText( Rim3dView* view, uint hitPart, cvf::V
|
||||
double resultValue = -1.0;
|
||||
if ( vertIndex1 < values.size() ) resultValue = values[vertIndex1];
|
||||
if ( dist2 < dist1 && vertIndex2 < values.size() ) resultValue = values[vertIndex2];
|
||||
if ( ( dist3 < dist1 ) && ( dist3 < dist2 ) && vertIndex3 < values.size() )
|
||||
resultValue = values[vertIndex3];
|
||||
if ( ( dist3 < dist1 ) && ( dist3 < dist2 ) && vertIndex3 < values.size() ) resultValue = values[vertIndex3];
|
||||
|
||||
retval +=
|
||||
QString( "%1 : %2\n\n" ).arg( m_surfaceInView->surfaceResultDefinition()->propertyName() ).arg( resultValue );
|
||||
retval += QString( "%1 : %2\n\n" ).arg( m_surfaceInView->surfaceResultDefinition()->propertyName() ).arg( resultValue );
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
|
@@ -61,7 +61,7 @@ private:
|
||||
cvf::ref<RivSurfaceIntersectionGeometryGenerator> m_intersectionGenerator;
|
||||
|
||||
caf::PdmPointer<RimSurfaceInView> m_surfaceInView;
|
||||
cvf::ref<RigSurface> m_usedSurfaceData; // Store the reference to the old data, to know when new data has arrived.
|
||||
cvf::ref<RigSurface> m_usedSurfaceData; // Store the reference to the old data, to know when new data has arrived.
|
||||
|
||||
cvf::ref<cvf::Part> m_nativeTrianglesPart;
|
||||
cvf::ref<cvf::Part> m_nativeMeshLinesPart;
|
||||
|
@@ -247,10 +247,7 @@ bool RivWindowEdgeAxesOverlayItem::pick( int oglXCoord, int oglYCoord, const Vec
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Set up camera/viewport and render
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWindowEdgeAxesOverlayItem::renderGeneric( OpenGLContext* oglContext,
|
||||
const Vec2i& position,
|
||||
const Vec2ui& size,
|
||||
bool software )
|
||||
void RivWindowEdgeAxesOverlayItem::renderGeneric( OpenGLContext* oglContext, const Vec2i& position, const Vec2ui& size, bool software )
|
||||
{
|
||||
if ( size.x() <= 0 || size.y() <= 0 || ( m_windowTickXValues.size() == 0 && m_windowTickYValues.size() == 0 ) )
|
||||
{
|
||||
@@ -564,8 +561,7 @@ void RivWindowEdgeAxesOverlayItem::renderShaderFrameAndTickLines( OpenGLContext*
|
||||
|
||||
// Triangle indices for the frame background
|
||||
|
||||
static const ushort backgroundTriangleIndices[] = { 0, 1, 5, 0, 5, 4, 1, 2, 6, 1, 6, 5,
|
||||
3, 0, 4, 3, 4, 7, 2, 3, 6, 3, 7, 6 };
|
||||
static const ushort backgroundTriangleIndices[] = { 0, 1, 5, 0, 5, 4, 1, 2, 6, 1, 6, 5, 3, 0, 4, 3, 4, 7, 2, 3, 6, 3, 7, 6 };
|
||||
|
||||
glDrawRangeElements( GL_TRIANGLES, 0, 7, 24, GL_UNSIGNED_SHORT, backgroundTriangleIndices );
|
||||
|
||||
|
Reference in New Issue
Block a user