#1499 Use naming based on index "Fishbones 1"

This commit is contained in:
Magne Sjaastad 2017-05-19 10:36:25 +02:00
parent b5f6185dea
commit e67979bd23
2 changed files with 15 additions and 3 deletions

View File

@ -93,6 +93,8 @@ RimFishbonesMultipleSubs::RimFishbonesMultipleSubs()
m_installationRotationAngles.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_fixedInstallationRotationAngle, "FixedInstallationRotationAngle", 0.0, " Fixed Angle [deg]", "", "", "");
m_name.uiCapability()->setUiReadOnly(true);
m_rigFishbonesGeometry = std::unique_ptr<RigFisbonesGeometry>(new RigFisbonesGeometry(this));
}
@ -321,8 +323,6 @@ void RimFishbonesMultipleSubs::computeRangesAndLocations()
//--------------------------------------------------------------------------------------------------
void RimFishbonesMultipleSubs::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_name); // From RimNamedObject
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Location");
@ -434,6 +434,18 @@ void RimFishbonesMultipleSubs::initAfterRead()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFishbonesMultipleSubs::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
caf::PdmChildArrayField<RimFishbonesMultipleSubs*>* container = dynamic_cast<caf::PdmChildArrayField<RimFishbonesMultipleSubs*>*>(this->parentField());
CVF_ASSERT(container);
size_t index = container->index(this);
m_name = QString("Fishbone %1").arg(index);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -72,8 +72,8 @@ public:
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void initAfterRead() override;
private: