mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show NNCs with no common area in folder below Faults
This commit is contained in:
@@ -49,6 +49,8 @@ ${CEE_CURRENT_LIST_DIR}RimFaultCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.h
|
||||
${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFaultResultSlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNNC.h
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNncCollection.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -96,6 +98,8 @@ ${CEE_CURRENT_LIST_DIR}RimFaultCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimMockModelSettings.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimTernaryLegendConfig.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimFaultResultSlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNNC.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimNoCommonAreaNncCollection.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "RiaPreferences.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimNoCommonAreaNNC.h"
|
||||
#include "RimNoCommonAreaNncCollection.h"
|
||||
#include "RimReservoirView.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RivColorTableArray.h"
|
||||
@@ -67,7 +69,10 @@ RimFaultCollection::RimFaultCollection()
|
||||
cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor();
|
||||
CAF_PDM_InitField(&faultLabelColor, "FaultLabelColor", defWellLabelColor, "Label color", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&faults, "Faults", "Faults", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&faults, "Faults", "Faults", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&noCommonAreaNnncCollection, "NoCommonAreaNnncCollection", "NNCs With No Common Area", "", "", "");
|
||||
noCommonAreaNnncCollection = new RimNoCommonAreaNncCollection;
|
||||
|
||||
m_reservoirView = NULL;
|
||||
}
|
||||
@@ -78,6 +83,8 @@ RimFaultCollection::RimFaultCollection()
|
||||
RimFaultCollection::~RimFaultCollection()
|
||||
{
|
||||
faults.deleteAllChildObjects();
|
||||
|
||||
delete noCommonAreaNnncCollection();
|
||||
}
|
||||
|
||||
|
||||
@@ -226,6 +233,30 @@ void RimFaultCollection::syncronizeFaults()
|
||||
|
||||
QString toolTip = QString("Fault count (%1)").arg(newFaults.size());
|
||||
setUiToolTip(toolTip);
|
||||
|
||||
// NNCs
|
||||
this->noCommonAreaNnncCollection()->noCommonAreaNncs().deleteAllChildObjects();
|
||||
|
||||
RigMainGrid* mainGrid = m_reservoirView->eclipseCase()->reservoirData()->mainGrid();
|
||||
std::vector<RigConnection>& nncConnections = mainGrid->nncData()->connections();
|
||||
for (size_t i = 0; i < nncConnections.size(); i++)
|
||||
{
|
||||
if (!nncConnections[i].hasCommonArea())
|
||||
{
|
||||
RimNoCommonAreaNNC* noCommonAreaNnc = new RimNoCommonAreaNNC();
|
||||
|
||||
size_t i1, j1, k1;
|
||||
mainGrid->ijkFromCellIndex(nncConnections[i].m_c1GlobIdx, &i1, &j1, &k1);
|
||||
|
||||
size_t i2, j2, k2;
|
||||
mainGrid->ijkFromCellIndex(nncConnections[i].m_c2GlobIdx, &i2, &j2, &k2);
|
||||
|
||||
QString txt = QString("[%1 %2 %3] - [%4 %5 %6]").arg(i1).arg(j1).arg(k1).arg(i2).arg(j2).arg(k2);
|
||||
|
||||
noCommonAreaNnc->name = txt;
|
||||
this->noCommonAreaNnncCollection()->noCommonAreaNncs().push_back(noCommonAreaNnc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -280,3 +311,12 @@ void RimFaultCollection::setShowFaultsOutsideFilters(bool enableState)
|
||||
m_showFaultsOutsideFilters = enableState;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultCollection::addMockData()
|
||||
{
|
||||
if (!(m_reservoirView && m_reservoirView->eclipseCase() && m_reservoirView->eclipseCase()->reservoirData() && m_reservoirView->eclipseCase()->reservoirData()->mainGrid())) return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
class RimFault;
|
||||
class RimReservoirView;
|
||||
class RimNoCommonAreaNncCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -56,6 +57,8 @@ public:
|
||||
void setReservoirView(RimReservoirView* ownerReservoirView);
|
||||
void syncronizeFaults();
|
||||
|
||||
void addMockData();
|
||||
|
||||
bool isGridVisualizationMode() const;
|
||||
|
||||
bool showFaultsOutsideFilters() const;
|
||||
@@ -75,6 +78,8 @@ public:
|
||||
caf::PdmPointersField<RimFault*> faults;
|
||||
RimFault* findFaultByName(QString name);
|
||||
|
||||
caf::PdmField<RimNoCommonAreaNncCollection*> noCommonAreaNnncCollection;
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
||||
|
||||
41
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.cpp
Normal file
41
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimNoCommonAreaNNC.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimNoCommonAreaNNC, "NoCommonAreaNNC");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNoCommonAreaNNC::RimNoCommonAreaNNC()
|
||||
{
|
||||
CAF_PDM_InitObject("RimNoCommonAreaNNC", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&name, "Name", "Name", "", "", "");
|
||||
name.setUiReadOnly(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimNoCommonAreaNNC::userDescriptionField()
|
||||
{
|
||||
return &name;
|
||||
}
|
||||
|
||||
40
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.h
Normal file
40
ApplicationCode/ProjectDataModel/RimNoCommonAreaNNC.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, 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 "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimNoCommonAreaNNC : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimNoCommonAreaNNC();
|
||||
|
||||
caf::PdmField<QString> name;
|
||||
|
||||
caf::PdmFieldHandle* userDescriptionField();
|
||||
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimNoCommonAreaNncCollection.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimNoCommonAreaNncCollection, "RimNoCommonAreaNncCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNoCommonAreaNncCollection::RimNoCommonAreaNncCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("RimNoCommonAreaNncCollection", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&noCommonAreaNncs, "NoCommonAreaNncs", "NoCommonAreaNncs", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNoCommonAreaNncCollection::~RimNoCommonAreaNncCollection()
|
||||
{
|
||||
noCommonAreaNncs.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Statoil ASA, 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 "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
class RimNoCommonAreaNNC;
|
||||
|
||||
//==================================================================================================
|
||||
/// Placeholder class used to create a folder in the tree view.
|
||||
/// TODO: Remove this class when new tree view is integrated
|
||||
//==================================================================================================
|
||||
class RimNoCommonAreaNncCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimNoCommonAreaNncCollection();
|
||||
virtual ~RimNoCommonAreaNncCollection();
|
||||
|
||||
caf::PdmPointersField<RimNoCommonAreaNNC*> noCommonAreaNncs;
|
||||
};
|
||||
Reference in New Issue
Block a user