2018-01-10 10:43:33 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2019-01-09 15:21:38 +01:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-01-10 10:43:33 +01:00
|
|
|
//
|
|
|
|
|
// 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 "RifElementPropertyTableReader.h"
|
|
|
|
|
|
|
|
|
|
#include "cvfBase.h"
|
|
|
|
|
#include "cvfObject.h"
|
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
#include <string>
|
2018-01-12 11:21:59 +01:00
|
|
|
#include <unordered_map>
|
2018-01-10 10:43:33 +01:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
class RifElementPropertyReader : public cvf::Object
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-01-12 11:21:59 +01:00
|
|
|
RifElementPropertyReader(const std::vector<int>& elementIdxToId);
|
2018-10-18 19:45:57 +02:00
|
|
|
~RifElementPropertyReader() override;
|
2018-01-10 10:43:33 +01:00
|
|
|
|
|
|
|
|
void addFile(const std::string& fileName);
|
2018-01-12 16:18:54 +01:00
|
|
|
void removeFile(const std::string& fileName);
|
2018-01-10 10:43:33 +01:00
|
|
|
|
2018-01-15 17:40:39 +01:00
|
|
|
std::vector<std::string> scalarElementFields() const;
|
2018-01-10 10:43:33 +01:00
|
|
|
|
|
|
|
|
std::map<std::string, std::vector<float>> readAllElementPropertiesInFileContainingField(const std::string& fieldName);
|
|
|
|
|
|
2018-01-13 12:38:08 +01:00
|
|
|
std::vector<std::string> fieldsInFile(const std::string& fileName) const;
|
|
|
|
|
|
2018-01-10 10:43:33 +01:00
|
|
|
private:
|
2018-01-12 11:21:59 +01:00
|
|
|
void makeElementIdToIdxMap();
|
|
|
|
|
static void outputWarningAboutWrongFileData();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::map<std::string, RifElementPropertyMetadata> m_fieldsMetaData;
|
|
|
|
|
std::vector<int> m_elementIdxToId;
|
|
|
|
|
std::unordered_map<int, int> m_elementIdToIdx;
|
2018-01-10 10:43:33 +01:00
|
|
|
};
|