#900 Merged Intersection Boxes into Intersections folder

This commit is contained in:
Jacob Støren 2016-09-30 08:40:46 +02:00
parent 638f5526ac
commit 1349cf0104
16 changed files with 61 additions and 249 deletions

View File

@ -20,7 +20,7 @@
#include "RimCase.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionBoxCollection.h"
#include "RimIntersectionCollection.h"
#include "RimView.h"
#include "RiuMainWindow.h"
@ -38,7 +38,7 @@ CAF_CMD_SOURCE_INIT(RicAppendIntersectionBoxFeature, "RicAppendIntersectionBoxFe
//--------------------------------------------------------------------------------------------------
bool RicAppendIntersectionBoxFeature::isCommandEnabled()
{
RimIntersectionBoxCollection* coll = RicAppendIntersectionBoxFeature::intersectionBoxCollection();
RimIntersectionCollection* coll = RicAppendIntersectionBoxFeature::intersectionCollection();
if (coll) return true;
return false;
@ -49,7 +49,7 @@ bool RicAppendIntersectionBoxFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked)
{
RimIntersectionBoxCollection* coll = RicAppendIntersectionBoxFeature::intersectionBoxCollection();
RimIntersectionCollection* coll = RicAppendIntersectionBoxFeature::intersectionCollection();
if (coll)
{
@ -85,9 +85,9 @@ void RicAppendIntersectionBoxFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimIntersectionBoxCollection* RicAppendIntersectionBoxFeature::intersectionBoxCollection()
RimIntersectionCollection* RicAppendIntersectionBoxFeature::intersectionCollection()
{
RimIntersectionBoxCollection* intersectionBoxColl = nullptr;
RimIntersectionCollection* intersectionBoxColl = nullptr;
std::vector<caf::PdmObjectHandle*> selectedObjects;
caf::SelectionManager::instance()->objectsByType(&selectedObjects);

View File

@ -22,7 +22,7 @@
#include "cafCmdExecuteCommand.h"
#include "cafPdmPointer.h"
class RimIntersectionBoxCollection;
class RimIntersectionCollection;
//==================================================================================================
///
@ -38,6 +38,6 @@ protected:
virtual void setupActionLook( QAction* actionToSetup );
private:
static RimIntersectionBoxCollection* intersectionBoxCollection();
static RimIntersectionCollection* intersectionCollection();
};

View File

@ -22,7 +22,7 @@
#include "RimCase.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionBoxCollection.h"
#include "RimIntersectionCollection.h"
#include "RimView.h"
#include "RiuMainWindow.h"
@ -53,7 +53,7 @@ void RicIntersectionBoxXSliceFeature::onActionTriggered(bool isChecked)
RimView* activeView = RiaApplication::instance()->activeReservoirView();
if (activeView)
{
RimIntersectionBoxCollection* coll = activeView->intersectionBoxCollection();
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT(coll);
RimIntersectionBox* intersectionBox = new RimIntersectionBox();

View File

@ -22,7 +22,7 @@
#include "RimCase.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionBoxCollection.h"
#include "RimIntersectionCollection.h"
#include "RimView.h"
#include "RiuMainWindow.h"
@ -53,7 +53,7 @@ void RicIntersectionBoxYSliceFeature::onActionTriggered(bool isChecked)
RimView* activeView = RiaApplication::instance()->activeReservoirView();
if (activeView)
{
RimIntersectionBoxCollection* coll = activeView->intersectionBoxCollection();
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT(coll);
RimIntersectionBox* intersectionBox = new RimIntersectionBox();

View File

@ -22,7 +22,7 @@
#include "RimCase.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionBoxCollection.h"
#include "RimIntersectionCollection.h"
#include "RimView.h"
#include "RiuMainWindow.h"
@ -53,7 +53,7 @@ void RicIntersectionBoxZSliceFeature::onActionTriggered(bool isChecked)
RimView* activeView = RiaApplication::instance()->activeReservoirView();
if (activeView)
{
RimIntersectionBoxCollection* coll = activeView->intersectionBoxCollection();
RimIntersectionCollection* coll = activeView->crossSectionCollection();
CVF_ASSERT(coll);
RimIntersectionBox* intersectionBox = new RimIntersectionBox();

View File

@ -24,7 +24,6 @@
#include "RimCellRangeFilterCollection.h"
#include "RimEclipsePropertyFilterCollection.h"
#include "RimGeoMechPropertyFilterCollection.h"
#include "RimIntersectionBoxCollection.h"
#include "RimIntersectionCollection.h"
#include "RimProject.h"
#include "RimView.h"
@ -111,12 +110,6 @@ void RicDeleteItemExec::redo()
view->scheduleCreateDisplayModelAndRedraw();
}
RimIntersectionBoxCollection* intersectionBoxColl;
parentObj->firstAncestorOrThisOfType(intersectionBoxColl);
if (view && intersectionBoxColl)
{
view->scheduleCreateDisplayModelAndRedraw();
}
RimWellPathCollection* wellPathColl;
parentObj->firstAncestorOrThisOfType(wellPathColl);

View File

@ -92,7 +92,6 @@ ${CEE_CURRENT_LIST_DIR}RimPlotCurve.h
${CEE_CURRENT_LIST_DIR}RimSummaryCurveAppearanceCalculator.h
${CEE_CURRENT_LIST_DIR}RimEclipseInputCaseOpm.h
${CEE_CURRENT_LIST_DIR}RimIntersectionBox.h
${CEE_CURRENT_LIST_DIR}RimIntersectionBoxCollection.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -183,7 +182,6 @@ ${CEE_CURRENT_LIST_DIR}RimPlotCurve.cpp
${CEE_CURRENT_LIST_DIR}RimSummaryCurveAppearanceCalculator.cpp
${CEE_CURRENT_LIST_DIR}RimEclipseInputCaseOpm.cpp
${CEE_CURRENT_LIST_DIR}RimIntersectionBox.cpp
${CEE_CURRENT_LIST_DIR}RimIntersectionBoxCollection.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -43,7 +43,6 @@
#include "RimGeoMechView.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionBoxCollection.h"
#include "RimScriptCollection.h"
#include "RimSummaryCase.h"
#include "RimSummaryCurve.h"
@ -302,19 +301,18 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
else if (dynamic_cast<RimIntersectionCollection*>(uiItem))
{
commandIds << "RicAppendIntersectionFeature";
commandIds << "RicAppendIntersectionBoxFeature";
}
else if (dynamic_cast<RimIntersection*>(uiItem))
{
commandIds << "RicAppendIntersectionFeature";
commandIds << "RicAppendIntersectionBoxFeature";
commandIds << "Separator";
commandIds << "RicDeleteItemFeature";
}
else if (dynamic_cast<RimIntersectionBoxCollection*>(uiItem))
{
commandIds << "RicAppendIntersectionBoxFeature";
}
else if (dynamic_cast<RimIntersectionBox*>(uiItem))
{
commandIds << "RicAppendIntersectionFeature";
commandIds << "RicAppendIntersectionBoxFeature";
commandIds << "Separator";
commandIds << "RicDeleteItemFeature";

View File

@ -42,7 +42,6 @@
#include "RimEclipseWellCollection.h"
#include "RimFaultCollection.h"
#include "RimGridCollection.h"
#include "RimIntersectionBoxCollection.h"
#include "RimLegendConfig.h"
#include "RimOilField.h"
#include "RimProject.h"
@ -429,7 +428,6 @@ void RimEclipseView::createDisplayModel()
m_crossSectionVizModel->removeAllParts();
crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), m_reservoirGridPartManager->scaleTransform());
intersectionBoxCollection->appendPartsToModel(m_crossSectionVizModel.p(), m_reservoirGridPartManager->scaleTransform());
m_viewer->addStaticModelOnce(m_crossSectionVizModel.p());
@ -638,12 +636,10 @@ void RimEclipseView::updateCurrentTimeStep()
if ((this->hasUserRequestedAnimation() && this->cellResult()->hasResult()) || this->cellResult()->isTernarySaturationSelected())
{
crossSectionCollection->updateCellResultColor(m_currentTimeStep);
intersectionBoxCollection->updateCellResultColor(m_currentTimeStep);
}
else
{
crossSectionCollection->applySingleColorEffect();
intersectionBoxCollection->applySingleColorEffect();
}
// Simulation Well pipes
@ -1346,7 +1342,6 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
uiTreeOrdering.add(m_rangeFilterCollection());
uiTreeOrdering.add(m_propertyFilterCollection());
uiTreeOrdering.add(intersectionBoxCollection());
uiTreeOrdering.setForgetRemainingFields(true);
}

View File

@ -36,7 +36,6 @@
#include "RimGeoMechCellColors.h"
#include "RimGeoMechPropertyFilterCollection.h"
#include "RimGridCollection.h"
#include "RimIntersectionBoxCollection.h"
#include "RimLegendConfig.h"
#include "RimViewLinker.h"
@ -252,7 +251,6 @@ void RimGeoMechView::createDisplayModel()
m_crossSectionVizModel->removeAllParts();
crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), scaleTransform());
intersectionBoxCollection->appendPartsToModel(m_crossSectionVizModel.p(), scaleTransform());
m_viewer->addStaticModelOnce(m_crossSectionVizModel.p());
// If the animation was active before recreating everything, make viewer view current frame
@ -267,7 +265,6 @@ void RimGeoMechView::createDisplayModel()
updateLegends();
m_vizLogic->updateStaticCellColors(-1);
crossSectionCollection->applySingleColorEffect();
intersectionBoxCollection->applySingleColorEffect();
m_overlayInfoConfig()->update3DInfo();
}
@ -306,19 +303,16 @@ void RimGeoMechView::updateCurrentTimeStep()
if (this->cellResult()->hasResult())
{
crossSectionCollection->updateCellResultColor(m_currentTimeStep);
intersectionBoxCollection->updateCellResultColor(m_currentTimeStep);
}
else
{
crossSectionCollection->applySingleColorEffect();
intersectionBoxCollection->applySingleColorEffect();
}
}
else
{
m_vizLogic->updateStaticCellColors(-1);
crossSectionCollection->applySingleColorEffect();
intersectionBoxCollection->applySingleColorEffect();
m_viewer->animationControl()->slotPause(); // To avoid animation timer spinning in the background
}
@ -691,8 +685,6 @@ void RimGeoMechView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
uiTreeOrdering.add(m_rangeFilterCollection());
uiTreeOrdering.add(m_propertyFilterCollection());
uiTreeOrdering.add(intersectionBoxCollection());
uiTreeOrdering.setForgetRemainingFields(true);
}

View File

@ -1,138 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// 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 "RimIntersectionBoxCollection.h"
#include "RimCase.h"
#include "RimIntersectionBox.h"
#include "RimView.h"
#include "RivIntersectionBoxPartMgr.h"
#include "RiuMainWindow.h"
#include "cvfBoundingBox.h"
CAF_PDM_SOURCE_INIT(RimIntersectionBoxCollection, "IntersectionBoxCollection");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimIntersectionBoxCollection::RimIntersectionBoxCollection()
{
CAF_PDM_InitObject("Intersection Boxes", ":/IntersectionBoxes16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&m_intersectionBoxes, "IntersectionBoxes", "IntersectionBoxes", "", "", "");
m_intersectionBoxes.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
isActive.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimIntersectionBoxCollection::~RimIntersectionBoxCollection()
{
m_intersectionBoxes.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimIntersectionBoxCollection::objectToggleField()
{
return &isActive;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionBoxCollection::applySingleColorEffect()
{
if (!isActive) return;
for (size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if (cs->isActive)
{
cs->intersectionBoxPartMgr()->applySingleColorEffect();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionBoxCollection::updateCellResultColor(size_t timeStepIndex)
{
if (!isActive) return;
for (size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if (cs->isActive)
{
cs->intersectionBoxPartMgr()->updateCellResultColor(timeStepIndex);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionBoxCollection::appendPartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
{
if (!isActive) return;
for (size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if (cs->isActive)
{
cs->intersectionBoxPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
cs->intersectionBoxPartMgr()->appendMeshLinePartsToModel(model, scaleTransform);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionBoxCollection::appendIntersectionBox(RimIntersectionBox* intersectionBox)
{
m_intersectionBoxes.push_back(intersectionBox);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionBoxCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &isActive)
{
RimView* rimView = NULL;
firstAncestorOrThisOfType(rimView);
if (rimView)
{
rimView->scheduleCreateDisplayModelAndRedraw();
}
}
}

View File

@ -1,63 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil ASA
//
// 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 "cafPdmObject.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
class RimIntersectionBox;
class RimEclipseCellColors;
class RimEclipseWell;
namespace cvf {
class ModelBasicList;
class Transform;
}
//==================================================================================================
//
//
//
//==================================================================================================
class RimIntersectionBoxCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimIntersectionBoxCollection();
~RimIntersectionBoxCollection();
caf::PdmField<bool> isActive;
void appendIntersectionBox(RimIntersectionBox* intersectionBox);
// Visualization interface
void applySingleColorEffect();
void updateCellResultColor(size_t timeStepIndex);
void appendPartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
virtual caf::PdmFieldHandle* objectToggleField();
private:
caf::PdmChildArrayField<RimIntersectionBox*> m_intersectionBoxes;
};

View File

@ -26,6 +26,8 @@
#include "RiuMainWindow.h"
#include "RivIntersectionPartMgr.h"
#include "RimIntersectionBox.h"
#include "RivIntersectionBoxPartMgr.h"
CAF_PDM_SOURCE_INIT(RimIntersectionCollection, "CrossSectionCollection");
@ -40,6 +42,9 @@ RimIntersectionCollection::RimIntersectionCollection()
CAF_PDM_InitFieldNoDefault(&m_crossSections, "CrossSections", "Intersections", "", "", "");
m_crossSections.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_intersectionBoxes, "IntersectionBoxes", "IntersectionBoxes", "", "", "");
m_intersectionBoxes.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
isActive.uiCapability()->setUiHidden(true);
}
@ -50,6 +55,7 @@ RimIntersectionCollection::RimIntersectionCollection()
RimIntersectionCollection::~RimIntersectionCollection()
{
m_crossSections.deleteAllChildObjects();
m_intersectionBoxes.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
@ -75,6 +81,15 @@ void RimIntersectionCollection::applySingleColorEffect()
cs->crossSectionPartMgr()->applySingleColorEffect();
}
}
for(size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if(cs->isActive)
{
cs->intersectionBoxPartMgr()->applySingleColorEffect();
}
}
}
//--------------------------------------------------------------------------------------------------
@ -92,6 +107,15 @@ void RimIntersectionCollection::updateCellResultColor(size_t timeStepIndex)
cs->crossSectionPartMgr()->updateCellResultColor(timeStepIndex);
}
}
for(size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if(cs->isActive)
{
cs->intersectionBoxPartMgr()->updateCellResultColor(timeStepIndex);
}
}
}
//--------------------------------------------------------------------------------------------------
@ -115,6 +139,16 @@ void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, c
}
}
}
for(size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
{
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
if(cs->isActive)
{
cs->intersectionBoxPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
cs->intersectionBoxPartMgr()->appendMeshLinePartsToModel(model, scaleTransform);
}
}
}
//--------------------------------------------------------------------------------------------------
@ -135,6 +169,14 @@ void RimIntersectionCollection::appendCrossSection(RimIntersection* crossSection
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::appendIntersectionBox(RimIntersectionBox* intersectionBox)
{
m_intersectionBoxes.push_back(intersectionBox);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -24,6 +24,7 @@
#include "cafPdmField.h"
class RimIntersection;
class RimIntersectionBox;
class RimEclipseCellColors;
class RimEclipseWell;
@ -48,6 +49,7 @@ public:
caf::PdmField<bool> isActive;
void appendCrossSection(RimIntersection* crossSection);
void appendIntersectionBox(RimIntersectionBox* intersectionBox);
bool hasActiveCrossSectionForSimulationWell(RimEclipseWell* eclipseWell) const;
@ -63,4 +65,5 @@ protected:
private:
caf::PdmChildArrayField<RimIntersection*> m_crossSections;
caf::PdmChildArrayField<RimIntersectionBox*> m_intersectionBoxes;
};

View File

@ -11,7 +11,6 @@
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimGridCollection.h"
#include "RimIntersectionBoxCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimPropertyFilterCollection.h"
@ -127,10 +126,6 @@ RimView::RimView(void)
crossSectionCollection.uiCapability()->setUiHidden(true);
crossSectionCollection = new RimIntersectionCollection();
CAF_PDM_InitFieldNoDefault(&intersectionBoxCollection, "IntersectionBoxes", "Intersection Boxes", "", "", "");
intersectionBoxCollection.uiCapability()->setUiHidden(true);
intersectionBoxCollection = new RimIntersectionBoxCollection();
CAF_PDM_InitFieldNoDefault(&m_gridCollection, "GridCollection", "GridCollection", "", "", "");
m_gridCollection.uiCapability()->setUiHidden(true);
m_gridCollection = new RimGridCollection();
@ -183,7 +178,6 @@ RimView::~RimView(void)
delete m_rangeFilterCollection;
delete m_overrideRangeFilterCollection;
delete intersectionBoxCollection;
delete crossSectionCollection;
delete m_gridCollection;
}

View File

@ -46,7 +46,6 @@ class RimCellRangeFilter;
class RimCellRangeFilterCollection;
class RimIntersectionCollection;
class RimGridCollection;
class RimIntersectionBoxCollection;
class RimPropertyFilterCollection;
class RimViewController;
class RimViewLinker;
@ -98,7 +97,6 @@ public:
caf::PdmChildField<RimIntersectionCollection*> crossSectionCollection;
caf::PdmChildField<RimIntersectionBoxCollection*> intersectionBoxCollection;
// Draw style