mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#814 New project tree items Intersection Boxes and Intersection Box. Support for add, toggle and delete
This commit is contained in:
parent
ae6397c5c6
commit
45952e59d3
@ -156,6 +156,7 @@ list( APPEND REFERENCED_CMAKE_FILES
|
||||
Commands/SummaryPlotCommands/CMakeLists_files.cmake
|
||||
Commands/WellPathCommands/CMakeLists_files.cmake
|
||||
Commands/CrossSectionCommands/CMakeLists_files.cmake
|
||||
Commands/IntersectionBoxCommands/CMakeLists_files.cmake
|
||||
)
|
||||
|
||||
option (RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS "Include ApplicationCode Unit Tests" OFF)
|
||||
|
@ -0,0 +1,23 @@
|
||||
|
||||
# Use this workaround until we're on 2.8.3 on all platforms and can use CMAKE_CURRENT_LIST_DIR directly
|
||||
if (${CMAKE_VERSION} VERSION_GREATER "2.8.2")
|
||||
set(CEE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}/)
|
||||
endif()
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicAppendIntersectionBoxFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicAppendIntersectionBoxFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
${SOURCE_GROUP_HEADER_FILES}
|
||||
)
|
||||
|
||||
list(APPEND CODE_SOURCE_FILES
|
||||
${SOURCE_GROUP_SOURCE_FILES}
|
||||
)
|
||||
|
||||
source_group( "CommandFeature\\IntersectionBox" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CEE_CURRENT_LIST_DIR}CMakeLists_files.cmake )
|
@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RicAppendIntersectionBoxFeature.h"
|
||||
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionBoxCollection.h"
|
||||
|
||||
#include "cafCmdExecCommandManager.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicAppendIntersectionBoxFeature, "RicAppendIntersectionBoxFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicAppendIntersectionBoxFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<caf::PdmObjectHandle*> collection;
|
||||
caf::SelectionManager::instance()->objectsByType(&collection);
|
||||
CVF_ASSERT(collection.size() == 1);
|
||||
|
||||
RimIntersectionBoxCollection* crossSectionCollection = NULL;
|
||||
collection[0]->firstAnchestorOrThisOfType(crossSectionCollection);
|
||||
|
||||
CVF_ASSERT(crossSectionCollection);
|
||||
|
||||
crossSectionCollection->appendIntersectionBox();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAppendIntersectionBoxFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/IntersectionBox16x16.png"));
|
||||
actionToSetup->setText("New Intersection Box");
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafCmdFeature.h"
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicAppendIntersectionBoxFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled();
|
||||
virtual void onActionTriggered( bool isChecked );
|
||||
virtual void setupActionLook( QAction* actionToSetup );
|
||||
};
|
||||
|
@ -18,16 +18,23 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicToggleItemsFeatureImpl.h"
|
||||
#include <vector>
|
||||
#include "cafPdmUiObjectHandle.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafPdmUiItem.h"
|
||||
#include <QModelIndex>
|
||||
#include "RiuMainWindow.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafPdmUiFieldHandle.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmUiFieldHandle.h"
|
||||
#include "cafPdmUiItem.h"
|
||||
#include "cafPdmUiObjectHandle.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QModelIndex>
|
||||
|
||||
#include <vector>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicToggleItemsFeatureImpl::isToggleCommandsAvailable()
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> selectedItems;
|
||||
@ -72,6 +79,9 @@ bool RicToggleItemsFeatureImpl::isToggleCommandsAvailable()
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicToggleItemsFeatureImpl::isToggleCommandsForSubItems()
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> selectedItems;
|
||||
@ -83,7 +93,6 @@ bool RicToggleItemsFeatureImpl::isToggleCommandsForSubItems()
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Set toggle state for list of model indices.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -37,6 +37,5 @@ public:
|
||||
static bool isToggleCommandsAvailable();
|
||||
static bool isToggleCommandsForSubItems();
|
||||
static void setObjectToggleStateForSelection(SelectionToggleType state);
|
||||
|
||||
};
|
||||
|
||||
|
@ -91,6 +91,8 @@ ${CEE_CURRENT_LIST_DIR}RimSummaryCaseCollection.h
|
||||
${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
|
||||
@ -180,6 +182,8 @@ ${CEE_CURRENT_LIST_DIR}RimSummaryCaseCollection.cpp
|
||||
${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
|
||||
|
@ -42,6 +42,8 @@
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
#include "RimIntersectionBoxCollection.h"
|
||||
#include "RimScriptCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
@ -307,6 +309,16 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicDeleteItemFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimIntersectionBoxCollection*>(uiItem))
|
||||
{
|
||||
commandIds << "RicAppendIntersectionBoxFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimIntersectionBox*>(uiItem))
|
||||
{
|
||||
commandIds << "RicAppendIntersectionBoxFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicDeleteItemFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimEclipseWell*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewSimWellCrossSectionFeature";
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigCaseData.h"
|
||||
#include "RigFormationNames.h"
|
||||
#include "RigResultAccessor.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
|
||||
@ -41,6 +42,7 @@
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimFaultCollection.h"
|
||||
#include "RimGridCollection.h"
|
||||
#include "RimIntersectionBoxCollection.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
@ -74,7 +76,6 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <limits.h>
|
||||
#include "RigFormationNames.h"
|
||||
|
||||
|
||||
|
||||
@ -1342,6 +1343,7 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
|
||||
uiTreeOrdering.add(m_rangeFilterCollection());
|
||||
uiTreeOrdering.add(m_propertyFilterCollection());
|
||||
uiTreeOrdering.add(intersectionBoxCollection());
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartGrid.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RigFormationNames.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
@ -35,6 +36,7 @@
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechPropertyFilterCollection.h"
|
||||
#include "RimGridCollection.h"
|
||||
#include "RimIntersectionBoxCollection.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
@ -61,7 +63,6 @@
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include "RigFormationNames.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimGeoMechView, "GeoMechView");
|
||||
@ -677,7 +678,9 @@ void RimGeoMechView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
||||
|
||||
uiTreeOrdering.add(m_rangeFilterCollection());
|
||||
uiTreeOrdering.add(m_propertyFilterCollection());
|
||||
|
||||
|
||||
uiTreeOrdering.add(intersectionBoxCollection());
|
||||
|
||||
uiTreeOrdering.setForgetRemainingFields(true);
|
||||
}
|
||||
|
||||
|
165
ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp
Normal file
165
ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp
Normal file
@ -0,0 +1,165 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimIntersectionBox.h"
|
||||
|
||||
#include "RimView.h"
|
||||
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimIntersectionBox, "IntersectionBox");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionBox::RimIntersectionBox()
|
||||
{
|
||||
CAF_PDM_InitObject("Intersection Box", ":/IntersectionBox16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&name, "UserDescription", QString("Intersection Name"), "Name", "", "", "");
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
isActive.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&minXCoord, "MinXCoord", 0.0, "MinXCoord", "", "", "");
|
||||
minXCoord.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(&maxXCoord, "MaxXCoord", 0.0, "MaxXCoord", "", "", "");
|
||||
maxXCoord.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(&minYCoord, "MinYCoord", 0.0, "MinYCoord", "", "", "");
|
||||
minYCoord.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(&maxYCoord, "MaxYCoord", 0.0, "MaxYCoord", "", "", "");
|
||||
maxYCoord.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(&minZCoord, "MinZCoord", 0.0, "MinZCoord", "", "", "");
|
||||
minZCoord.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(&maxZCoord, "MaxZCoord", 0.0, "MaxZCoord", "", "", "");
|
||||
maxZCoord.uiCapability()->setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionBox::~RimIntersectionBox()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::setModelBoundingBox(cvf::BoundingBox& boundingBox)
|
||||
{
|
||||
m_boundingBox = boundingBox;
|
||||
|
||||
minXCoord = cvf::Math::floor(boundingBox.min().x());
|
||||
minYCoord = cvf::Math::floor(boundingBox.min().y());
|
||||
minZCoord = cvf::Math::floor(boundingBox.min().z());
|
||||
|
||||
maxXCoord = cvf::Math::ceil(boundingBox.max().x());
|
||||
maxYCoord = cvf::Math::ceil(boundingBox.max().y());
|
||||
maxZCoord = cvf::Math::ceil(boundingBox.max().z());
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &isActive)
|
||||
{
|
||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
caf::PdmUiSliderEditorAttribute* myAttr = static_cast<caf::PdmUiSliderEditorAttribute*>(attribute);
|
||||
|
||||
if (myAttr)
|
||||
{
|
||||
if (field == &minXCoord || field == &maxXCoord)
|
||||
{
|
||||
myAttr->m_minimum = cvf::Math::floor(m_boundingBox.min().x());
|
||||
myAttr->m_maximum = cvf::Math::ceil(m_boundingBox.max().x());
|
||||
}
|
||||
else if (field == &minYCoord || field == &maxYCoord)
|
||||
{
|
||||
myAttr->m_minimum = cvf::Math::floor(m_boundingBox.min().y());
|
||||
myAttr->m_maximum = cvf::Math::ceil(m_boundingBox.max().y());
|
||||
}
|
||||
else if (field == &minZCoord || field == &maxZCoord)
|
||||
{
|
||||
myAttr->m_minimum = cvf::Math::floor(m_boundingBox.min().z());
|
||||
myAttr->m_maximum = cvf::Math::ceil(m_boundingBox.max().z());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&name);
|
||||
|
||||
/*
|
||||
uiOrdering.add(&minXCoord);
|
||||
uiOrdering.add(&maxXCoord);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
*/
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimIntersectionBox::userDescriptionField()
|
||||
{
|
||||
return &name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimIntersectionBox::objectToggleField()
|
||||
{
|
||||
return &isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBox::rebuildGeometryAndScheduleCreateDisplayModel()
|
||||
{
|
||||
RimView* rimView = NULL;
|
||||
this->firstAnchestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
68
ApplicationCode/ProjectDataModel/RimIntersectionBox.h
Normal file
68
ApplicationCode/ProjectDataModel/RimIntersectionBox.h
Normal file
@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cafPdmField.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimIntersectionBox : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimIntersectionBox();
|
||||
~RimIntersectionBox();
|
||||
|
||||
// Fields
|
||||
caf::PdmField<QString> name;
|
||||
caf::PdmField<bool> isActive;
|
||||
|
||||
void setModelBoundingBox(cvf::BoundingBox& boundingBox);
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
private:
|
||||
void rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
|
||||
private:
|
||||
caf::PdmField<double> minXCoord;
|
||||
caf::PdmField<double> minYCoord;
|
||||
caf::PdmField<double> minZCoord;
|
||||
|
||||
caf::PdmField<double> maxXCoord;
|
||||
caf::PdmField<double> maxYCoord;
|
||||
caf::PdmField<double> maxZCoord;
|
||||
|
||||
|
||||
cvf::BoundingBox m_boundingBox;
|
||||
};
|
@ -0,0 +1,181 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "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()
|
||||
{
|
||||
for (size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
|
||||
{
|
||||
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
|
||||
if (cs->isActive)
|
||||
{
|
||||
// cs->crossSectionPartMgr()->applySingleColorEffect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBoxCollection::updateCellResultColor(size_t timeStepIndex)
|
||||
{
|
||||
for (size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
|
||||
{
|
||||
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
|
||||
if (cs->isActive)
|
||||
{
|
||||
// cs->crossSectionPartMgr()->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->crossSectionPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
|
||||
// cs->crossSectionPartMgr()->appendMeshLinePartsToModel(model, scaleTransform);
|
||||
|
||||
// if (cs->inputFromViewerEnabled)
|
||||
// {
|
||||
// // cs->crossSectionPartMgr()->appendPolylinePartsToModel(model, scaleTransform);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBoxCollection::appendIntersectionBox()
|
||||
{
|
||||
RimIntersectionBox* intersectionBox = new RimIntersectionBox();
|
||||
intersectionBox->name = QString("Intersection Box");
|
||||
|
||||
RimCase* rimCase = NULL;
|
||||
firstAnchestorOrThisOfType(rimCase);
|
||||
if (rimCase)
|
||||
{
|
||||
intersectionBox->setModelBoundingBox(rimCase->activeCellsBoundingBox());
|
||||
}
|
||||
|
||||
m_intersectionBoxes.push_back(intersectionBox);
|
||||
|
||||
updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox);
|
||||
|
||||
RimView* rimView = NULL;
|
||||
firstAnchestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionBoxCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &isActive)
|
||||
{
|
||||
RimView* rimView = NULL;
|
||||
firstAnchestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimIntersectionBoxCollection::hasActiveCrossSectionForSimulationWell(RimEclipseWell* eclipseWell) const
|
||||
{
|
||||
if (!isActive) return false;
|
||||
|
||||
/*
|
||||
for (size_t csIdx = 0; csIdx < m_intersectionBoxes.size(); ++csIdx)
|
||||
{
|
||||
RimIntersectionBox* cs = m_intersectionBoxes[csIdx];
|
||||
|
||||
if (cs->isActive &&
|
||||
cs->type() == RimIntersectionBox::CS_SIMULATION_WELL &&
|
||||
cs->simulationWell() == eclipseWell)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
return true;
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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();
|
||||
|
||||
bool hasActiveCrossSectionForSimulationWell(RimEclipseWell* eclipseWell) const;
|
||||
|
||||
// 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;
|
||||
};
|
@ -11,6 +11,7 @@
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGridCollection.h"
|
||||
#include "RimIntersectionBoxCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimPropertyFilterCollection.h"
|
||||
@ -126,6 +127,10 @@ RimView::RimView(void)
|
||||
crossSectionCollection.uiCapability()->setUiHidden(true);
|
||||
crossSectionCollection = new RimCrossSectionCollection();
|
||||
|
||||
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();
|
||||
@ -178,6 +183,7 @@ RimView::~RimView(void)
|
||||
|
||||
delete m_rangeFilterCollection;
|
||||
delete m_overrideRangeFilterCollection;
|
||||
delete intersectionBoxCollection;
|
||||
delete crossSectionCollection;
|
||||
delete m_gridCollection;
|
||||
}
|
||||
|
@ -43,9 +43,10 @@
|
||||
class Rim3dOverlayInfoConfig;
|
||||
class RimCase;
|
||||
class RimCellRangeFilter;
|
||||
class RimGridCollection;
|
||||
class RimCellRangeFilterCollection;
|
||||
class RimCrossSectionCollection;
|
||||
class RimGridCollection;
|
||||
class RimIntersectionBoxCollection;
|
||||
class RimPropertyFilterCollection;
|
||||
class RimViewController;
|
||||
class RimViewLinker;
|
||||
@ -97,6 +98,7 @@ public:
|
||||
|
||||
|
||||
caf::PdmChildField<RimCrossSectionCollection*> crossSectionCollection;
|
||||
caf::PdmChildField<RimIntersectionBoxCollection*> intersectionBoxCollection;
|
||||
|
||||
// Draw style
|
||||
|
||||
|
BIN
ApplicationCode/Resources/IntersectionBox16x16.png
Normal file
BIN
ApplicationCode/Resources/IntersectionBox16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 687 B |
BIN
ApplicationCode/Resources/IntersectionBoxes16x16.png
Normal file
BIN
ApplicationCode/Resources/IntersectionBoxes16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 848 B |
@ -57,15 +57,16 @@
|
||||
<file>CrossSection16x16.png</file>
|
||||
<file>CrossSections16x16.png</file>
|
||||
<file>Refresh-32.png</file>
|
||||
<file>SummaryPlot16x16.png</file>
|
||||
<file>SummaryPlots16x16.png</file>
|
||||
<file>SummaryCurve16x16.png</file>
|
||||
<file>SummaryCurveFilter16x16.png</file>
|
||||
<file>FormationCollection16x16.png</file>
|
||||
<file>Formations16x16.png</file>
|
||||
<file>Parallel16x16.png</file>
|
||||
<file>Perspective16x16.png</file>
|
||||
|
||||
<file>SummaryPlot16x16.png</file>
|
||||
<file>SummaryPlots16x16.png</file>
|
||||
<file>SummaryCurve16x16.png</file>
|
||||
<file>SummaryCurveFilter16x16.png</file>
|
||||
<file>FormationCollection16x16.png</file>
|
||||
<file>Formations16x16.png</file>
|
||||
<file>Parallel16x16.png</file>
|
||||
<file>Perspective16x16.png</file>
|
||||
<file>IntersectionBox16x16.png</file>
|
||||
<file>IntersectionBoxes16x16.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/Shader/">
|
||||
<file>fs_CellFace.glsl</file>
|
||||
|
Loading…
Reference in New Issue
Block a user