2015-05-08 10:34:57 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
|
|
|
|
//
|
|
|
|
|
// 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 "RigFemResultPosEnum.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
|
|
|
|
|
class RigFemResultAddress
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-01-15 14:48:00 +01:00
|
|
|
RigFemResultAddress()
|
|
|
|
|
{
|
|
|
|
|
resultPosType = RIG_NODAL;
|
|
|
|
|
fieldName = "";
|
|
|
|
|
componentName = "";
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-27 15:01:21 +02:00
|
|
|
RigFemResultAddress(RigFemResultPosEnum resPosType,
|
|
|
|
|
const std::string& aFieldName,
|
|
|
|
|
const std::string& aComponentName,
|
2018-02-15 10:58:13 +01:00
|
|
|
int timeLapseBaseFrameIdx = NO_TIME_LAPSE,
|
|
|
|
|
int refKLayerIndex = NO_COMPACTION)
|
2016-10-27 15:01:21 +02:00
|
|
|
: resultPosType(resPosType),
|
|
|
|
|
fieldName(aFieldName),
|
|
|
|
|
componentName(aComponentName),
|
2018-02-15 10:58:13 +01:00
|
|
|
timeLapseBaseFrameIdx(timeLapseBaseFrameIdx),
|
|
|
|
|
refKLayerIndex(refKLayerIndex)
|
2016-10-27 15:01:21 +02:00
|
|
|
{
|
|
|
|
|
}
|
2015-05-08 10:34:57 +02:00
|
|
|
|
|
|
|
|
RigFemResultPosEnum resultPosType;
|
2016-12-16 09:41:22 +01:00
|
|
|
std::string fieldName;
|
|
|
|
|
std::string componentName;
|
|
|
|
|
int timeLapseBaseFrameIdx;
|
2018-02-15 10:58:13 +01:00
|
|
|
int refKLayerIndex;
|
2016-10-10 16:09:54 +02:00
|
|
|
|
2016-10-27 15:01:21 +02:00
|
|
|
static const int ALL_TIME_LAPSES = -2;
|
2018-02-15 10:58:13 +01:00
|
|
|
static const int NO_TIME_LAPSE = -1;
|
|
|
|
|
static const int NO_COMPACTION = -1;
|
2016-10-27 15:01:21 +02:00
|
|
|
|
2018-02-15 10:58:13 +01:00
|
|
|
bool isTimeLapse() const { return timeLapseBaseFrameIdx > NO_TIME_LAPSE;}
|
2016-10-27 15:01:21 +02:00
|
|
|
bool representsAllTimeLapses() const { return timeLapseBaseFrameIdx == ALL_TIME_LAPSES;}
|
2015-05-08 10:34:57 +02:00
|
|
|
|
2015-06-09 16:18:11 +02:00
|
|
|
bool isValid() const
|
|
|
|
|
{
|
|
|
|
|
bool isTypeValid = resultPosType == RIG_NODAL
|
|
|
|
|
|| resultPosType == RIG_ELEMENT_NODAL
|
2016-09-06 10:27:30 +02:00
|
|
|
|| resultPosType == RIG_INTEGRATION_POINT
|
2016-10-19 12:22:13 +02:00
|
|
|
|| resultPosType == RIG_ELEMENT_NODAL_FACE
|
2018-01-09 08:46:52 +01:00
|
|
|
|| resultPosType == RIG_FORMATION_NAMES
|
|
|
|
|
|| resultPosType == RIG_ELEMENT;
|
2015-06-09 16:18:11 +02:00
|
|
|
bool isFieldValid = fieldName != "";
|
2016-10-10 16:09:54 +02:00
|
|
|
|
2015-06-09 16:18:11 +02:00
|
|
|
return isTypeValid && isFieldValid;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-08 10:34:57 +02:00
|
|
|
bool operator< (const RigFemResultAddress& other ) const
|
|
|
|
|
{
|
2016-10-10 16:09:54 +02:00
|
|
|
if (timeLapseBaseFrameIdx != other.timeLapseBaseFrameIdx)
|
|
|
|
|
{
|
|
|
|
|
return (timeLapseBaseFrameIdx < other.timeLapseBaseFrameIdx);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-08 10:34:57 +02:00
|
|
|
if (resultPosType != other.resultPosType)
|
|
|
|
|
{
|
|
|
|
|
return (resultPosType < other.resultPosType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fieldName != other.fieldName)
|
|
|
|
|
{
|
|
|
|
|
return (fieldName < other.fieldName);
|
|
|
|
|
}
|
2016-10-10 16:09:54 +02:00
|
|
|
|
2018-02-15 10:58:13 +01:00
|
|
|
if (refKLayerIndex != other.refKLayerIndex)
|
|
|
|
|
{
|
|
|
|
|
return refKLayerIndex < other.refKLayerIndex;
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-08 10:34:57 +02:00
|
|
|
return (componentName < other.componentName);
|
2018-01-15 16:09:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool operator== (const RigFemResultAddress& other) const
|
|
|
|
|
{
|
|
|
|
|
if ( resultPosType != other.resultPosType
|
|
|
|
|
|| fieldName != other.fieldName
|
|
|
|
|
|| componentName != other.componentName
|
|
|
|
|
|| timeLapseBaseFrameIdx != other.timeLapseBaseFrameIdx)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
2015-05-08 10:34:57 +02:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|