mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6033 Surface Properties : Add result selection object
This commit is contained in:
@@ -55,3 +55,40 @@ void RigSurface::setTriangleData( const std::vector<unsigned>& tringleIndices, c
|
||||
m_triangleIndices = tringleIndices;
|
||||
m_vertices = vertices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigSurface::addVerticeResult( const QString resultName, const std::vector<float>& resultValues )
|
||||
{
|
||||
m_verticeResults[resultName] = resultValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<float> RigSurface::propertyValues( const QString& propertyName ) const
|
||||
{
|
||||
auto it = m_verticeResults.find( propertyName );
|
||||
if ( it != m_verticeResults.end() )
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RigSurface::propertyNames() const
|
||||
{
|
||||
std::vector<QString> names;
|
||||
|
||||
for ( const auto& propertyResult : m_verticeResults )
|
||||
{
|
||||
names.push_back( propertyResult.first );
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
@@ -35,10 +35,13 @@ public:
|
||||
const std::vector<cvf::Vec3d>& vertices();
|
||||
|
||||
void setTriangleData( const std::vector<unsigned>& tringleIndices, const std::vector<cvf::Vec3d>& vertices );
|
||||
void addVerticeResult( const QString resultName, const std::vector<double>& resultValues );
|
||||
void addVerticeResult( const QString resultName, const std::vector<float>& resultValues );
|
||||
|
||||
std::vector<float> propertyValues( const QString& propertyName ) const;
|
||||
std::vector<QString> propertyNames() const;
|
||||
|
||||
private:
|
||||
std::vector<unsigned> m_triangleIndices;
|
||||
std::vector<cvf::Vec3d> m_vertices;
|
||||
std::map<QString, std::vector<double>> m_verticeResults;
|
||||
std::vector<unsigned> m_triangleIndices;
|
||||
std::vector<cvf::Vec3d> m_vertices;
|
||||
std::map<QString, std::vector<float>> m_verticeResults;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user