mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#641) Create user defined polyline by clicking on reservoir cells
This commit is contained in:
parent
7cd4394102
commit
bd2a65acb4
@ -49,6 +49,8 @@ ${CEE_CURRENT_LIST_DIR}RicExportToLasFileFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemExec.h
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemExecData.h
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemFeature.h
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicCommandFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
|
@ -8,12 +8,14 @@ set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicAppendCrossSectionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellCrossSectionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathCrossSectionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPolylineCrossSectionFeature.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicAppendCrossSectionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellCrossSectionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewWellPathCrossSectionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicNewPolylineCrossSectionFeature.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -0,0 +1,155 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- 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 "RicNewPolylineCrossSectionFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimCrossSection.h"
|
||||
#include "RimCrossSectionCollection.h"
|
||||
#include "RimView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuSelectionManager.h"
|
||||
|
||||
#include "cafCmdExecCommandManager.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewPolylineCrossSectionFeature, "RicNewPolylineCrossSectionFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicNewPolylineCrossSectionFeature::RicNewPolylineCrossSectionFeature()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPolylineCrossSectionFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineCrossSectionFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (!activeView) return;
|
||||
|
||||
RicNewPolylineCrossSectionFeatureCmd* cmd = new RicNewPolylineCrossSectionFeatureCmd(activeView->crossSectionCollection);
|
||||
caf::CmdExecCommandManager::instance()->processExecuteCommand(cmd);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineCrossSectionFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setIcon(QIcon(":/CrossSection16x16.png"));
|
||||
actionToSetup->setText("New Polyline Intersection");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewPolylineCrossSectionFeature::handleUiEvent(cvf::Object* uiEventObject)
|
||||
{
|
||||
std::vector<RimCrossSection*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
|
||||
if (selection.size() == 1)
|
||||
{
|
||||
RicPolylineUiEvent* polylineUiEvent = dynamic_cast<RicPolylineUiEvent*>(uiEventObject);
|
||||
if (polylineUiEvent)
|
||||
{
|
||||
RimCrossSection* crossSection = selection[0];
|
||||
|
||||
RimCase* rimCase = NULL;
|
||||
crossSection->firstAnchestorOrThisOfType(rimCase);
|
||||
CVF_ASSERT(rimCase);
|
||||
|
||||
crossSection->appendPointToPolyLine(rimCase->displayModelOffset() + polylineUiEvent->localIntersectionPoint);
|
||||
|
||||
// Further Ui processing is stopped when true is returned
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicNewPolylineCrossSectionFeatureCmd::RicNewPolylineCrossSectionFeatureCmd(RimCrossSectionCollection* crossSectionCollection)
|
||||
: CmdExecuteCommand(NULL),
|
||||
m_crossSectionCollection(crossSectionCollection)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicNewPolylineCrossSectionFeatureCmd::~RicNewPolylineCrossSectionFeatureCmd()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicNewPolylineCrossSectionFeatureCmd::name()
|
||||
{
|
||||
return "Start Polyline Intersection";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineCrossSectionFeatureCmd::redo()
|
||||
{
|
||||
CVF_ASSERT(m_crossSectionCollection);
|
||||
|
||||
RimCrossSection* crossSection = new RimCrossSection();
|
||||
crossSection->name = "Polyline";
|
||||
crossSection->type = RimCrossSection::CS_POLYLINE;
|
||||
m_crossSectionCollection->appendCrossSection(crossSection);
|
||||
|
||||
crossSection->updateActiveUiCommandFeature();
|
||||
|
||||
RiuSelectionManager::instance()->deleteAllItems();
|
||||
|
||||
RiuMainWindow::instance()->setCurrentObjectInTreeView(crossSection);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewPolylineCrossSectionFeatureCmd::undo()
|
||||
{
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- 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 "RicCommandFeature.h"
|
||||
|
||||
#include "cafCmdExecuteCommand.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
class RimCrossSectionCollection;
|
||||
|
||||
class RicPolylineUiEvent : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RicPolylineUiEvent(cvf::Vec3d localIntersectionPoint)
|
||||
: localIntersectionPoint(localIntersectionPoint)
|
||||
{
|
||||
}
|
||||
|
||||
cvf::Vec3d localIntersectionPoint;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewPolylineCrossSectionFeatureCmd : public caf::CmdExecuteCommand
|
||||
{
|
||||
public:
|
||||
RicNewPolylineCrossSectionFeatureCmd(RimCrossSectionCollection* crossSectionCollection);
|
||||
virtual ~RicNewPolylineCrossSectionFeatureCmd();
|
||||
|
||||
virtual QString name();
|
||||
virtual void redo();
|
||||
virtual void undo();
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimCrossSectionCollection> m_crossSectionCollection;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewPolylineCrossSectionFeature : public RicCommandFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RicNewPolylineCrossSectionFeature();
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled();
|
||||
virtual void onActionTriggered( bool isChecked );
|
||||
virtual void setupActionLook( QAction* actionToSetup );
|
||||
|
||||
virtual bool handleUiEvent(cvf::Object* uiEventObject);
|
||||
};
|
||||
|
||||
|
33
ApplicationCode/Commands/RicCommandFeature.h
Normal file
33
ApplicationCode/Commands/RicCommandFeature.h
Normal file
@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- 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 "cafCmdFeature.h"
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Object;
|
||||
}
|
||||
|
||||
class RicCommandFeature : public caf::CmdFeature
|
||||
{
|
||||
public:
|
||||
virtual bool handleUiEvent(cvf::Object* uiEventObject) = 0;
|
||||
};
|
@ -21,16 +21,25 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RicCommandFeature.h"
|
||||
|
||||
#include "RigSimulationWellCenterLineCalculator.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
#include "RimEclipseWellCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimView.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RiuViewer.h"
|
||||
#include "RivCrossSectionPartMgr.h"
|
||||
#include "RigSimulationWellCenterLineCalculator.h"
|
||||
#include "RimCase.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "cafCmdFeatureManager.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
|
||||
|
||||
namespace caf {
|
||||
@ -40,7 +49,7 @@ void caf::AppEnum< RimCrossSection::CrossSectionEnum >::setUp()
|
||||
{
|
||||
addItem(RimCrossSection::CS_WELL_PATH, "CS_WELL_PATH", "Well Path");
|
||||
addItem(RimCrossSection::CS_SIMULATION_WELL, "CS_SIMULATION_WELL", "Simulation Well");
|
||||
// addItem(RimCrossSection::CS_USER_DEFINED, "CS_USER_DEFINED", "User defined");
|
||||
addItem(RimCrossSection::CS_POLYLINE, "CS_POLYLINE", "Polyline");
|
||||
setDefault(RimCrossSection::CS_WELL_PATH);
|
||||
}
|
||||
|
||||
@ -72,10 +81,18 @@ RimCrossSection::RimCrossSection()
|
||||
CAF_PDM_InitFieldNoDefault(&direction, "Direction", "Direction", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&wellPath, "WellPath", "Well Path ", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&simulationWell, "SimulationWell", "Simulation Well", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_userDefinedPolyline, "Points", "Selected points", "", "", "");
|
||||
CAF_PDM_InitField (&m_branchIndex, "Branch", -1, "Branch", "", "", "");
|
||||
CAF_PDM_InitField (&m_extentLength, "ExtentLength", 200.0, "Extent length", "", "", "");
|
||||
CAF_PDM_InitField (&showInactiveCells, "ShowInactiveCells", false, "Inactive Cells", "", "", "");
|
||||
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_activateUiAppendPointsCommand, "m_activateUiAppendPointsCommand", "", "", "", "");
|
||||
m_activateUiAppendPointsCommand.xmlCapability()->setIOWritable(false);
|
||||
m_activateUiAppendPointsCommand.xmlCapability()->setIOReadable(false);
|
||||
m_activateUiAppendPointsCommand.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||
m_activateUiAppendPointsCommand.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
m_activateUiAppendPointsCommand = false;
|
||||
|
||||
uiCapability()->setUiChildrenHidden(true);
|
||||
}
|
||||
@ -94,14 +111,7 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
changedField == &m_extentLength ||
|
||||
changedField == &showInactiveCells)
|
||||
{
|
||||
m_crossSectionPartMgr = NULL;
|
||||
|
||||
RimView* rimView = NULL;
|
||||
this->firstAnchestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
|
||||
if (changedField == &simulationWell
|
||||
@ -121,6 +131,17 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
updateName();
|
||||
}
|
||||
|
||||
if (changedField == &m_activateUiAppendPointsCommand)
|
||||
{
|
||||
updateActiveUiCommandFeature();
|
||||
|
||||
m_activateUiAppendPointsCommand = false;
|
||||
}
|
||||
|
||||
if (changedField == &m_userDefinedPolyline)
|
||||
{
|
||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -145,9 +166,10 @@ void RimCrossSection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
geometryGroup->add(&m_branchIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (type == CS_POLYLINE)
|
||||
{
|
||||
// User defined poly line
|
||||
uiOrdering.add(&m_userDefinedPolyline);
|
||||
uiOrdering.add(&m_activateUiAppendPointsCommand);
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* optionsGroup = uiOrdering.addNewGroup("Options");
|
||||
@ -286,9 +308,9 @@ std::vector< std::vector <cvf::Vec3d> > RimCrossSection::polyLines() const
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (type == CS_POLYLINE)
|
||||
{
|
||||
|
||||
lines.push_back(m_userDefinedPolyline);
|
||||
}
|
||||
|
||||
if (type == CS_WELL_PATH || type == CS_SIMULATION_WELL)
|
||||
@ -387,8 +409,6 @@ void RimCrossSection::addExtents(std::vector<cvf::Vec3d> &polyLine) const
|
||||
|
||||
polyLine.insert(polyLine.begin(), newStart);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -475,3 +495,83 @@ void RimCrossSection::clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const
|
||||
polyLine.swap(clippedPolyLine);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCrossSection::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (field == &m_activateUiAppendPointsCommand)
|
||||
{
|
||||
caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*> (attribute);
|
||||
|
||||
RimView* rimView = NULL;
|
||||
this->firstAnchestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
if (rimView->viewer()->activeUiCommandFeature())
|
||||
{
|
||||
attrib->m_buttonText = "End point input";
|
||||
}
|
||||
else
|
||||
{
|
||||
attrib->m_buttonText = "Start point input";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCrossSection::appendPointToPolyLine(const cvf::Vec3d& point)
|
||||
{
|
||||
m_userDefinedPolyline.v().push_back(point);
|
||||
|
||||
m_userDefinedPolyline.uiCapability()->updateConnectedEditors();
|
||||
|
||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCrossSection::updateActiveUiCommandFeature()
|
||||
{
|
||||
RimView* rimView = NULL;
|
||||
this->firstAnchestorOrThisOfType(rimView);
|
||||
CVF_ASSERT(rimView);
|
||||
|
||||
if (!rimView->viewer()) return;
|
||||
|
||||
if (rimView->viewer()->activeUiCommandFeature())
|
||||
{
|
||||
rimView->viewer()->setActiveUiCommandFeature(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
caf::CmdFeature* cmdFeature = caf::CmdFeatureManager::instance()->getCommandFeature("RicNewPolylineCrossSectionFeature");
|
||||
CVF_ASSERT(cmdFeature);
|
||||
|
||||
RicCommandFeature* riCommandFeature = dynamic_cast<RicCommandFeature*>(cmdFeature);
|
||||
CVF_ASSERT(riCommandFeature);
|
||||
|
||||
rimView->viewer()->setActiveUiCommandFeature(riCommandFeature);
|
||||
}
|
||||
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCrossSection::rebuildGeometryAndScheduleCreateDisplayModel()
|
||||
{
|
||||
m_crossSectionPartMgr = NULL;
|
||||
|
||||
RimView* rimView = NULL;
|
||||
this->firstAnchestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
@ -47,7 +48,7 @@ public:
|
||||
{
|
||||
CS_WELL_PATH,
|
||||
CS_SIMULATION_WELL,
|
||||
CS_USER_DEFINED
|
||||
CS_POLYLINE
|
||||
};
|
||||
|
||||
enum CrossSectionDirEnum
|
||||
@ -72,18 +73,27 @@ public:
|
||||
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
||||
RivCrossSectionPartMgr* crossSectionPartMgr();
|
||||
|
||||
void appendPointToPolyLine(const cvf::Vec3d& point);
|
||||
void updateActiveUiCommandFeature();
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_branchIndex;
|
||||
caf::PdmField<double> m_extentLength;
|
||||
|
||||
caf::PdmField< std::vector< cvf::Vec3d> > m_userDefinedPolyline;
|
||||
caf::PdmField< bool > m_activateUiAppendPointsCommand;
|
||||
|
||||
RimEclipseWellCollection* simulationWellCollection();
|
||||
void updateWellCenterline() const;
|
||||
@ -91,6 +101,7 @@ private:
|
||||
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
|
||||
void clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const;
|
||||
void updateName();
|
||||
void rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
private:
|
||||
cvf::ref<RivCrossSectionPartMgr> m_crossSectionPartMgr;
|
||||
|
||||
|
@ -649,3 +649,20 @@ cvf::Color3f RiuViewer::computeContrastColor() const
|
||||
|
||||
return contrastColor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature)
|
||||
{
|
||||
CVF_ASSERT(m_viewerCommands);
|
||||
m_viewerCommands->setActiveUiCommandFeature(uiCommandFeature);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicCommandFeature* RiuViewer::activeUiCommandFeature() const
|
||||
{
|
||||
return m_viewerCommands->activeUiCommandFeature();
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "cafMouseState.h"
|
||||
#include "cvfStructGrid.h"
|
||||
|
||||
class RicCommandFeature;
|
||||
class RimView;
|
||||
class RiuSimpleHistogramWidget;
|
||||
class RiuViewerCommands;
|
||||
@ -88,6 +89,9 @@ public:
|
||||
|
||||
void setAxisLabels(const cvf::String& xLabel, const cvf::String& yLabel, const cvf::String& zLabel);
|
||||
|
||||
void setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature);
|
||||
RicCommandFeature* activeUiCommandFeature() const;
|
||||
|
||||
public slots:
|
||||
virtual void slotSetCurrentFrame(int frameIndex);
|
||||
virtual void slotEndAnimation();
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RicGeoMechPropertyFilterNewExec.h"
|
||||
#include "RicRangeFilterNewExec.h"
|
||||
|
||||
#include "CrossSectionCommands/RicNewPolylineCrossSectionFeature.h"
|
||||
#include "CrossSectionCommands/RicNewSimWellCrossSectionFeature.h"
|
||||
#include "CrossSectionCommands/RicNewWellPathCrossSectionFeature.h"
|
||||
#include "WellLogCommands/RicNewWellLogCurveExtractionFeature.h"
|
||||
@ -277,6 +278,8 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
commandIds << "RicSetMasterViewFeature";
|
||||
}
|
||||
|
||||
commandIds << "RicNewPolylineCrossSectionFeature";
|
||||
|
||||
RimContextCommandBuilder::appendCommandsToMenu(commandIds, &menu);
|
||||
|
||||
if (menu.actions().size() > 0)
|
||||
@ -439,6 +442,17 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
|
||||
if (m_viewer->rayPick(winPosX, winPosY, &hitItems))
|
||||
{
|
||||
extractIntersectionData(hitItems, &localIntersectionPoint, &firstHitPart, &firstPartTriangleIndex, &firstNncHitPart, &nncPartTriangleIndex);
|
||||
|
||||
if (!m_activeUiCommandFeature.isNull())
|
||||
{
|
||||
cvf::ref<RicPolylineUiEvent> uiEventObj = new RicPolylineUiEvent(localIntersectionPoint);
|
||||
|
||||
if (m_activeUiCommandFeature->handleUiEvent(uiEventObj.p()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
updateSelectionFromPickedPart(firstHitPart);
|
||||
}
|
||||
|
||||
@ -564,6 +578,22 @@ void RiuViewerCommands::findCellAndGridIndex(const RivCrossSectionSourceInfo* cr
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewerCommands::setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature)
|
||||
{
|
||||
m_activeUiCommandFeature = uiCommandFeature;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicCommandFeature* RiuViewerCommands::activeUiCommandFeature() const
|
||||
{
|
||||
return m_activeUiCommandFeature;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Perform picking and return the index of the face that was hit, if a drawable geo was hit
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -31,6 +31,7 @@ class RimGeoMechView;
|
||||
class RimView;
|
||||
class RiuViewer;
|
||||
class RivCrossSectionSourceInfo;
|
||||
class RicCommandFeature;
|
||||
|
||||
class QMouseEvent;
|
||||
|
||||
@ -54,6 +55,9 @@ public:
|
||||
|
||||
void findCellAndGridIndex(const RivCrossSectionSourceInfo* crossSectionSourceInfo, cvf::uint firstPartTriangleIndex, size_t* cellIndex, size_t* gridIndex);
|
||||
|
||||
void setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature);
|
||||
RicCommandFeature* activeUiCommandFeature() const;
|
||||
|
||||
|
||||
private slots:
|
||||
void slotRangeFilterI();
|
||||
@ -78,6 +82,8 @@ private:
|
||||
caf::PdmPointer<RimCrossSection> m_currentCrossSection;
|
||||
|
||||
QPointer<RiuViewer> m_viewer;
|
||||
|
||||
QPointer<RicCommandFeature> m_activeUiCommandFeature;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user