Added casecollection in grid case group

p4#: 20602
This commit is contained in:
Magne Sjaastad 2013-02-21 15:37:51 +01:00
parent 4a3bde5baa
commit 0dc492da75
6 changed files with 103 additions and 15 deletions

View File

@ -54,6 +54,7 @@ list( APPEND CPP_SOURCES
)
list( APPEND CPP_SOURCES
ProjectDataModel/RimCaseCollection.cpp
ProjectDataModel/RimCellFilter.cpp
ProjectDataModel/RimCellPropertyFilter.cpp
ProjectDataModel/RimCellPropertyFilterCollection.cpp

View File

@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RIStdInclude.h"
#include "RimCaseCollection.h"
#include "RimReservoirView.h"
CAF_PDM_SOURCE_INIT(RimCaseCollection, "RimCaseCollection");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCaseCollection::RimCaseCollection()
{
CAF_PDM_InitObject("Derived Statistics", "", "", "");
CAF_PDM_InitFieldNoDefault(&reservoirs, "Reservoirs", "", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCaseCollection::~RimCaseCollection()
{
}

View File

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron 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 "cvfBase.h"
#include "cvfObject.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "RimStatisticalCalculation.h"
//==================================================================================================
//
//
//
//==================================================================================================
class RimCaseCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimCaseCollection();
virtual ~RimCaseCollection();
caf::PdmPointersField<RimReservoir*> reservoirs;
private:
};

View File

@ -1,4 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
//
@ -38,10 +39,10 @@ RimIdenticalGridCaseGroup::RimIdenticalGridCaseGroup()
CAF_PDM_InitField(&name, "UserDescription", QString("Identical Grid Case Group"), "Name", "", "", "");
CAF_PDM_InitFieldNoDefault(&reservoirs, "Reservoirs", "", "", "", "");
CAF_PDM_InitFieldNoDefault(&statisticalReservoirCollection, "StatisticalReservoirCollection", "StatisticalReservoirCollection", "", "", "");
CAF_PDM_InitFieldNoDefault(&caseCollection, "CaseCollection", "Cases", "", "", "");
CAF_PDM_InitFieldNoDefault(&statisticalReservoirCollection, "StatisticalReservoirCollection", "Derived Statistics", "", "", "");
caseCollection = new RimCaseCollection;
statisticalReservoirCollection = new RimStatisticalCollection;
}
@ -69,16 +70,10 @@ void RimIdenticalGridCaseGroup::addCase(RimReservoir* reservoir)
{
m_mainGrid = incomingMainGrid;
}
else
{
if (m_mainGrid.p() != incomingMainGrid)
{
CVF_ASSERT(false);
return;
}
}
reservoirs.push_back(reservoir);
CVF_ASSERT(m_mainGrid.p() == incomingMainGrid);
caseCollection()->reservoirs().push_back(reservoir);
}
//--------------------------------------------------------------------------------------------------

View File

@ -24,6 +24,7 @@
#include "cafPdmObject.h"
#include "RimStatisticalCollection.h"
#include "RimCaseCollection.h"
class RimReservoir;
class RigMainGrid;
@ -45,7 +46,7 @@ public:
void addCase(RimReservoir* reservoir);
caf::PdmPointersField<RimReservoir*> reservoirs;
caf::PdmField<RimCaseCollection*> caseCollection;
caf::PdmField<RimStatisticalCollection*> statisticalReservoirCollection;
RigMainGrid* mainGrid();

View File

@ -201,9 +201,9 @@ void RimProject::removeEclipseCaseFromAllGroups(RimReservoir* reservoir)
{
RimIdenticalGridCaseGroup* cg = caseGroups()[i];
cg->reservoirs().removeChildObject(reservoir);
cg->caseCollection()->reservoirs().removeChildObject(reservoir);
if (cg->reservoirs().size() == 0)
if (cg->caseCollection()->reservoirs().size() == 0)
{
emptyCaseGroups.push_back(cg);
}