mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3161 Implement Well path attribute table
This commit is contained in:
parent
69e2ef83af
commit
91088f546a
@ -5,7 +5,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportFileFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathViewerEventHandler.h
|
||||
@ -19,7 +21,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportFileFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathViewerEventHandler.cpp
|
||||
|
@ -0,0 +1,76 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- equinor 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 "RicDeleteWellPathAttributeFeature.h"
|
||||
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicDeleteWellPathAttributeFeature, "RicDeleteWellPathAttributeFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicDeleteWellPathAttributeFeature::isCommandEnabled()
|
||||
{
|
||||
{
|
||||
std::vector<RimWellPathAttribute*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects, caf::SelectionManager::CURRENT);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteWellPathAttributeFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPathAttribute*> attributes;
|
||||
caf::SelectionManager::instance()->objectsByType(&attributes, caf::SelectionManager::CURRENT);
|
||||
if (attributes.size() > 0)
|
||||
{
|
||||
RimWellPathAttributeCollection* wellPathAttributeCollection = nullptr;
|
||||
attributes[0]->firstAncestorOrThisOfTypeAsserted(wellPathAttributeCollection);
|
||||
RimWellPath* wellPath = nullptr;
|
||||
wellPathAttributeCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
for (RimWellPathAttribute* attributeToDelete : attributes)
|
||||
{
|
||||
wellPathAttributeCollection->deleteAttribute(attributeToDelete);
|
||||
}
|
||||
wellPath->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteWellPathAttributeFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Delete Attribute");
|
||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- equinor 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"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicDeleteWellPathAttributeFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -0,0 +1,98 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- equinor 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 "RicNewWellPathAttributeFeature.h"
|
||||
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewWellPathAttributeFeature, "RicNewWellPathAttributeFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellPathAttributeFeature::isCommandEnabled()
|
||||
{
|
||||
{
|
||||
std::vector<RimWellPath*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
{
|
||||
std::vector<RimWellPathAttribute*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects, caf::SelectionManager::CURRENT);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathAttributeFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPathAttribute*> attributes;
|
||||
caf::SelectionManager::instance()->objectsByType(&attributes, caf::SelectionManager::CURRENT);
|
||||
if (attributes.size() > 0)
|
||||
{
|
||||
RimWellPathAttributeCollection* attributeCollection = nullptr;
|
||||
attributes[0]->firstAncestorOrThisOfTypeAsserted(attributeCollection);
|
||||
RimWellPath* wellPath = nullptr;
|
||||
attributeCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
attributes[0]->updateConnectedEditors();
|
||||
attributeCollection->insertAttribute(attributes[0], new RimWellPathAttribute);
|
||||
wellPath->updateConnectedEditors();
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<RimWellPath*> wellPaths;
|
||||
caf::SelectionManager::instance()->objectsByType(&wellPaths);
|
||||
|
||||
if (wellPaths.size() > 0)
|
||||
{
|
||||
std::vector<RimWellPathAttributeCollection*> attributeCollections;
|
||||
wellPaths[0]->descendantsIncludingThisOfType(attributeCollections);
|
||||
if (attributeCollections.size() > 0)
|
||||
{
|
||||
attributeCollections[0]->insertAttribute(nullptr, new RimWellPathAttribute);
|
||||
}
|
||||
wellPaths[0]->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathAttributeFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("New Attribute");
|
||||
actionToSetup->setIcon(QIcon(":/Well.png"));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- equinor 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"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewWellPathAttributeFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -27,6 +27,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.h
|
||||
@ -145,6 +147,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.cpp
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathCompletions.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
@ -115,6 +116,11 @@ RimWellPath::RimWellPath()
|
||||
m_wellLogFile_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||
m_wellLogFile_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellPathAttributes, "WellPathAttributes", "", "", "", "");
|
||||
m_wellPathAttributes = new RimWellPathAttributeCollection;
|
||||
m_wellPathAttributes->uiCapability()->setUiTreeHidden(true);
|
||||
m_wellPathAttributes->uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
m_wellPath = nullptr;
|
||||
}
|
||||
|
||||
@ -463,6 +469,8 @@ void RimWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO
|
||||
formationFileInfoGroup->add(&m_wellPathFormationFilePath);
|
||||
formationFileInfoGroup->add(&m_formationKeyInFile);
|
||||
|
||||
m_wellPathAttributes->uiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ class RimFishboneWellPathCollection;
|
||||
|
||||
class RimFishbonesCollection;
|
||||
class RimPerforationCollection;
|
||||
class RimWellPathAttributeCollection;
|
||||
class RimWellPathCompletions;
|
||||
class RigWellPathFormations;
|
||||
|
||||
@ -152,9 +153,10 @@ private:
|
||||
caf::PdmField<double> m_wellPathRadiusScaleFactor;
|
||||
caf::PdmField<cvf::Color3f> m_wellPathColor;
|
||||
|
||||
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
|
||||
caf::PdmChildField<Rim3dWellLogCurveCollection*> m_3dWellLogCurves;
|
||||
caf::PdmChildField<RimWellPathCompletions*> m_completions;
|
||||
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
|
||||
caf::PdmChildField<Rim3dWellLogCurveCollection*> m_3dWellLogCurves;
|
||||
caf::PdmChildField<RimWellPathCompletions*> m_completions;
|
||||
caf::PdmChildField<RimWellPathAttributeCollection*> m_wellPathAttributes;
|
||||
|
||||
private:
|
||||
|
||||
|
107
ApplicationCode/ProjectDataModel/RimWellPathAttribute.cpp
Normal file
107
ApplicationCode/ProjectDataModel/RimWellPathAttribute.cpp
Normal file
@ -0,0 +1,107 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor 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 "RimWellPathAttribute.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathAttribute, "WellPathAttribute");
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum<RimWellPathAttribute::AttributeType>::setUp()
|
||||
{
|
||||
addItem(RimWellPathAttribute::AttributeCasing, "CASING", "Casing");
|
||||
addItem(RimWellPathAttribute::AttributeLining, "LINING", "Lining");
|
||||
setDefault(RimWellPathAttribute::AttributeCasing);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttribute::RimWellPathAttribute()
|
||||
{
|
||||
CAF_PDM_InitObject("RimWellPathAttribute", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_type, "AttributeType", "Type ", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthStart, "DepthStart", 0.0, "Depth Start", "", "", "");
|
||||
CAF_PDM_InitField(&m_depthEnd, "DepthEnd", 0.0, "Depth End", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_label, "Label", "Label", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttribute::~RimWellPathAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttribute::AttributeType RimWellPathAttribute::type() const
|
||||
{
|
||||
return m_type();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathAttribute::depthStart() const
|
||||
{
|
||||
return m_depthStart();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathAttribute::depthEnd() const
|
||||
{
|
||||
return m_depthEnd();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathAttribute::label() const
|
||||
{
|
||||
return m_label();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
if (changedField == &m_type)
|
||||
{
|
||||
if (m_type() == AttributeCasing)
|
||||
{
|
||||
m_depthEnd = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttribute::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
m_depthEnd.uiCapability()->setUiReadOnly(m_type() == AttributeCasing);
|
||||
}
|
56
ApplicationCode/ProjectDataModel/RimWellPathAttribute.h
Normal file
56
ApplicationCode/ProjectDataModel/RimWellPathAttribute.h
Normal file
@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor 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 "cafAppEnum.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RimWellPathAttribute : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
enum AttributeType
|
||||
{
|
||||
AttributeCasing,
|
||||
AttributeLining
|
||||
};
|
||||
typedef caf::AppEnum<AttributeType> AttributeTypeEnum;
|
||||
|
||||
RimWellPathAttribute();
|
||||
~RimWellPathAttribute();
|
||||
|
||||
AttributeType type() const;
|
||||
double depthStart() const;
|
||||
double depthEnd() const;
|
||||
QString label() const;
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
caf::PdmField<AttributeTypeEnum> m_type;
|
||||
caf::PdmField<double> m_depthStart;
|
||||
caf::PdmField<double> m_depthEnd;
|
||||
caf::PdmField<QString> m_label;
|
||||
};
|
||||
|
@ -0,0 +1,104 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor 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 "RimWellPathAttributeCollection.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafPdmUiTableViewEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathAttributeCollection, "WellPathAttributes");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttributeCollection::RimWellPathAttributeCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("WellPathAttributes", ":/Well.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_attributes, "Attributes", "", "", "", "");
|
||||
m_attributes.uiCapability()->setUiEditorTypeName(caf::PdmUiTableViewEditor::uiEditorTypeName());
|
||||
m_attributes.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_attributes.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
m_attributes.uiCapability()->setCustomContextMenuEnabled(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathAttributeCollection::~RimWellPathAttributeCollection()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPathAttribute*> RimWellPathAttributeCollection::attributes() const
|
||||
{
|
||||
std::vector<RimWellPathAttribute*> attrs;
|
||||
|
||||
for (auto attr : m_attributes)
|
||||
{
|
||||
attrs.push_back(attr.p());
|
||||
}
|
||||
return attrs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::insertAttribute(RimWellPathAttribute* insertBefore, RimWellPathAttribute* attribute)
|
||||
{
|
||||
size_t index = m_attributes.index(insertBefore);
|
||||
if (index < m_attributes.size())
|
||||
m_attributes.insert(index, attribute);
|
||||
else
|
||||
m_attributes.push_back(attribute);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::deleteAttribute(RimWellPathAttribute* attributeToDelete)
|
||||
{
|
||||
m_attributes.removeChildObject(attributeToDelete);
|
||||
delete attributeToDelete;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
||||
QMenu* menu,
|
||||
QWidget* fieldEditorWidget)
|
||||
{
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
menuBuilder << "RicNewWellPathAttributeFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicDeleteWellPathAttributeFeature";
|
||||
|
||||
menuBuilder.appendToMenu(menu);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathAttributeCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* attrGroup = uiOrdering.addNewGroup("Well Path Attributes");
|
||||
attrGroup->add(&m_attributes);
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - Equinor 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 "RimWellPathAttribute.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimWellPathAttributeCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimWellPathAttributeCollection();
|
||||
~RimWellPathAttributeCollection();
|
||||
|
||||
std::vector<RimWellPathAttribute*> attributes() const;
|
||||
void insertAttribute(RimWellPathAttribute* insertBefore, RimWellPathAttribute* attribute);
|
||||
void deleteAttribute(RimWellPathAttribute* attributeToDelete);
|
||||
|
||||
protected:
|
||||
virtual void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
private:
|
||||
caf::PdmChildArrayField<RimWellPathAttribute*> m_attributes;
|
||||
};
|
@ -124,7 +124,7 @@ void RimWellPathGeometryDef::deleteTarget(RimWellPathTarget* targetTodelete)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::appendTarget()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user