Added const and cleaned up includes and whitespace

This commit is contained in:
Magne Sjaastad 2017-03-09 10:03:52 +01:00
parent fc5a44bf3a
commit 6e69bdb81d
2 changed files with 25 additions and 32 deletions

View File

@ -72,13 +72,7 @@ QString addCrossFlowEnding(const QString& wellName)
RimFlowDiagSolution::RimFlowDiagSolution(void)
{
CAF_PDM_InitObject("Flow Diagnostics Solution", "", "", "");
//CAF_PDM_InitFieldNoDefault(&m_selectedWells, "SelectedWells", "Selected Wells","","");
CAF_PDM_InitField(&m_userDescription, "UserDescription", QString("All Wells") ,"Description", "", "","");
}
//--------------------------------------------------------------------------------------------------
@ -89,6 +83,14 @@ RimFlowDiagSolution::~RimFlowDiagSolution(void)
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFlowDiagSolution::userDescription() const
{
return m_userDescription();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -116,7 +118,7 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QString> RimFlowDiagSolution::tracerNames()
std::vector<QString> RimFlowDiagSolution::tracerNames() const
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfType(eclCase);
@ -140,7 +142,7 @@ std::vector<QString> RimFlowDiagSolution::tracerNames()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<std::string, std::vector<int> > RimFlowDiagSolution::allInjectorTracerActiveCellIndices(size_t timeStepIndex)
std::map<std::string, std::vector<int> > RimFlowDiagSolution::allInjectorTracerActiveCellIndices(size_t timeStepIndex) const
{
return allTracerActiveCellIndices(timeStepIndex, true);
}
@ -148,7 +150,7 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allInjectorTracerA
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<std::string, std::vector<int> > RimFlowDiagSolution::allProducerTracerActiveCellIndices(size_t timeStepIndex)
std::map<std::string, std::vector<int> > RimFlowDiagSolution::allProducerTracerActiveCellIndices(size_t timeStepIndex) const
{
return allTracerActiveCellIndices(timeStepIndex, false);
}
@ -156,7 +158,7 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allProducerTracerA
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCellIndices(size_t timeStepIndex, bool useInjectors)
std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCellIndices(size_t timeStepIndex, bool useInjectors) const
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfType(eclCase);
@ -212,12 +214,10 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
return tracersWithCells;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(const QString& tracerName)
RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(const QString& tracerName) const
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfTypeAsserted(eclCase);
@ -265,7 +265,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeStep(const QString& tracerName, size_t timeStepIndex)
RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeStep(const QString& tracerName, size_t timeStepIndex) const
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfTypeAsserted(eclCase);
@ -310,7 +310,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimFlowDiagSolution::tracerColor(const QString& tracerName)
cvf::Color3f RimFlowDiagSolution::tracerColor(const QString& tracerName) const
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfType(eclCase);

View File

@ -20,8 +20,6 @@
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPointer.h"
#include "cafAppEnum.h"
#include "cvfBase.h"
#include "cvfObject.h"
@ -29,6 +27,7 @@
class RimEclipseWell;
class RigFlowDiagResults;
//==================================================================================================
///
///
@ -40,12 +39,12 @@ public:
RimFlowDiagSolution();
virtual ~RimFlowDiagSolution();
QString userDescription() { return m_userDescription();}
RigFlowDiagResults* flowDiagResults();
std::vector<QString> tracerNames();
QString userDescription() const;
RigFlowDiagResults* flowDiagResults();
std::vector<QString> tracerNames() const;
std::map<std::string, std::vector<int> > allInjectorTracerActiveCellIndices(size_t timeStepIndex);
std::map<std::string, std::vector<int> > allProducerTracerActiveCellIndices(size_t timeStepIndex);
std::map<std::string, std::vector<int> > allInjectorTracerActiveCellIndices(size_t timeStepIndex) const;
std::map<std::string, std::vector<int> > allProducerTracerActiveCellIndices(size_t timeStepIndex) const;
enum TracerStatusType
{
@ -56,21 +55,15 @@ public:
UNDEFINED ///< Used as "Any" or "not set"
};
TracerStatusType tracerStatusOverall(const QString& tracerName);
TracerStatusType tracerStatusInTimeStep(const QString& tracerName, size_t timeStepIndex);
cvf::Color3f tracerColor(const QString& tracerName);
protected:
//virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
TracerStatusType tracerStatusOverall(const QString& tracerName) const;
TracerStatusType tracerStatusInTimeStep(const QString& tracerName, size_t timeStepIndex) const;
cvf::Color3f tracerColor(const QString& tracerName) const;
private:
std::map<std::string, std::vector<int> > allTracerActiveCellIndices(size_t timeStepIndex, bool useInjectors);
std::map<std::string, std::vector<int> > allTracerActiveCellIndices(size_t timeStepIndex, bool useInjectors) const;
virtual caf::PdmFieldHandle* userDescriptionField() override;
caf::PdmField<QString> m_userDescription;
cvf::ref<RigFlowDiagResults> m_flowDiagResults;
//caf::PdmPtrArrayField<RimEclipseWell*> m_selectedWells;
};