#5101 clang-format: Adjusted penalties

Use lower absolute values to improve control of behavior
This commit is contained in:
Magne Sjaastad committed 2020-02-12 13:35:31 +01:00
1 parent 10f0abc9b5
commit c82df63e10
710 files changed
+3167 -4721

No files matched your search

@@ -267,8 +267,7 @@ void RivGridBoxGenerator::updateFromCamera( const cvf::Camera* camera )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGridBoxGenerator::computeEdgeVisibility( const std::vector<bool>& faceVisibility,
std::vector<bool>& edgeVisibility )
void RivGridBoxGenerator::computeEdgeVisibility( const std::vector<bool>& faceVisibility, std::vector<bool>& edgeVisibility )
{
CVF_ASSERT( faceVisibility.size() == NEG_Z + 1 );
CVF_ASSERT( edgeVisibility.size() == NEG_X_NEG_Y + 1 );
@@ -147,14 +147,11 @@ public:
{
std::array<cvf::Plane, 6> boxPlanes;
boxPlanes[FaceType::POS_I].setFromPointAndNormal( m_origin.translation() + m_size,
cvf::Vec3d( m_origin.col( 0 ) ) );
boxPlanes[FaceType::POS_I].setFromPointAndNormal( m_origin.translation() + m_size, cvf::Vec3d( m_origin.col( 0 ) ) );
boxPlanes[FaceType::NEG_I].setFromPointAndNormal( m_origin.translation(), -cvf::Vec3d( m_origin.col( 0 ) ) );
boxPlanes[FaceType::POS_J].setFromPointAndNormal( m_origin.translation() + m_size,
cvf::Vec3d( m_origin.col( 1 ) ) );
boxPlanes[FaceType::POS_J].setFromPointAndNormal( m_origin.translation() + m_size, cvf::Vec3d( m_origin.col( 1 ) ) );
boxPlanes[FaceType::NEG_J].setFromPointAndNormal( m_origin.translation(), -cvf::Vec3d( m_origin.col( 1 ) ) );
boxPlanes[FaceType::POS_K].setFromPointAndNormal( m_origin.translation() + m_size,
cvf::Vec3d( m_origin.col( 2 ) ) );
boxPlanes[FaceType::POS_K].setFromPointAndNormal( m_origin.translation() + m_size, cvf::Vec3d( m_origin.col( 2 ) ) );
boxPlanes[FaceType::NEG_K].setFromPointAndNormal( m_origin.translation(), -cvf::Vec3d( m_origin.col( 2 ) ) );
return boxPlanes;
@@ -421,14 +418,13 @@ void RivBoxIntersectionGeometryGenerator::calculateArrays()
if ( cvx1.isVxIdsNative && cvx2.isVxIdsNative )
{
m_triVxToCellCornerWeights.push_back(
RivIntersectionVertexWeights( cvx1.clippedEdgeVx1Id,
cvx1.clippedEdgeVx2Id,
cvx1.normDistFromEdgeVx1,
cvx2.clippedEdgeVx1Id,
cvx2.clippedEdgeVx2Id,
cvx2.normDistFromEdgeVx1,
cvx.normDistFromEdgeVx1 ) );
m_triVxToCellCornerWeights.push_back( RivIntersectionVertexWeights( cvx1.clippedEdgeVx1Id,
cvx1.clippedEdgeVx2Id,
cvx1.normDistFromEdgeVx1,
cvx2.clippedEdgeVx1Id,
cvx2.clippedEdgeVx2Id,
cvx2.normDistFromEdgeVx1,
cvx.normDistFromEdgeVx1 ) );
}
else
{
@@ -40,8 +40,7 @@ class DrawableGeo;
class RivBoxIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorIF
{
public:
RivBoxIntersectionGeometryGenerator( RimBoxIntersection* intersectionBox,
const RivIntersectionHexGridInterface* grid );
RivBoxIntersectionGeometryGenerator( RimBoxIntersection* intersectionBox, const RivIntersectionHexGridInterface* grid );
~RivBoxIntersectionGeometryGenerator() override;
@@ -386,21 +386,9 @@ void RivExtrudedCurveIntersectionGeometryGenerator::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
@@ -412,24 +400,22 @@ void RivExtrudedCurveIntersectionGeometryGenerator::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
{
caf::HexGridIntersectionTools::ClipVx cvx1 = hexPlaneCutTriangleVxes[cvx.clippedEdgeVx1Id];
caf::HexGridIntersectionTools::ClipVx cvx2 = hexPlaneCutTriangleVxes[cvx.clippedEdgeVx2Id];
m_triVxToCellCornerWeights.push_back(
RivIntersectionVertexWeights( cvx1.clippedEdgeVx1Id,
cvx1.clippedEdgeVx2Id,
cvx1.normDistFromEdgeVx1,
cvx2.clippedEdgeVx1Id,
cvx2.clippedEdgeVx2Id,
cvx2.normDistFromEdgeVx1,
cvx.normDistFromEdgeVx1 ) );
m_triVxToCellCornerWeights.push_back( RivIntersectionVertexWeights( cvx1.clippedEdgeVx1Id,
cvx1.clippedEdgeVx2Id,
cvx1.normDistFromEdgeVx1,
cvx2.clippedEdgeVx1Id,
cvx2.clippedEdgeVx2Id,
cvx2.normDistFromEdgeVx1,
cvx.normDistFromEdgeVx1 ) );
}
}
}
@@ -522,8 +508,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} ) );
}
//--------------------------------------------------------------------------------------------------
@@ -548,8 +533,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} ) );
}
//--------------------------------------------------------------------------------------------------
@@ -250,8 +250,8 @@ void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry()
part->setDrawable( geo.p() );
// Set mapping from triangle face index to cell index
cvf::ref<RivExtrudedCurveIntersectionSourceInfo> si = new RivExtrudedCurveIntersectionSourceInfo(
m_intersectionGenerator.p() );
cvf::ref<RivExtrudedCurveIntersectionSourceInfo> si =
new RivExtrudedCurveIntersectionSourceInfo( m_intersectionGenerator.p() );
part->setSourceInfo( si.p() );
part->updateBoundingBox();
@@ -321,8 +321,7 @@ void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivExtrudedCurveIntersectionPartMgr::createFaultLabelParts(
const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors )
void RivExtrudedCurveIntersectionPartMgr::createFaultLabelParts( const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors )
{
m_faultMeshLabels = nullptr;
m_faultMeshLabelLines = nullptr;
@@ -498,8 +497,7 @@ void RivExtrudedCurveIntersectionPartMgr::createPolyLineParts( bool useBufferObj
depth->enableDepthTest( false );
eff->setRenderState( depth.p() );
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint(
cvf::RenderStatePoint::FIXED_SIZE );
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint( cvf::RenderStatePoint::FIXED_SIZE );
pointRendState->setSize( 5.0f );
eff->setRenderState( pointRendState.p() );
@@ -581,8 +579,7 @@ void RivExtrudedCurveIntersectionPartMgr::createExtrusionDirParts( bool useBuffe
depth->enableDepthTest( false );
eff->setRenderState( depth.p() );
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint(
cvf::RenderStatePoint::FIXED_SIZE );
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint( cvf::RenderStatePoint::FIXED_SIZE );
pointRendState->setSize( 5.0f );
eff->setRenderState( pointRendState.p() );
@@ -64,8 +64,7 @@ class RivPipeGeometryGenerator;
class RivExtrudedCurveIntersectionPartMgr : public cvf::Object
{
public:
explicit RivExtrudedCurveIntersectionPartMgr( RimExtrudedCurveIntersection* rimIntersection,
bool isFlattened = false );
explicit RivExtrudedCurveIntersectionPartMgr( RimExtrudedCurveIntersection* rimIntersection, bool isFlattened = false );
void applySingleColorEffect();
void updateCellResultColor( size_t timeStepIndex,
@@ -55,9 +55,7 @@ public:
class RivEclipseIntersectionGrid : public RivIntersectionHexGridInterface
{
public:
RivEclipseIntersectionGrid( const RigMainGrid* mainGrid,
const RigActiveCellInfo* activeCellInfo,
bool showInactiveCells );
RivEclipseIntersectionGrid( const RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool showInactiveCells );
cvf::Vec3d displayOffset() const override;
cvf::BoundingBox boundingBox() const override;
@@ -205,8 +203,7 @@ public:
m_weights[1] = ( (float)( normDistFromE1V1 ) );
}
explicit RivIntersectionVertexWeights( const std::array<size_t, 8>& vxIds,
const std::array<double, 8>& explicitWeights )
explicit RivIntersectionVertexWeights( const std::array<size_t, 8>& vxIds, const std::array<double, 8>& explicitWeights )
: m_count( 8 )
, m_vxIds( vxIds )
{
@@ -159,14 +159,13 @@ 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 )
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 )
{
RigEclipseCaseData* eclipseCaseData = eclipseResDef->eclipseCase()->eclipseCaseData();
@@ -175,10 +174,8 @@ void RivIntersectionResultsColoringTools::updateEclipseCellResultColors(
if ( !RiaDefines::isPerCellFaceResult( eclipseResDef->resultVariable() ) )
{
resultAccessor = RigResultAccessorFactory::createFromResultDefinition( eclipseCaseData,
0,
timeStepIndex,
eclipseResDef );
resultAccessor =
RigResultAccessorFactory::createFromResultDefinition( eclipseCaseData, 0, timeStepIndex, eclipseResDef );
}
if ( resultAccessor.isNull() )
@@ -226,14 +223,13 @@ void RivIntersectionResultsColoringTools::updateEclipseTernaryCellResultColors(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
const RimGeoMechResultDefinition* geomResultDef,
size_t timeStepIndex,
const cvf::ScalarMapper* scalarColorMapper,
bool isLightingDisabled,
const RivIntersectionGeometryGeneratorIF* geomGenerator,
cvf::Part* intersectionFacesPart,
cvf::Vec2fArray* intersectionFacesTextureCoords )
void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors( const RimGeoMechResultDefinition* geomResultDef,
size_t timeStepIndex,
const cvf::ScalarMapper* scalarColorMapper,
bool isLightingDisabled,
const RivIntersectionGeometryGeneratorIF* geomGenerator,
cvf::Part* intersectionFacesPart,
cvf::Vec2fArray* intersectionFacesTextureCoords )
{
RigGeoMechCaseData* caseData = nullptr;
RigFemResultAddress resVarAddress;
@@ -251,9 +247,8 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
if ( resVarAddress.resultPosType == RIG_ELEMENT )
{
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues( resVarAddress,
0,
(int)timeStepIndex );
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues( resVarAddress, 0, (int)timeStepIndex );
RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
resultValues,
@@ -291,9 +286,8 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
}
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues( resVarAddress,
0,
(int)timeStepIndex );
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues( resVarAddress, 0, (int)timeStepIndex );
RigFemPart* femPart = caseData->femParts()->part( 0 );
bool isElementNodalResult = !( resVarAddress.resultPosType == RIG_NODAL );
@@ -353,11 +347,10 @@ void RivIntersectionResultsColoringTools::calculateEclipseTextureCoordinates( cv
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords(
cvf::Vec2fArray* textureCoords,
const std::vector<float>& resultValues,
const std::vector<size_t>& triangleToCellIdx,
const cvf::ScalarMapper* mapper )
void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
const std::vector<float>& resultValues,
const std::vector<size_t>& triangleToCellIdx,
const cvf::ScalarMapper* mapper )
{
textureCoords->resize( triangleToCellIdx.size() * 3 );
@@ -462,13 +455,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( 0, 2 ),
rotMx.rowCol( 1, 2 ),
rotMx.rowCol( 2, 2 ) ) ); // Use Ez from the matrix as plane normal
cvf::Vec3f( rotMx.rowCol( 0, 2 ), rotMx.rowCol( 1, 2 ), 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 )
@@ -82,13 +82,13 @@ private:
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 RigFemPart* femPart,
const cvf::ScalarMapper* mapper );
static void
calculateNodeOrElementNodeBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
const std::vector<float>& resultValues,
bool isElementNodalResult,
const RigFemPart* femPart,
const cvf::ScalarMapper* mapper );
static void calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
const std::vector<float>& resultValues,
@@ -96,8 +96,8 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( const caf::Displa
}
clipLocation = displayCoordTransform->transformToDisplayCoord( clipLocation );
std::vector<cvf::Vec3d> displayCoords = displayCoordTransform->transformToDisplayCoords(
wellPathGeometry()->m_wellPathPoints );
std::vector<cvf::Vec3d> displayCoords =
displayCoordTransform->transformToDisplayCoords( wellPathGeometry()->m_wellPathPoints );
std::vector<cvf::Vec3d> wellPathCurveNormals =
RigWellPathGeometryTools::calculateLineSegmentNormals( displayCoords,
@@ -194,8 +194,8 @@ void Riv3dWellLogCurveGeometryGenerator::createCurveDrawables( const caf::Displa
}
}
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt(
cvf::PrimitiveType::PT_LINES );
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();
@@ -274,8 +274,7 @@ bool Riv3dWellLogCurveGeometryGenerator::findClosestPointOnCurve( const cvf::Vec
closestDistance = distance;
*measuredDepthAtPoint = m_curveMeasuredDepths[i - 1] * ( 1.0 - clampedDistance ) +
m_curveMeasuredDepths[i] * clampedDistance;
*valueAtClosestPoint = m_curveValues[i - 1] * ( 1.0 - clampedDistance ) +
m_curveValues[i] * clampedDistance;
*valueAtClosestPoint = m_curveValues[i - 1] * ( 1.0 - clampedDistance ) + m_curveValues[i] * clampedDistance;
}
}
}
@@ -288,8 +287,7 @@ bool Riv3dWellLogCurveGeometryGenerator::findClosestPointOnCurve( const cvf::Vec
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges(
const std::vector<cvf::Vec3d>& drawSurfaceVertices )
void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongTriangleEdges( const std::vector<cvf::Vec3d>& drawSurfaceVertices )
{
std::vector<cvf::Vec3d> expandedCurveVertices;
std::vector<double> expandedMeasuredDepths;
@@ -366,8 +364,8 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongSegment( const cv
// 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();
@@ -261,8 +261,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::PrimitiveSetIndexedUInt> indexedUInt =
new cvf::PrimitiveSetIndexedUInt( cvf::PrimitiveType::PT_TRIANGLE_STRIP );
cvf::ref<cvf::UIntArray> indexArray = new cvf::UIntArray( backgroundIndices );
indexedUInt->setIndices( indexArray.p() );
@@ -111,8 +111,7 @@ void RivAnnotationsPartMgr::createAnnotationPartManagers()
m_reachCircleAnnotationPartMgrs.push_back( apm );
}
}
if ( m_polylineAnnotationPartMgrs.size() !=
userDefinedPolylineAnnotations.size() + polylineFromFileAnnotations.size() )
if ( m_polylineAnnotationPartMgrs.size() != userDefinedPolylineAnnotations.size() + polylineFromFileAnnotations.size() )
{
for ( auto annotation : userDefinedPolylineAnnotations )
{
@@ -97,8 +97,8 @@ 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 );
}
@@ -138,7 +138,8 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t
{
if ( !( *isWellPipeVisible )[wellIndex] )
{
cellColorTextureCoord += 2.0f; // The shader must interpret values in the range 2-3 as "opaque"
cellColorTextureCoord += 2.0f; // The shader must interpret values in the range 2-3 as
// "opaque"
}
}
}
@@ -159,9 +160,9 @@ 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 ) );
double scalarValue =
cellEdgeResultAccessor->cellFaceScalar( cellIndex,
static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ) );
if ( !hideScalarValue( scalarValue, ignoredScalarValue, 1e-2 ) )
{
@@ -180,8 +181,8 @@ 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 ) ) );
@@ -194,21 +195,19 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo( size_t
bool RivCellEdgeGeometryUtils::hideScalarValue( double scalarValue, double scalarValueToHide, double tolerance )
{
return ( scalarValue == HUGE_VAL ||
cvf::Math::abs( scalarValue - scalarValueToHide ) <= scalarValueToHide * tolerance );
return ( scalarValue == HUGE_VAL || cvf::Math::abs( scalarValue - scalarValueToHide ) <= scalarValueToHide * tolerance );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(
size_t timeStepIndex,
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors,
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
cvf::DrawableGeo* geo,
size_t gridIndex,
float opacityLevel )
void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo( size_t timeStepIndex,
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors,
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
cvf::DrawableGeo* geo,
size_t gridIndex,
float opacityLevel )
{
RigEclipseCaseData* eclipseCase = cellResultColors->reservoirView()->eclipseCase()->eclipseCaseData();
CVF_ASSERT( eclipseCase != nullptr );
@@ -273,9 +272,9 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(
{
float edgeColor = -1.0f; // Undefined texture coord. Shader handles this.
double scalarValue = cellEdgeResultAccessor->cellFaceScalar( cellIndex,
static_cast<cvf::StructGridInterface::FaceType>(
cubeFaceIdx ) );
double scalarValue =
cellEdgeResultAccessor->cellFaceScalar( cellIndex,
static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ) );
if ( !hideScalarValue( scalarValue, ignoredScalarValue, 1e-2 ) )
{
@@ -294,8 +293,8 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(
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,12 +308,11 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<RigResultAccessor>
RivCellEdgeGeometryUtils::createCellEdgeResultAccessor( RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors,
size_t timeStepIndex,
RigEclipseCaseData* eclipseCase,
const RigGridBase* grid )
cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccessor( RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors,
size_t timeStepIndex,
RigEclipseCaseData* eclipseCase,
const RigGridBase* grid )
{
cvf::ref<RigCellEdgeResultAccessor> cellEdgeResultAccessor = new RigCellEdgeResultAccessor();
@@ -328,8 +326,7 @@ cvf::ref<RigResultAccessor>
for ( size_t cubeFaceIdx = 0; cubeFaceIdx < 6; cubeFaceIdx++ )
{
cellEdgeResultAccessor->setDataAccessObjectForFace( static_cast<cvf::StructGridInterface::FaceType>(
cubeFaceIdx ),
cellEdgeResultAccessor->setDataAccessObjectForFace( static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ),
daObj.p() );
}
}
@@ -357,8 +354,7 @@ cvf::ref<RigResultAccessor>
porosityModel,
adjustedTimeStep,
resultAddresses[cubeFaceIdx] );
cellEdgeResultAccessor->setDataAccessObjectForFace( static_cast<cvf::StructGridInterface::FaceType>(
cubeFaceIdx ),
cellEdgeResultAccessor->setDataAccessObjectForFace( static_cast<cvf::StructGridInterface::FaceType>( cubeFaceIdx ),
daObj.p() );
}
}
@@ -24,7 +24,8 @@ enum RivCellSetEnum
OVERRIDDEN_CELL_VISIBILITY, ////< Use the total visibility from a different case directly
ALL_CELLS,
ACTIVE, ///< All Active cells without ALL_WELL_CELLS
ALL_WELL_CELLS, ///< All cells ever having a connection to a well (Might be inactive cells as well. Wellhead cells typically)
ALL_WELL_CELLS, ///< All cells ever having a connection to a well (Might be inactive cells as well. Wellhead cells
///< typically)
VISIBLE_WELL_CELLS, ///< ALL_WELL_CELLS && visible well cells (including Fence <-- is this correct? MSJ/JJS )
VISIBLE_WELL_FENCE_CELLS, ///< (! ALL_WELL_CELLS) && visible well cells including Fence
INACTIVE, ///< All inactive cells, but invalid cells might or might not be included
@@ -33,7 +34,8 @@ enum RivCellSetEnum
RANGE_FILTERED_WELL_CELLS, ///< ALL_WELL_CELLS Filtered by the set of range filters
VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER, ///< VISIBLE_WELL_CELLS && !RANGE_FILTERED_WELL_CELLS
VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER, ///< VISIBLE_WELL_FENCE_CELLS && !RANGE_FILTERED
PROPERTY_FILTERED, ///< (RANGE_FILTERED || VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER) && !ExcludedByPropFilter && IncludedByPropFilter
PROPERTY_FILTERED, ///< (RANGE_FILTERED || VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER) && !ExcludedByPropFilter
///< && IncludedByPropFilter
PROPERTY_FILTERED_WELL_CELLS ///< (!(hasActiveRangeFilters || visibleWellCells) && (*ALL_WELL_CELLS)) ||
///< RANGE_FILTERED_WELL_CELLS || VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER
};
@@ -102,8 +102,8 @@ 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] );
cvf::Vec2f textureCoord =
m_contourMapProjection->legendConfig()->scalarMapper()->mapToTextureCoord( values[i] );
textureCoord.y() = 0.0;
( *textureCoords )[i] = textureCoord;
}
@@ -127,9 +127,8 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer
cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
std::vector<std::vector<cvf::BoundingBox>> labelBBoxes;
std::vector<cvf::ref<cvf::Drawable>> labelDrawables = createContourLabels( camera,
displayCoordTransform,
&labelBBoxes );
std::vector<cvf::ref<cvf::Drawable>> labelDrawables =
createContourLabels( camera, displayCoordTransform, &labelBBoxes );
std::vector<std::vector<cvf::ref<cvf::Drawable>>> contourDrawablesForAllLevels =
createContourPolygons( displayCoordTransform, labelBBoxes );
@@ -222,8 +221,8 @@ cvf::ref<cvf::Part>
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() );
@@ -251,9 +250,9 @@ cvf::ref<cvf::Part>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::vector<cvf::ref<cvf::Drawable>>> RivContourMapProjectionPartMgr::createContourPolygons(
const caf::DisplayCoordTransform* displayCoordTransform,
const std::vector<std::vector<cvf::BoundingBox>>& labelBBoxes ) const
std::vector<std::vector<cvf::ref<cvf::Drawable>>>
RivContourMapProjectionPartMgr::createContourPolygons( const caf::DisplayCoordTransform* displayCoordTransform,
const std::vector<std::vector<cvf::BoundingBox>>& labelBBoxes ) const
{
const cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper();
std::vector<double> tickValues;
@@ -355,8 +354,8 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>> RivContourMapProjectionPartMgr
indices.push_back( k );
}
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt(
cvf::PrimitiveType::PT_LINES );
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() );
@@ -435,10 +434,9 @@ 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 );
@@ -499,8 +497,8 @@ std::vector<cvf::ref<cvf::Drawable>>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::DrawableGeo> RivContourMapProjectionPartMgr::createPickPointVisDrawable(
const caf::DisplayCoordTransform* displayCoordTransform ) const
cvf::ref<cvf::DrawableGeo>
RivContourMapProjectionPartMgr::createPickPointVisDrawable( const caf::DisplayCoordTransform* displayCoordTransform ) const
{
std::vector<cvf::Vec3d> pickPointPolygon = m_contourMapProjection->generatePickPointPolygon();
if ( pickPointPolygon.empty() )
@@ -526,8 +524,8 @@ cvf::ref<cvf::DrawableGeo> RivContourMapProjectionPartMgr::createPickPointVisDra
indices.push_back( j );
}
cvf::ref<cvf::PrimitiveSetIndexedUInt> indexedUInt = new cvf::PrimitiveSetIndexedUInt(
cvf::PrimitiveType::PT_LINES );
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() );
@@ -42,8 +42,7 @@ public:
RivContourMapProjectionPartMgr( RimContourMapProjection* contourMapProjection, RimGridView* contourMap );
void createProjectionGeometry();
void appendProjectionToModel( cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform ) const;
void appendProjectionToModel( cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform ) const;
void appendContourLinesToModel( const cvf::Camera* camera,
cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform );
@@ -53,16 +52,14 @@ public:
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 );
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;
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;
@@ -50,9 +50,7 @@ class RivNNCGeometryGenerator;
class RivFaultPartMgr : public cvf::Object
{
public:
RivFaultPartMgr( const RigGridBase* grid,
const RimFaultInViewCollection* rimFaultCollection,
RimFaultInView* rimFault );
RivFaultPartMgr( const RigGridBase* grid, const RimFaultInViewCollection* rimFaultCollection, RimFaultInView* rimFault );
void setCellVisibility( cvf::UByteArray* cellVisibilities );
@@ -94,8 +94,8 @@ void RivFishbonesSubsPartMgr::buildParts( const caf::DisplayCoordTransform* disp
{
for ( size_t lateralIndex : sub.lateralIndices )
{
std::vector<cvf::Vec3d> lateralDomainCoords = m_rimFishbonesSubs->coordsForLateral( sub.subIndex,
lateralIndex );
std::vector<cvf::Vec3d> lateralDomainCoords =
m_rimFishbonesSubs->coordsForLateral( sub.subIndex, lateralIndex );
std::vector<cvf::Vec3d> displayCoords = displayCoordTransform->transformToDisplayCoords( lateralDomainCoords );
@@ -71,10 +71,7 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGridPartMgr::RivGridPartMgr( RivCellSetEnum cellSetType,
RimEclipseCase* eclipseCase,
const RigGridBase* grid,
size_t gridIdx )
RivGridPartMgr::RivGridPartMgr( RivCellSetEnum cellSetType, RimEclipseCase* eclipseCase, const RigGridBase* grid, size_t gridIdx )
: m_surfaceGenerator( grid, RiaRegressionTestRunner::instance()->useOpenMPForGeometryCreation() )
, m_gridIdx( gridIdx )
, m_grid( grid )
@@ -151,8 +151,8 @@ 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;
@@ -74,9 +74,9 @@ void RivNNCGeometryGenerator::computeArrays()
std::vector<cvf::Vec3f> vertices;
std::vector<size_t> triangleToNNC;
const cvf::Vec3d offset = m_offset;
long long numConnections = static_cast<long long>( m_nncIndexes.isNull() ? m_nncData->connections().size()
: m_nncIndexes->size() );
const cvf::Vec3d offset = m_offset;
long long numConnections =
static_cast<long long>( m_nncIndexes.isNull() ? m_nncData->connections().size() : m_nncIndexes->size() );
bool isVisibilityCalcActive = m_cellVisibility.notNull() && m_grid.notNull();
std::vector<RigCell>* allCells = nullptr;
@@ -189,7 +189,8 @@ void RivNNCGeometryGenerator::textureCoordinates( cvf::Vec2fArray*
double cellScalarValue = HUGE_VAL;
size_t resultIndex = ( *m_triangleIndexToNNCIndex )[tIdx];
// The nnc connections can have more connections than reported from Eclipse, clamp the result index to Eclipse Results
// The nnc connections can have more connections than reported from Eclipse, clamp the result index to Eclipse
// Results
if ( resultIndex < nncResultVals->size() )
{
@@ -180,7 +180,8 @@ void RivPipeGeometryGenerator::computeCircle( double radius,
double fLocalNormCoordZ = cvf::Math::sin( angle );
// Compute normal (vector going from center to the point on the circle)
// Do it this way and we can use this normal directly as long as both input orientation vectors are normalized (which they should be)
// Do it this way and we can use this normal directly as long as both input orientation vectors are normalized
// (which they should be)
normal = yDirection * fLocalNormCoordY + zDirection * fLocalNormCoordZ;
normal.normalize();
@@ -725,7 +726,8 @@ void RivPipeGeometryGenerator::updateFilteredPipeCenterCoords()
}
}
// Add the last point, as the above loop will not end the last none-zero segment, but wait for the start of the next valid one.
// Add the last point, as the above loop will not end the last none-zero segment, but wait for the start of the next
// valid one.
m_filteredPipeCenterCoords.push_back( m_originalPipeCenterCoords->get( lastOriginalCoordIdx ) );
@@ -51,8 +51,7 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivPolylineAnnotationPartMgr::RivPolylineAnnotationPartMgr( Rim3dView* view,
RimPolylinesAnnotationInView* annotationInView )
RivPolylineAnnotationPartMgr::RivPolylineAnnotationPartMgr( Rim3dView* view, RimPolylinesAnnotationInView* annotationInView )
: m_rimView( view )
, m_rimAnnotationInView( annotationInView )
{
@@ -138,8 +137,9 @@ void RivPolylineAnnotationPartMgr::buildPolylineAnnotationParts( const caf::Disp
cvf::ref<cvf::DrawableVectors> vectorDrawable;
if ( RiaGuiApplication::instance()->useShaders() )
{
// NOTE: Drawable vectors must be rendered using shaders when the rest of the application is rendered using
// shaders Drawing vectors using fixed function when rest of the application uses shaders causes visual artifacts
// NOTE: Drawable vectors must be rendered using shaders when the rest of the application is rendered
// using shaders Drawing vectors using fixed function when rest of the application uses shaders causes
// visual artifacts
vectorDrawable = new cvf::DrawableVectors( "u_transformationMatrix", "u_color" );
}
else
@@ -25,8 +25,8 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
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 );
@@ -60,9 +60,7 @@ RivReachCircleAnnotationPartMgr::~RivReachCircleAnnotationPartMgr()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransform* displayXf,
bool doFlatten,
double xOffset )
void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransform* displayXf, bool doFlatten, double xOffset )
{
auto rimAnnotation = m_rimAnnotationInView->sourceAnnotation();
clearAllGeometry();
@@ -79,9 +77,9 @@ 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 );
@@ -703,7 +703,8 @@ void RivReservoirViewPartMgr::computeOverriddenCellVisibility( cvf::UByteArray*
for ( int mcIdx = 0; mcIdx < cellCount; ++mcIdx )
{
( *cellVisibility )[lcIdx] |= ( *totCellVisibility )[cellIndicesInMasterCase[mcIdx]]; // If any is visible, show
( *cellVisibility )[lcIdx] |= ( *totCellVisibility )[cellIndicesInMasterCase[mcIdx]]; // If any is visible,
// show
}
#else
@@ -781,8 +782,8 @@ void RivReservoirViewPartMgr::computeRangeVisibility( RivCellSetEnum
if ( geometryType == RANGE_FILTERED_WELL_CELLS )
{
geometryType =
RANGE_FILTERED; // Use the range filtering in the parent grid, not the well cells in the parent grid
geometryType = RANGE_FILTERED; // Use the range filtering in the parent grid, not the well cells in the
// parent grid
}
RivReservoirPartMgr* reservoirGridPartMgr = &m_geometries[geometryType];
@@ -818,10 +819,8 @@ void RivReservoirViewPartMgr::computeRangeVisibility( RivCellSetEnum
if ( hasAdditiveRangeFilters )
{
nativeRangeVisibility = gridCellRangeFilter.isCellVisible( mainGridI,
mainGridJ,
mainGridK,
isInSubGridArea );
nativeRangeVisibility =
gridCellRangeFilter.isCellVisible( mainGridI, mainGridJ, mainGridK, isInSubGridArea );
}
else
{
@@ -829,11 +828,9 @@ void RivReservoirViewPartMgr::computeRangeVisibility( RivCellSetEnum
nativeRangeVisibility = ( *nativeVisibility )[cellIndex];
}
( *cellVisibility )[cellIndex] = ( visibleDueToParentGrid || nativeRangeVisibility ) &&
!gridCellRangeFilter.isCellExcluded( mainGridI,
mainGridJ,
mainGridK,
isInSubGridArea );
( *cellVisibility )[cellIndex] =
( visibleDueToParentGrid || nativeRangeVisibility ) &&
!gridCellRangeFilter.isCellExcluded( mainGridI, mainGridJ, mainGridK, isInSubGridArea );
}
}
}
@@ -75,9 +75,7 @@ public:
// Faults
void appendFaultsStaticGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType );
void appendFaultsDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
RivCellSetEnum geometryType,
size_t frameIndex );
void appendFaultsDynamicGeometryPartsToModel( cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex );
void updateFaultColors( RivCellSetEnum geometryType, size_t timeStepIndex, RimEclipseCellColors* cellResultColors );
void updateFaultCellEdgeResultColor( RivCellSetEnum geometryType,
size_t timeStepIndex,
@@ -103,10 +101,7 @@ public:
private:
void createGeometry( RivCellSetEnum geometryType );
void computeVisibility( cvf::UByteArray* cellVisibility,
RivCellSetEnum geometryType,
RigGridBase* grid,
size_t gridIdx );
void computeVisibility( cvf::UByteArray* cellVisibility, RivCellSetEnum geometryType, RigGridBase* grid, size_t gridIdx );
void createPropertyFilteredNoneWellCellGeometry( size_t frameIndex );
void createPropertyFilteredWellGeometry( size_t frameIndex );
@@ -71,10 +71,8 @@ void RivScalarMapperUtils::applyTernaryTextureResultsToPart( cvf::Part*
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>( part->drawable() );
if ( dg ) dg->setTextureCoordArray( textureCoords );
cvf::ref<cvf::Effect> scalarEffect = RivScalarMapperUtils::createTernaryScalarMapperEffect( mapper,
opacityLevel,
faceCulling,
disableLighting );
cvf::ref<cvf::Effect> scalarEffect =
RivScalarMapperUtils::createTernaryScalarMapperEffect( mapper, opacityLevel, faceCulling, disableLighting );
part->setEffect( scalarEffect.p() );
}
@@ -297,8 +297,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
continue;
}
if ( !virtualPerforationResult->showConnectionFactorsOnClosedConnections() &&
!wResCell->m_isOpen )
if ( !virtualPerforationResult->showConnectionFactorsOnClosedConnections() && !wResCell->m_isOpen )
{
continue;
}
@@ -329,14 +328,16 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor
if ( !completionVizDataItems.empty() )
{
double radius = pipeRadius * virtualPerforationResult->geometryScaleFactor();
radius *= 2.0; // Enlarge the radius slightly to make the connection factor visible if geometry scale factor is set to 1.0
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 );
cvf::ScalarMapper* scalarMapper = virtualPerforationResult->legendConfig()->scalarMapper();
cvf::ref<cvf::Part> part = pbd.m_connectionFactorGeometryGenerator
->createSurfacePart( scalarMapper, eclipseView->isLightingDisabled() );
cvf::ref<cvf::Part> part =
pbd.m_connectionFactorGeometryGenerator->createSurfacePart( scalarMapper,
eclipseView->isLightingDisabled() );
if ( part.notNull() )
{
cvf::ref<RivSimWellConnectionSourceInfo> simWellSourceInfo =
@@ -465,8 +466,8 @@ 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;
@@ -479,7 +480,8 @@ void RivSimWellPipesPartMgr::updatePipeResultColor( size_t frameIndex )
if ( wResFrame.m_isOpen )
{
// Use slightly larger geometry for open wells to avoid z-fighting when two wells are located at the same position
// Use slightly larger geometry for open wells to avoid z-fighting when two wells are located at the
// same position
wellBranch.m_surfacePart->setDrawable( wellBranch.m_largeSurfaceDrawable.p() );
}
@@ -494,8 +496,8 @@ 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() )
{
@@ -107,9 +107,7 @@ cvf::ref<cvf::DrawableGeo> RivSingleCellPartGenerator::createMeshDrawable()
RigFemPart* femPart = m_geoMechCase->geoMechData()->femParts()->part( m_gridIndex );
CVF_ASSERT( femPart );
return RivFemPartGeometryGenerator::createMeshDrawableFromSingleElement( femPart,
m_cellIndex,
m_displayModelOffset );
return RivFemPartGeometryGenerator::createMeshDrawableFromSingleElement( femPart, m_cellIndex, m_displayModelOffset );
}
return nullptr;
@@ -105,13 +105,13 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicL
calculatePrincipalsAndDirections( elmTensors, &elmPrincipals, &elmPrincipalDirections );
std::vector<RivGeoMechPartMgrCache::Key> partKeys = m_rimReservoirView->vizLogic()->keysToVisiblePartMgrs(
(int)frameIndex );
std::vector<RivGeoMechPartMgrCache::Key> partKeys =
m_rimReservoirView->vizLogic()->keysToVisiblePartMgrs( (int)frameIndex );
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 );
@@ -141,8 +141,8 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicL
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 );
@@ -414,10 +414,9 @@ void RivTensorResultPartMgr::createOneColorPerPrincipalScalarMapper( const RimTe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivTensorResultPartMgr::createOneColorPerPrincipalTextureCoords(
cvf::Vec2fArray* textureCoords,
const std::vector<TensorVisualization>& tensorVisualizations,
const cvf::ScalarMapper* mapper )
void RivTensorResultPartMgr::createOneColorPerPrincipalTextureCoords( cvf::Vec2fArray* textureCoords,
const std::vector<TensorVisualization>& tensorVisualizations,
const cvf::ScalarMapper* mapper )
{
CVF_ASSERT( textureCoords );
CVF_ASSERT( mapper );
@@ -146,8 +146,8 @@ 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() );
}
@@ -220,14 +220,14 @@ 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;
}
@@ -57,24 +57,24 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipse
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
cvf::ref<RigResultAccessor> soil = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress(
"SOIL" ) );
cvf::ref<RigResultAccessor> sgas = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress(
"SGAS" ) );
cvf::ref<RigResultAccessor> swat = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress(
"SWAT" ) );
cvf::ref<RigResultAccessor> soil =
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress( "SOIL" ) );
cvf::ref<RigResultAccessor> sgas =
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress( "SGAS" ) );
cvf::ref<RigResultAccessor> swat =
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress( "SWAT" ) );
m_resultAccessor = new RigTernaryResultAccessor();
m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() );
@@ -106,24 +106,24 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipse
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
size_t gridIndex = 0;
cvf::ref<RigResultAccessor> soil = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress(
"SOIL" ) );
cvf::ref<RigResultAccessor> sgas = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress(
"SGAS" ) );
cvf::ref<RigResultAccessor> swat = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress(
"SWAT" ) );
cvf::ref<RigResultAccessor> soil =
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress( "SOIL" ) );
cvf::ref<RigResultAccessor> sgas =
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress( "SGAS" ) );
cvf::ref<RigResultAccessor> swat =
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex,
porosityModel,
resTimeStepIdx,
RigEclipseResultAddress( "SWAT" ) );
m_resultAccessor = new RigTernaryResultAccessor();
m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() );
@@ -83,10 +83,10 @@ 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 );
@@ -21,9 +21,7 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivTextLabelSourceInfo::RivTextLabelSourceInfo( caf::PdmObject* pdmObject,
const cvf::String& text,
const cvf::Vec3f& position )
RivTextLabelSourceInfo::RivTextLabelSourceInfo( caf::PdmObject* pdmObject, const cvf::String& text, const cvf::Vec3f& position )
: RivObjectSourceInfo( pdmObject )
, m_text( text )
, m_positionDisplayCoord( position )
@@ -48,14 +48,11 @@ 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();
@@ -30,9 +30,8 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivWellConnectionFactorGeometryGenerator::RivWellConnectionFactorGeometryGenerator(
std::vector<CompletionVizData>& completionVizData,
float radius )
RivWellConnectionFactorGeometryGenerator::RivWellConnectionFactorGeometryGenerator( std::vector<CompletionVizData>& completionVizData,
float radius )
: m_completionVizData( completionVizData )
, m_radius( radius )
, m_trianglesPerConnection( 0 )
@@ -315,7 +314,8 @@ void RivWellConnectionFactorGeometryGenerator::createSimplifiedStarGeometry( std
float thickness )
{
// Suggested improvement
// As the nodes are duplicated, it will be possible create only vertices and then use DrawableGeo::setFromTriangleVertexArray
// As the nodes are duplicated, it will be possible create only vertices and then use
// DrawableGeo::setFromTriangleVertexArray
auto p0 = cvf::Vec3f::Y_AXIS * thickness;
auto p1 = -p0;
@@ -80,7 +80,8 @@ 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 +104,8 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections;
{
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::wellLogExtractorEclipseCase( m_rimWellPath,
eclipseCase );
RigEclipseWellLogExtractor* extractor =
RiaExtractionTools::wellLogExtractorEclipseCase( m_rimWellPath, eclipseCase );
if ( extractor )
{
wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath();
@@ -192,9 +193,10 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel( cvf::Mod
{
double characteristicCellSize = eclView->ownerCase()->characteristicCellSize();
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
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
m_geometryGenerator = new RivWellConnectionFactorGeometryGenerator( completionVizDataItems, radius );
@@ -203,8 +205,8 @@ 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() );
@@ -67,8 +67,8 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
return;
bool isProducer = ( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RigWellResultFrame::PRODUCER );
bool isProducer =
( m_rimWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == RigWellResultFrame::PRODUCER );
double pipeRadius = m_rimWell->pipeRadius();
cvf::Vec3d wellHeadTop;
@@ -136,8 +136,8 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBas
RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE )
continue;
bool isOtherProducer = ( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType ==
RigWellResultFrame::PRODUCER );
bool isOtherProducer =
( otherWell->simWellData()->wellResultFrame( frameIndex ).m_productionType == RigWellResultFrame::PRODUCER );
{
std::string otherWellName = otherWell->name().toStdString();
@@ -173,10 +173,10 @@ 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 ) );
std::pair<double, double> injProdFluxPairXF =
flowResults->injectorProducerPairFluxes( crossFlowInjectorName,
crossFlowProducerName,
static_cast<int>( frameIndex ) );
const double fluxThreshold = 0.0; // Todo : Needs threshold in Gui
@@ -199,8 +199,8 @@ 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 )
@@ -105,8 +105,8 @@ 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;
@@ -371,8 +371,7 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
m_wellDiskInjectorPart = part;
}
else if ( productionType == RigWellResultFrame::OIL_INJECTOR ||
productionType == RigWellResultFrame::GAS_INJECTOR ||
else if ( productionType == RigWellResultFrame::OIL_INJECTOR || productionType == RigWellResultFrame::GAS_INJECTOR ||
productionType == RigWellResultFrame::WATER_INJECTOR )
{
cvf::GeometryBuilderFaceList builder;
@@ -94,8 +94,8 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* mo
double characteristicCellSize = eclView.ownerCase()->characteristicCellSize();
cvf::Collection<cvf::Part> parts;
RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(
m_rimFracture->fractureTemplate() );
RimStimPlanFractureTemplate* stimPlanFracTemplate =
dynamic_cast<RimStimPlanFractureTemplate*>( m_rimFracture->fractureTemplate() );
if ( stimPlanFracTemplate )
{
@@ -207,9 +207,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel( cvf::ModelBasicList* mo
cvf::Vec3d partTranslation = scaleFactor * cvf::Vec3d( fractureMatrix.col( 2 ) );
RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( model,
containmentMask.p(),
partTranslation );
RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( model, containmentMask.p(), partTranslation );
}
}
}
@@ -372,8 +370,8 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createEllipseSurfacePart( const RimE
if ( activeView.fractureColors()->uiResultName() == RiaDefines::conductivityResultName() )
{
RimEllipseFractureTemplate* ellipseFractureTemplate = dynamic_cast<RimEllipseFractureTemplate*>(
m_rimFracture->fractureTemplate() );
RimEllipseFractureTemplate* ellipseFractureTemplate =
dynamic_cast<RimEllipseFractureTemplate*>( m_rimFracture->fractureTemplate() );
if ( ellipseFractureTemplate )
{
double conductivity = ellipseFractureTemplate->conductivity();
@@ -400,8 +398,8 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createEllipseSurfacePart( const RimE
cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanColorInterpolatedSurfacePart( const RimEclipseView& activeView )
{
CVF_ASSERT( m_rimFracture );
RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(
m_rimFracture->fractureTemplate() );
RimStimPlanFractureTemplate* stimPlanFracTemplate =
dynamic_cast<RimStimPlanFractureTemplate*>( m_rimFracture->fractureTemplate() );
CVF_ASSERT( stimPlanFracTemplate );
auto displayCoordTransform = activeView.displayCoordTransform();
@@ -496,10 +494,8 @@ 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;
}
@@ -541,8 +537,8 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createSingleColorSurfacePart( const
cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanElementColorSurfacePart( const RimEclipseView& activeView )
{
CVF_ASSERT( m_rimFracture );
RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(
m_rimFracture->fractureTemplate() );
RimStimPlanFractureTemplate* stimPlanFracTemplate =
dynamic_cast<RimStimPlanFractureTemplate*>( m_rimFracture->fractureTemplate() );
CVF_ASSERT( stimPlanFracTemplate );
if ( !stimPlanFracTemplate->fractureGrid() ) return nullptr;
@@ -608,10 +604,9 @@ 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,10 +633,8 @@ 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;
}
@@ -682,8 +675,8 @@ 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 )
{
@@ -850,9 +843,8 @@ 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;
@@ -975,8 +967,8 @@ void RivWellFracturePartMgr::appendFracturePerforationLengthParts( const RimEcli
}
}
std::vector<cvf::Vec3d> displayCoords = displayCoordTransform->transformToDisplayCoords(
m_rimFracture->perforationLengthCenterLineCoords() );
std::vector<cvf::Vec3d> displayCoords =
displayCoordTransform->transformToDisplayCoords( m_rimFracture->perforationLengthCenterLineCoords() );
if ( !displayCoords.empty() )
{
@@ -1005,8 +997,8 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createStimPlanMeshPart( const RimEcl
{
if ( !m_rimFracture->fractureTemplate() ) return nullptr;
RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(
m_rimFracture->fractureTemplate() );
RimStimPlanFractureTemplate* stimPlanFracTemplate =
dynamic_cast<RimStimPlanFractureTemplate*>( m_rimFracture->fractureTemplate() );
if ( !stimPlanFracTemplate ) return nullptr;
cvf::ref<cvf::DrawableGeo> stimPlanMeshGeo = createStimPlanMeshDrawable( stimPlanFracTemplate, activeView );
@@ -1073,10 +1065,9 @@ cvf::ref<cvf::DrawableGeo>
return nullptr;
}
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
std::vector<cvf::Vec3f> stimPlanMeshVerticesDisplayCoords = transformToFractureDisplayCoords( stimPlanMeshVertices,
fractureXf,
*displayCoordTransform );
cvf::Mat4d fractureXf = m_rimFracture->transformMatrix();
std::vector<cvf::Vec3f> stimPlanMeshVerticesDisplayCoords =
transformToFractureDisplayCoords( stimPlanMeshVertices, fractureXf, *displayCoordTransform );
cvf::Vec3fArray* stimPlanMeshVertexList;
stimPlanMeshVertexList = new cvf::Vec3fArray;
@@ -1188,8 +1179,7 @@ void RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation( cvf::Model
const cvf::Vec3d& translation )
{
{
cvf::ref<cvf::Transform> partTransform = RivWellFracturePartMgr::createLocalTransformFromTranslation(
translation );
cvf::ref<cvf::Transform> partTransform = RivWellFracturePartMgr::createLocalTransformFromTranslation( translation );
part->setTransform( partTransform.p() );
model->addPart( part );
@@ -1199,8 +1189,8 @@ 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() );
@@ -178,8 +178,8 @@ 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 )
{
@@ -53,10 +53,7 @@ public:
double xOffset );
private:
void buildWellHeadParts( size_t frameIndex,
const caf::DisplayCoordTransform* displayXf,
bool doFlatten,
double xOffset );
void buildWellHeadParts( size_t frameIndex, const caf::DisplayCoordTransform* displayXf, bool doFlatten, double xOffset );
void clearAllGeometry();
Rim3dView* viewWithSettings();
RimSimWellInViewCollection* simWellInViewCollection();
@@ -359,8 +359,8 @@ void RivWellPathPartMgr::appendImportedFishbonesToModel( cvf::ModelBasicList*
{
if ( !fbWellPath->isChecked() ) continue;
std::vector<cvf::Vec3d> displayCoords = displayCoordTransform->transformToDisplayCoords(
fbWellPath->coordinates() );
std::vector<cvf::Vec3d> displayCoords =
displayCoordTransform->transformToDisplayCoords( fbWellPath->coordinates() );
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo( fbWellPath );
@@ -469,10 +469,7 @@ void RivWellPathPartMgr::appendPerforationsToModel( cvf::ModelBasicList*
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo( perforation );
cvf::Collection<cvf::Part> parts;
geoGenerator.cylinderWithCenterLineParts( &parts,
perfIntervalCLDiplayCS,
cvf::Color3f::GREEN,
perforationRadius );
geoGenerator.cylinderWithCenterLineParts( &parts, perfIntervalCLDiplayCS, cvf::Color3f::GREEN, perforationRadius );
for ( auto part : parts )
{
part->setSourceInfo( objectSourceInfo.p() );
@@ -610,11 +607,12 @@ 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 );
}
@@ -732,8 +730,7 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d
cvf::Vec3d textPosition = cvfCoords->get( 0 );
textPosition.z() += 2.2 * characteristicCellSize;
if ( wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() &&
!m_rimWellPath->name().isEmpty() )
if ( wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() && !m_rimWellPath->name().isEmpty() )
{
cvf::Font* font = RiaGuiApplication::instance()->defaultWellLabelFont();
@@ -103,12 +103,10 @@ void RivWellPathSourceInfo::normalizedIntersection( size_t triangleIn
cvf::Vec3d segmentStart = rigWellPath->m_wellPathPoints[segIndex];
cvf::Vec3d segmentEnd = rigWellPath->m_wellPathPoints[segIndex + 1];
double norm = 0.0;
cvf::Vec3d pointOnLine = cvf::GeometryTools::projectPointOnLine( segmentStart,
segmentEnd,
globalIntersectionInDomain,
&norm );
norm = cvf::Math::clamp( norm, 0.0, 1.0 );
double norm = 0.0;
cvf::Vec3d pointOnLine =
cvf::GeometryTools::projectPointOnLine( segmentStart, segmentEnd, globalIntersectionInDomain, &norm );
norm = cvf::Math::clamp( norm, 0.0, 1.0 );
*firstSegmentIndex = segIndex;
*normalizedSegmentIntersection = norm;
@@ -138,8 +138,9 @@ cvf::ref<cvf::Part> RivWellSpheresPartMgr::createPart( std::vector<std::pair<cvf
cvf::ref<cvf::DrawableVectors> vectorDrawable;
if ( RiaGuiApplication::instance()->useShaders() )
{
// NOTE: Drawable vectors must be rendered using shaders when the rest of the application is rendered using shaders
// Drawing vectors using fixed function when rest of the application uses shaders causes visual artifacts
// NOTE: Drawable vectors must be rendered using shaders when the rest of the application is rendered using
// shaders Drawing vectors using fixed function when rest of the application uses shaders causes visual
// artifacts
vectorDrawable = new cvf::DrawableVectors( "u_transformationMatrix", "u_color" );
}
else
@@ -174,8 +175,8 @@ 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() );
}
@@ -216,11 +216,12 @@ 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;
@@ -198,8 +198,7 @@ void RivSurfacePartMgr::updateCellResultColor( size_t timeStepIndex )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivSurfacePartMgr::appendIntersectionGeometryPartsToModel( cvf::ModelBasicList* model,
cvf::Transform* scaleTransform )
void RivSurfacePartMgr::appendIntersectionGeometryPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
{
if ( m_intersectionFaces.isNull() )
{
@@ -306,8 +305,8 @@ void RivSurfacePartMgr::generatePartGeometry()
part->setDrawable( geo.p() );
// Set mapping from triangle face index to cell index
cvf::ref<RivReservoirSurfaceIntersectionSourceInfo> si = new RivReservoirSurfaceIntersectionSourceInfo(
m_intersectionGenerator.p() );
cvf::ref<RivReservoirSurfaceIntersectionSourceInfo> si =
new RivReservoirSurfaceIntersectionSourceInfo( m_intersectionGenerator.p() );
part->setSourceInfo( si.p() );
part->updateBoundingBox();
@@ -522,8 +522,7 @@ void RivWindowEdgeAxesOverlayItem::renderSoftwareFrameAndTickLines( OpenGLContex
//--------------------------------------------------------------------------------------------------
/// Draw the frame using shader programs
//--------------------------------------------------------------------------------------------------
void RivWindowEdgeAxesOverlayItem::renderShaderFrameAndTickLines( OpenGLContext* oglContext,
const MatrixState& matrixState )
void RivWindowEdgeAxesOverlayItem::renderShaderFrameAndTickLines( OpenGLContext* oglContext, const MatrixState& matrixState )
{
CVF_CALLSITE_OPENGL( oglContext );