Exported coordinate fix (#11283)

Make sure exported well path coordinates use local coord system when needed.
This commit is contained in:
jonjenssen
2024-03-12 16:57:16 +01:00
committed by GitHub
parent f411b5fabe
commit cb1e062e99
6 changed files with 27 additions and 1 deletions

View File

@@ -139,6 +139,15 @@ std::pair<cvf::Vec3d, cvf::Vec3d> RigFaultReactivationModel::modelLocalNormalsXY
return m_generator->modelLocalNormalsXY();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RigFaultReactivationModel::transformPointIfNeeded( const cvf::Vec3d point ) const
{
if ( m_generator.get() == nullptr ) return point;
return m_generator->transformPointIfNeeded( point );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -69,6 +69,7 @@ public:
void setGenerator( std::shared_ptr<RigFaultReactivationModelGenerator> generator );
std::pair<cvf::Vec3d, cvf::Vec3d> modelLocalNormalsXY() const;
cvf::Vec3d transformPointIfNeeded( const cvf::Vec3d point ) const;
void updateGeometry( size_t startCell, cvf::StructGridInterface::FaceType startFace );

View File

@@ -167,6 +167,16 @@ void RigFaultReactivationModelGenerator::setupLocalCoordinateTransform()
m_localCoordTransform.setTranslation( center );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RigFaultReactivationModelGenerator::transformPointIfNeeded( const cvf::Vec3d point ) const
{
if ( !m_useLocalCoordinates ) return point;
return point.getTransformedPoint( m_localCoordTransform );
}
//--------------------------------------------------------------------------------------------------
/// change corner order to be consistent so that index (0,1) and (2,3) gives the lower and upper horz. lines no matter what I or J face we
/// have

View File

@@ -58,6 +58,8 @@ public:
void setUseLocalCoordinates( bool useLocalCoordinates );
void setupLocalCoordinateTransform();
cvf::Vec3d transformPointIfNeeded( const cvf::Vec3d point ) const;
std::pair<cvf::Vec3d, cvf::Vec3d> modelLocalNormalsXY();
void generateGeometry( size_t startCellIndex, FaceType startFace, RigGriddedPart3d* frontPart, RigGriddedPart3d* backPart );