#3528 Make Casing Design a child object under well path.

This commit is contained in:
Gaute Lindkvist
2018-10-19 16:29:46 +02:00
parent 2194821609
commit 9abbdb2fd8
7 changed files with 50 additions and 19 deletions

View File

@@ -17,9 +17,11 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RicDeleteWellPathAttributeFeature.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellPathAttribute.h"
#include "RimWellPathAttributeCollection.h"
#include "Riu3DMainWindowTools.h"
#include "cafSelectionManager.h"
#include <QAction>
@@ -60,6 +62,14 @@ void RicDeleteWellPathAttributeFeature::onActionTriggered(bool isChecked)
wellPathAttributeCollection->deleteAttribute(attributeToDelete);
}
wellPathAttributeCollection->updateAllRequiredEditors();
if (wellPathAttributeCollection->attributes().empty())
{
RimWellPath* wellPath = nullptr;
wellPathAttributeCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
wellPath->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem(wellPath);
}
}
}

View File

@@ -17,9 +17,11 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewWellPathAttributeFeature.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellPathAttribute.h"
#include "RimWellPathAttributeCollection.h"
#include "Riu3DMainWindowTools.h"
#include "cafSelectionManager.h"
@@ -86,6 +88,10 @@ void RicNewWellPathAttributeFeature::onActionTriggered(bool isChecked)
attributeCollections[0]->insertAttribute(nullptr, attribute);
attributeCollections[0]->updateAllRequiredEditors();
wellPath->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem(attributeCollections[0]);
}
}
}
@@ -101,12 +107,17 @@ void RicNewWellPathAttributeFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText(QString("Insert New Attribute before %1").arg(attributes[0]->componentTypeLabel()));
actionToSetup->setIcon(QIcon(":/Well.png"));
}
else
}
else if (caf::SelectionManager::instance()->selectedItemOfType<RimWellPathAttributeCollection>())
{
actionToSetup->setText("Append New Attribute");
actionToSetup->setIcon(QIcon(":/Well.png"));
}
else if(caf::SelectionManager::instance()->selectedItemOfType<RimWellPath>())
{
actionToSetup->setText("Create Casing Design");
actionToSetup->setIcon(QIcon(":/Well.png"));
}
}