mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Basic seismic support (#10010)
Add basic seismic section support to eclipse and geomech views.
This commit is contained in:
@@ -86,6 +86,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigTexturedSection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigPressureDepthData.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigMswCenterLineCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellAllocationOverTime.h
|
||||
@@ -172,6 +173,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigTexturedSection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigPressureDepthData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigMswCenterLineCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellAllocationOverTime.cpp
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 equinor ASA
|
||||
// Copyright (C) 2018 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
||||
141
ApplicationLibCode/ReservoirDataModel/RigTexturedSection.cpp
Normal file
141
ApplicationLibCode/ReservoirDataModel/RigTexturedSection.cpp
Normal file
@@ -0,0 +1,141 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigTexturedSection.h"
|
||||
|
||||
#include "cvfTextureImage.h"
|
||||
|
||||
#include <zgyaccess/seismicslice.h>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigTexturedSection::RigTexturedSection()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigTexturedSection::~RigTexturedSection()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigTexturedSection::setWhatToUpdate( WhatToUpdateEnum updateInfo, int index /*=-1*/ )
|
||||
{
|
||||
int start = index;
|
||||
int stop = index + 1;
|
||||
|
||||
if ( index < 0 )
|
||||
{
|
||||
start = 0;
|
||||
stop = m_sectionParts.size();
|
||||
}
|
||||
|
||||
for ( int i = start; i < stop; i++ )
|
||||
{
|
||||
switch ( updateInfo )
|
||||
{
|
||||
case RigTexturedSection::WhatToUpdateEnum::UPDATE_ALL:
|
||||
case RigTexturedSection::WhatToUpdateEnum::UPDATE_GEOMETRY:
|
||||
m_sectionParts[i].isRectValid = false;
|
||||
m_sectionParts[i].rect.clear();
|
||||
[[fallthrough]];
|
||||
case RigTexturedSection::WhatToUpdateEnum::UPDATE_DATA:
|
||||
m_sectionParts[i].sliceData = nullptr;
|
||||
[[fallthrough]];
|
||||
case RigTexturedSection::WhatToUpdateEnum::UPDATE_TEXTURE:
|
||||
m_sectionParts[i].texture = nullptr;
|
||||
[[fallthrough]];
|
||||
case RigTexturedSection::WhatToUpdateEnum::UPDATE_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigTexturedSection::isValid() const
|
||||
{
|
||||
if ( m_sectionParts.size() == 0 ) return false;
|
||||
|
||||
bool valid = true;
|
||||
|
||||
for ( int i = 0; i < (int)m_sectionParts.size(); i++ )
|
||||
{
|
||||
valid = valid && m_sectionParts[i].allDataValid();
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RigTexturedSection::partsCount() const
|
||||
{
|
||||
return m_sectionParts.size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigTexturedSection::resize( int size )
|
||||
{
|
||||
m_sectionParts.resize( size );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigTexturedSectionPart& RigTexturedSection::part( int index )
|
||||
{
|
||||
CVF_ASSERT( index < (int)m_sectionParts.size() );
|
||||
return m_sectionParts[index];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigTexturedSection::setSectionPartRect( int index, cvf::Vec3dArray rect )
|
||||
{
|
||||
if ( index >= (int)m_sectionParts.size() )
|
||||
{
|
||||
resize( index + 1 );
|
||||
}
|
||||
|
||||
m_sectionParts[index].rect = rect;
|
||||
m_sectionParts[index].isRectValid = true;
|
||||
m_sectionParts[index].sliceData = nullptr;
|
||||
m_sectionParts[index].texture = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigTexturedSection::setSectionPartData( int index, std::shared_ptr<ZGYAccess::SeismicSliceData> data )
|
||||
{
|
||||
if ( index >= (int)m_sectionParts.size() ) return;
|
||||
m_sectionParts[index].sliceData = data;
|
||||
m_sectionParts[index].texture = nullptr;
|
||||
}
|
||||
88
ApplicationLibCode/ReservoirDataModel/RigTexturedSection.h
Normal file
88
ApplicationLibCode/ReservoirDataModel/RigTexturedSection.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023 Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfArray.h"
|
||||
#include "cvfColor3.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace ZGYAccess
|
||||
{
|
||||
class SeismicSliceData;
|
||||
}
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class TextureImage;
|
||||
}
|
||||
|
||||
class RigTexturedSectionPart
|
||||
{
|
||||
public:
|
||||
RigTexturedSectionPart()
|
||||
: isRectValid( false ){};
|
||||
~RigTexturedSectionPart(){};
|
||||
|
||||
bool allDataValid() const { return isRectValid && ( sliceData != nullptr ) && texture.notNull(); };
|
||||
|
||||
public:
|
||||
cvf::Vec3dArray rect;
|
||||
bool isRectValid;
|
||||
std::shared_ptr<ZGYAccess::SeismicSliceData> sliceData;
|
||||
cvf::ref<cvf::TextureImage> texture;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigTexturedSection : public cvf::Object
|
||||
{
|
||||
public:
|
||||
enum class WhatToUpdateEnum
|
||||
{
|
||||
UPDATE_NONE = 0,
|
||||
UPDATE_TEXTURE = 1,
|
||||
UPDATE_GEOMETRY = 2,
|
||||
UPDATE_DATA = 3,
|
||||
UPDATE_ALL = 4
|
||||
};
|
||||
|
||||
public:
|
||||
RigTexturedSection();
|
||||
~RigTexturedSection() override;
|
||||
|
||||
void setWhatToUpdate( WhatToUpdateEnum updateInfo, int index = -1 );
|
||||
bool isValid() const;
|
||||
|
||||
void setSectionPartRect( int index, cvf::Vec3dArray rect );
|
||||
void setSectionPartData( int index, std::shared_ptr<ZGYAccess::SeismicSliceData> data );
|
||||
|
||||
int partsCount() const;
|
||||
void resize( int size );
|
||||
|
||||
RigTexturedSectionPart& part( int index );
|
||||
|
||||
private:
|
||||
std::vector<RigTexturedSectionPart> m_sectionParts;
|
||||
};
|
||||
Reference in New Issue
Block a user