mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add seismic 3d view (#10472)
* Show seismic, surfaces, annotations and wellpaths in new view not requiring a grid loaded first.
This commit is contained in:
@@ -209,7 +209,7 @@ size_t RimAnnotationCollection::lineBasedAnnotationsCount() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationCollection::updateViewAnnotationCollections()
|
||||
{
|
||||
auto views = gridViewsContainingAnnotations();
|
||||
auto views = viewsContainingAnnotations();
|
||||
|
||||
for ( const auto* view : views )
|
||||
{
|
||||
|
||||
@@ -115,9 +115,7 @@ void RimAnnotationCollectionBase::onAnnotationDeleted()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationCollectionBase::scheduleRedrawOfRelevantViews()
|
||||
{
|
||||
// Todo: Do a Bounding Box check to see if this annotation actually is relevant for the view
|
||||
|
||||
auto views = gridViewsContainingAnnotations();
|
||||
auto views = viewsContainingAnnotations();
|
||||
if ( !views.empty() )
|
||||
{
|
||||
for ( auto& view : views )
|
||||
@@ -130,19 +128,13 @@ void RimAnnotationCollectionBase::scheduleRedrawOfRelevantViews()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimGridView*> RimAnnotationCollectionBase::gridViewsContainingAnnotations() const
|
||||
std::vector<Rim3dView*> RimAnnotationCollectionBase::viewsContainingAnnotations() const
|
||||
{
|
||||
RimProject* project = RimProject::current();
|
||||
if ( !project ) return {};
|
||||
|
||||
std::vector<RimGridView*> views;
|
||||
std::vector<RimGridView*> visibleGridViews;
|
||||
project->allVisibleGridViews( visibleGridViews );
|
||||
|
||||
for ( auto& gridView : visibleGridViews )
|
||||
{
|
||||
views.push_back( gridView );
|
||||
}
|
||||
std::vector<Rim3dView*> views;
|
||||
project->allViews( views );
|
||||
return views;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class QString;
|
||||
class RimTextAnnotation;
|
||||
class RimAnnotationGroupCollection;
|
||||
class RimGridView;
|
||||
class Rim3dView;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
virtual void updateViewAnnotationCollections();
|
||||
virtual void onAnnotationDeleted();
|
||||
|
||||
void scheduleRedrawOfRelevantViews();
|
||||
std::vector<RimGridView*> gridViewsContainingAnnotations() const;
|
||||
void scheduleRedrawOfRelevantViews();
|
||||
std::vector<Rim3dView*> viewsContainingAnnotations() const;
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
@@ -112,9 +112,7 @@ void RimAnnotationGroupCollection::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
if ( changedField == &m_isActive )
|
||||
{
|
||||
updateUiIconFromToggleField();
|
||||
|
||||
auto coll = firstAncestorOrThisOfType<RimAnnotationCollectionBase>();
|
||||
if ( coll ) coll->scheduleRedrawOfRelevantViews();
|
||||
updateViews();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,3 +123,21 @@ caf::PdmFieldHandle* RimAnnotationGroupCollection::objectToggleField()
|
||||
{
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationGroupCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects )
|
||||
{
|
||||
updateViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationGroupCollection::updateViews()
|
||||
{
|
||||
auto coll = firstAncestorOrThisOfType<RimAnnotationCollectionBase>();
|
||||
if ( coll ) coll->scheduleRedrawOfRelevantViews();
|
||||
}
|
||||
|
||||
@@ -58,6 +58,10 @@ public:
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||
|
||||
private:
|
||||
void updateViews();
|
||||
|
||||
protected:
|
||||
caf::PdmField<bool> m_isActive;
|
||||
|
||||
Reference in New Issue
Block a user