mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#4969 Fix Well path and annotation draggers not visible and does not work in comparison view
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+21
-6
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user