ResInsight/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTableTools.h
Jørgen Herje 342f191288
Add filtering/exclude of rows in SummaryTable (#10193)
- Add selector for excluding rows in table
- Row selection is based on category, vector, threshold
- Move data containers to utils class
- TreeSelectionEditor: Add context menu to invert selection
- Improved naming of menu items
- Guard plotDefinition before connect signal/slots

---------

Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
2023-05-02 11:18:45 +02:00

54 lines
1.8 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// 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 <QString>
#include <set>
#include <vector>
namespace RimSummaryTableTools
{
// Struct for storing vector data
struct VectorData
{
QString category;
QString name;
std::vector<double> values;
time_t firstTimeStep;
time_t lastTimeStep;
};
// Struct for storing table data
struct TableData
{
std::vector<VectorData> vectorDataCollection;
std::set<time_t> timeStepsUnion;
double maxValue = 0.0;
double minValue = 0.0;
double thresholdValue = 0.0;
QString unitName;
};
bool hasValueAboveThreshold( const std::vector<double>& values, double thresholdValue );
std::vector<VectorData> vectorsAboveThreshold( const std::vector<VectorData>& vectorDataCollection, double thresholdValue );
void sortVectorDataOnDate( TableData& rTableData );
std::vector<QString> categoryNames( const std::vector<VectorData>& vectorDataCollection );
} // namespace RimSummaryTableTools