mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Surface Import : import of properties from TS files #5995
This commit is contained in:
committed by
Magne Sjaastad
parent
66037da9d5
commit
e5f3a3b67d
@@ -78,6 +78,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigGocadData.h
|
||||
)
|
||||
|
||||
|
||||
@@ -153,6 +154,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigGocadData.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
92
ApplicationCode/ReservoirDataModel/RigGocadData.cpp
Normal file
92
ApplicationCode/ReservoirDataModel/RigGocadData.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 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 "RigGocadData.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGocadData::RigGocadData()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGocadData::~RigGocadData()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RigGocadData::propertyNames()
|
||||
{
|
||||
return m_propertyNames;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RigGocadData::gocadGeometry()
|
||||
{
|
||||
return std::make_pair( m_vertices, m_tringleIndices );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<float> RigGocadData::propertyValues( const QString& property )
|
||||
{
|
||||
size_t propertyIdx = 0;
|
||||
|
||||
for ( propertyIdx = 0; propertyIdx < m_propertyNames.size(); propertyIdx++ )
|
||||
{
|
||||
if ( m_propertyNames[propertyIdx] == property ) break;
|
||||
}
|
||||
|
||||
std::vector<float> propValues;
|
||||
|
||||
propValues.reserve( m_propertyValues.size() );
|
||||
|
||||
for ( size_t i = 0; i < m_propertyValues.size(); i++ )
|
||||
{
|
||||
propValues.push_back( m_propertyValues[i][propertyIdx] );
|
||||
}
|
||||
|
||||
return propValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGocadData::setGeometryData( const std::vector<cvf::Vec3d>& nodeCoord, const std::vector<unsigned>& connectivities )
|
||||
{
|
||||
m_vertices = nodeCoord;
|
||||
m_tringleIndices = connectivities;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGocadData::addPropertyData( const std::vector<QString>& propertyNames,
|
||||
std::vector<std::vector<float>>& propertyValues )
|
||||
{
|
||||
m_propertyNames = propertyNames;
|
||||
m_propertyValues = propertyValues;
|
||||
}
|
||||
44
ApplicationCode/ReservoirDataModel/RigGocadData.h
Normal file
44
ApplicationCode/ReservoirDataModel/RigGocadData.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 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 <QString>
|
||||
#include <vector>
|
||||
|
||||
#include "cvfVector3.h"
|
||||
|
||||
class RigGocadData
|
||||
{
|
||||
public:
|
||||
RigGocadData();
|
||||
~RigGocadData();
|
||||
|
||||
std::vector<QString> propertyNames();
|
||||
std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> gocadGeometry();
|
||||
std::vector<float> propertyValues( const QString& property );
|
||||
|
||||
void setGeometryData( const std::vector<cvf::Vec3d>& nodeCoord, const std::vector<unsigned>& connectivities );
|
||||
void addPropertyData( const std::vector<QString>& propertyNames, std::vector<std::vector<float>>& propertyValues );
|
||||
|
||||
private:
|
||||
std::vector<cvf::Vec3d> m_vertices;
|
||||
std::vector<unsigned> m_tringleIndices;
|
||||
std::vector<QString> m_propertyNames;
|
||||
std::vector<std::vector<float>> m_propertyValues;
|
||||
};
|
||||
Reference in New Issue
Block a user