mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add seismic 3d view (#10472)
* Show seismic, surfaces, annotations and wellpaths in new view not requiring a grid loaded first.
This commit is contained in:
@@ -49,18 +49,30 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivSurfacePartMgr::RivSurfacePartMgr( RimSurfaceInView* surface )
|
||||
RivSurfacePartMgr::RivSurfacePartMgr( RimSurfaceInView* surface, bool nativeOnly )
|
||||
: m_surfaceInView( surface )
|
||||
, m_useNativePartsOnly( nativeOnly )
|
||||
{
|
||||
CVF_ASSERT( surface );
|
||||
|
||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = m_surfaceInView->createHexGridInterface();
|
||||
m_intersectionGenerator = new RivSurfaceIntersectionGeometryGenerator( m_surfaceInView, hexGrid.p() );
|
||||
if ( !nativeOnly )
|
||||
{
|
||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = m_surfaceInView->createHexGridInterface();
|
||||
m_intersectionGenerator = new RivSurfaceIntersectionGeometryGenerator( m_surfaceInView, hexGrid.p() );
|
||||
}
|
||||
|
||||
m_intersectionFacesTextureCoords = new cvf::Vec2fArray;
|
||||
m_nativeTrianglesTextureCoords = new cvf::Vec2fArray;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivSurfacePartMgr::isNativePartMgr() const
|
||||
{
|
||||
return m_useNativePartsOnly;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -369,8 +381,9 @@ void RivSurfacePartMgr::generatePartGeometry()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivSurfacePartMgr::generateNativePartGeometry()
|
||||
{
|
||||
auto ownerCase = m_surfaceInView->firstAncestorOrThisOfTypeAsserted<RimCase>();
|
||||
cvf::Vec3d displayModOffsett = ownerCase->displayModelOffset();
|
||||
cvf::Vec3d displayModOffset( 0, 0, 0 );
|
||||
auto ownerCase = m_surfaceInView->firstAncestorOrThisOfType<RimCase>();
|
||||
if ( ownerCase ) displayModOffset = ownerCase->displayModelOffset();
|
||||
|
||||
m_usedSurfaceData = m_surfaceInView->surface()->surfaceData();
|
||||
if ( m_usedSurfaceData.isNull() ) return;
|
||||
@@ -381,7 +394,7 @@ void RivSurfacePartMgr::generateNativePartGeometry()
|
||||
cvf::ref<cvf::Vec3fArray> cvfVertices = new cvf::Vec3fArray( vertices.size() );
|
||||
for ( size_t i = 0; i < vertices.size(); ++i )
|
||||
{
|
||||
( *cvfVertices )[i] = cvf::Vec3f( vertices[i] - displayModOffsett );
|
||||
( *cvfVertices )[i] = cvf::Vec3f( vertices[i] - displayModOffset );
|
||||
}
|
||||
|
||||
const std::vector<unsigned>& triangleIndices = m_usedSurfaceData->triangleIndices();
|
||||
|
||||
Reference in New Issue
Block a user