diff --git a/ApplicationCode/Commands/WellPathCommands/RicNewEditableWellPathFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicNewEditableWellPathFeature.cpp index 347d279f9c..4d646ad04f 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicNewEditableWellPathFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicNewEditableWellPathFeature.cpp @@ -68,7 +68,7 @@ void RicNewEditableWellPathFeature::onActionTriggered(bool isChecked) { std::vector newWellPaths; newWellPaths.push_back(new RimModeledWellPath()); - newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->wellPaths.size())); + newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->modelledWellPathCount()+1)); wellPathCollection->addWellPaths(newWellPaths); wellPathCollection->uiCapability()->updateConnectedEditors(); wellPathCollection->scheduleRedrawAffectedViews(); diff --git a/ApplicationCode/ProjectDataModel/RimModeledWellPath.cpp b/ApplicationCode/ProjectDataModel/RimModeledWellPath.cpp index c008d254e6..d9edec721a 100644 --- a/ApplicationCode/ProjectDataModel/RimModeledWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimModeledWellPath.cpp @@ -36,7 +36,6 @@ RimModeledWellPath::RimModeledWellPath() CAF_PDM_InitObject("Modeled WellPath", ":/Well.png", "", ""); CAF_PDM_InitFieldNoDefault(&m_geometryDefinition, "WellPathGeometryDef", "Trajectory", "", "", ""); - //m_geometryDefinition.uiCapability()->setUiHidden(true); m_geometryDefinition = new RimWellPathGeometryDef; m_name.uiCapability()->setUiReadOnly(false); diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index ba3133f345..6ae1b57501 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -448,6 +448,22 @@ bool RimWellPathCollection::anyWellsContainingPerforationIntervals() const return false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t RimWellPathCollection::modelledWellPathCount() const +{ + size_t count = 0; + for (size_t wellPathIdx = 0; wellPathIdx < wellPaths.size(); wellPathIdx++) + { + if (dynamic_cast( wellPaths[wellPathIdx])) + { + count++; + } + } + return count; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h index 54d4ad682a..7af0befcff 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h @@ -109,7 +109,7 @@ public: void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath); bool anyWellsContainingPerforationIntervals() const; - + size_t modelledWellPathCount() const; protected: virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;