#6033 Surface Properties : Add result selection object

This commit is contained in:
Magne Sjaastad
2020-06-10 10:31:43 +02:00
parent b2444568be
commit 0799a9cf83
8 changed files with 293 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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;
};