mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#657) Added poly line access function and cross section direction
This commit is contained in:
parent
6ca980385c
commit
91e159810c
@ -21,6 +21,8 @@
|
||||
|
||||
#include "RimCrossSection.h"
|
||||
#include "RimCrossSectionCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
@ -30,8 +32,6 @@
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseWell.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewSimWellCrossSectionFeature, "RicNewSimWellCrossSectionFeature");
|
||||
|
||||
@ -58,7 +58,7 @@ void RicNewSimWellCrossSectionFeature::onActionTriggered(bool isChecked)
|
||||
eclWell->firstAnchestorOrThisOfType(eclView);
|
||||
CVF_ASSERT(eclView);
|
||||
|
||||
RicNewWellPathCrossSectionFeatureCmd* cmd = new RicNewWellPathCrossSectionFeatureCmd(eclView->crossSectionCollection, eclWell);
|
||||
RicNewSimWellCrossSectionCmd* cmd = new RicNewSimWellCrossSectionCmd(eclView->crossSectionCollection, eclWell);
|
||||
caf::CmdExecCommandManager::instance()->processExecuteCommand(cmd);
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ void RicNewSimWellCrossSectionFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicNewWellPathCrossSectionFeatureCmd::RicNewWellPathCrossSectionFeatureCmd(RimCrossSectionCollection* crossSectionCollection, RimEclipseWell* simWell)
|
||||
RicNewSimWellCrossSectionCmd::RicNewSimWellCrossSectionCmd(RimCrossSectionCollection* crossSectionCollection, RimEclipseWell* simWell)
|
||||
: CmdExecuteCommand(NULL),
|
||||
m_crossSectionCollection(crossSectionCollection),
|
||||
m_wellPath(simWell)
|
||||
@ -84,14 +84,14 @@ RicNewWellPathCrossSectionFeatureCmd::RicNewWellPathCrossSectionFeatureCmd(RimCr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicNewWellPathCrossSectionFeatureCmd::~RicNewWellPathCrossSectionFeatureCmd()
|
||||
RicNewSimWellCrossSectionCmd::~RicNewSimWellCrossSectionCmd()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicNewWellPathCrossSectionFeatureCmd::name()
|
||||
QString RicNewSimWellCrossSectionCmd::name()
|
||||
{
|
||||
return "Create Cross Section From Well";
|
||||
}
|
||||
@ -99,14 +99,14 @@ QString RicNewWellPathCrossSectionFeatureCmd::name()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathCrossSectionFeatureCmd::redo()
|
||||
void RicNewSimWellCrossSectionCmd::redo()
|
||||
{
|
||||
CVF_ASSERT(m_crossSectionCollection);
|
||||
CVF_ASSERT(m_wellPath);
|
||||
|
||||
RimCrossSection* crossSection = new RimCrossSection();
|
||||
crossSection->name = m_wellPath->name;
|
||||
crossSection->crossSectionType = RimCrossSection::CS_SIMULATION_WELL;
|
||||
crossSection->type = RimCrossSection::CS_SIMULATION_WELL;
|
||||
crossSection->simulationWell = m_wellPath;
|
||||
|
||||
m_crossSectionCollection->crossSections.push_back(crossSection);
|
||||
@ -118,6 +118,6 @@ void RicNewWellPathCrossSectionFeatureCmd::redo()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathCrossSectionFeatureCmd::undo()
|
||||
void RicNewSimWellCrossSectionCmd::undo()
|
||||
{
|
||||
}
|
||||
|
@ -30,11 +30,11 @@ class RimEclipseWell;
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewWellPathCrossSectionFeatureCmd : public caf::CmdExecuteCommand
|
||||
class RicNewSimWellCrossSectionCmd : public caf::CmdExecuteCommand
|
||||
{
|
||||
public:
|
||||
RicNewWellPathCrossSectionFeatureCmd(RimCrossSectionCollection* crossSectionCollection, RimEclipseWell* simWell);
|
||||
virtual ~RicNewWellPathCrossSectionFeatureCmd();
|
||||
RicNewSimWellCrossSectionCmd(RimCrossSectionCollection* crossSectionCollection, RimEclipseWell* simWell);
|
||||
virtual ~RicNewSimWellCrossSectionCmd();
|
||||
|
||||
virtual QString name();
|
||||
virtual void redo();
|
||||
|
@ -107,7 +107,7 @@ void RicNewWellPathCrossSectionFeatureCmd::redo()
|
||||
|
||||
RimCrossSection* crossSection = new RimCrossSection();
|
||||
crossSection->name = m_wellPath->name;
|
||||
crossSection->crossSectionType = RimCrossSection::CS_WELL_PATH;
|
||||
crossSection->type = RimCrossSection::CS_WELL_PATH;
|
||||
crossSection->wellPath = m_wellPath;
|
||||
|
||||
m_crossSectionCollection->crossSections.push_back(crossSection);
|
||||
|
@ -35,12 +35,20 @@ namespace caf {
|
||||
template<>
|
||||
void caf::AppEnum< RimCrossSection::CrossSectionEnum >::setUp()
|
||||
{
|
||||
addItem(RimCrossSection::CS_WELL_PATH, "WELL_PATH", "Well Path");
|
||||
addItem(RimCrossSection::CS_SIMULATION_WELL, "SIMULATION_WELL", "Simulation Well");
|
||||
addItem(RimCrossSection::CS_USER_DEFINED, "USER_DEFINED", "User defined");
|
||||
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");
|
||||
setDefault(RimCrossSection::CS_WELL_PATH);
|
||||
}
|
||||
|
||||
template<>
|
||||
void caf::AppEnum< RimCrossSection::CrossSectionDirEnum >::setUp()
|
||||
{
|
||||
addItem(RimCrossSection::CS_VERTICAL, "CS_VERTICAL", "Vertical");
|
||||
addItem(RimCrossSection::CS_HORIZONTAL, "CS_HORIZONTAL", "Horizontal");
|
||||
setDefault(RimCrossSection::CS_VERTICAL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -57,9 +65,10 @@ RimCrossSection::RimCrossSection()
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
isActive.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&wellPath, "WellPath", "Well Path", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&simulationWell, "SimulationWell", "Simulation Well", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&crossSectionType, "CrossSectionType", "Type", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&wellPath, "WellPath", "Well Path", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&simulationWell, "SimulationWell", "Simulation Well", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&type, "Type", "Type", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&direction, "Direction", "Direction", "", "", "");
|
||||
|
||||
uiCapability()->setUiChildrenHidden(true);
|
||||
}
|
||||
@ -78,13 +87,14 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
void RimCrossSection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&name);
|
||||
uiOrdering.add(&crossSectionType);
|
||||
uiOrdering.add(&type);
|
||||
uiOrdering.add(&direction);
|
||||
|
||||
if (crossSectionType == CS_WELL_PATH)
|
||||
if (type == CS_WELL_PATH)
|
||||
{
|
||||
uiOrdering.add(&wellPath);
|
||||
}
|
||||
else if (crossSectionType == CS_SIMULATION_WELL)
|
||||
else if (type == CS_SIMULATION_WELL)
|
||||
{
|
||||
uiOrdering.add(&simulationWell);
|
||||
}
|
||||
@ -177,3 +187,29 @@ RimEclipseWellCollection* RimCrossSection::simulationWellCollection()
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector< std::vector <cvf::Vec3d> > RimCrossSection::polyLines() const
|
||||
{
|
||||
std::vector< std::vector <cvf::Vec3d> > line;
|
||||
if (type == CS_WELL_PATH)
|
||||
{
|
||||
if (wellPath)
|
||||
{
|
||||
line.push_back(wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||
}
|
||||
}
|
||||
else if (type == CS_SIMULATION_WELL)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,12 @@
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
class RimWellPath;
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
class RimEclipseWell;
|
||||
class RimEclipseWellCollection;
|
||||
class RimWellPath;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@ -46,24 +49,32 @@ public:
|
||||
CS_USER_DEFINED
|
||||
};
|
||||
|
||||
enum CrossSectionDirEnum
|
||||
{
|
||||
CS_VERTICAL,
|
||||
CS_HORIZONTAL
|
||||
};
|
||||
|
||||
public:
|
||||
RimCrossSection();
|
||||
|
||||
caf::PdmField<QString> name;
|
||||
caf::PdmField<bool> isActive;
|
||||
caf::PdmField< caf::AppEnum< CrossSectionEnum > > crossSectionType;
|
||||
|
||||
caf::PdmField< caf::AppEnum< CrossSectionEnum > > type;
|
||||
caf::PdmField< caf::AppEnum< CrossSectionDirEnum > > direction;
|
||||
|
||||
caf::PdmPtrField<RimWellPath*> wellPath;
|
||||
caf::PdmPtrField<RimEclipseWell*> simulationWell;
|
||||
|
||||
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
// virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
// virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName);
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user