#4969 Fix Well path and annotation draggers not visible and does not work in comparison view

This commit is contained in:
Jacob Støren
2019-11-06 14:13:01 +01:00
parent 904808394b
commit 277f8c8b7a
17 changed files with 173 additions and 78 deletions
@@ -64,9 +64,11 @@ PdmUi3dObjectEditorHandle::~PdmUi3dObjectEditorHandle()
/// to be cast able to whatever is needed in subclasses.
/// Not allowed to change. Should be constructor argument, but makes factory stuff difficult.
//--------------------------------------------------------------------------------------------------
void PdmUi3dObjectEditorHandle::setViewer(QWidget* ownerViewer)
void PdmUi3dObjectEditorHandle::setViewer(QWidget* ownerViewer, bool inComparisonView)
{
CAF_ASSERT(m_ownerViewer.isNull());
m_ownerViewer = ownerViewer;
m_isInComparisonView = inComparisonView;
}
}
}
@@ -75,14 +75,15 @@ public:
PdmUi3dObjectEditorHandle();
~PdmUi3dObjectEditorHandle() override;
void setViewer(QWidget* ownerViewer);
void setViewer(QWidget* ownerViewer, bool isInComparisonView);
protected:
QWidget* ownerViewer() const { return m_ownerViewer;}
bool isInComparisonView() const { return m_isInComparisonView; }
private:
QPointer<QWidget> m_ownerViewer;
QPointer<QWidget> m_ownerViewer;
bool m_isInComparisonView;
};
}
@@ -109,13 +109,28 @@ void PdmUiSelection3dEditorVisualizer::onSelectionManagerSelectionChanged( const
if (!editor3dTypeName.isEmpty())
{
PdmObjectHandle* itemObject = dynamic_cast<PdmObjectHandle*>(item);
if (itemObject)
if ( itemObject )
{
PdmUi3dObjectEditorHandle* editor3d = caf::Factory<PdmUi3dObjectEditorHandle, QString>::instance()->create(editor3dTypeName);
editor3d->setViewer(m_ownerViewer);
editor3d->setPdmObject(itemObject);
m_active3DEditors.emplace_back(editor3d);
editor3d->updateUi();
// Editor in main view
{
PdmUi3dObjectEditorHandle* editor3d = caf::Factory<PdmUi3dObjectEditorHandle, QString>::instance()->create(editor3dTypeName);
editor3d->setViewer(m_ownerViewer, false);
editor3d->setPdmObject(itemObject);
m_active3DEditors.emplace_back(editor3d);
editor3d->updateUi();
}
QVariant isComparisonActive = m_ownerViewer->property("cafViewer_IsComparisonViewActive");
// Editor in comparison view
if (!isComparisonActive.isNull() && isComparisonActive.isValid() && isComparisonActive.toBool())
{
PdmUi3dObjectEditorHandle* editor3d = caf::Factory<PdmUi3dObjectEditorHandle, QString>::instance()->create(editor3dTypeName);
editor3d->setViewer(m_ownerViewer, true);
editor3d->setPdmObject(itemObject);
m_active3DEditors.emplace_back(editor3d);
editor3d->updateUi();
}
}
}
}