2015-08-25 12:40:55 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-08-25 12:40:55 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2015-08-25 12:40:55 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-08-25 12:40:55 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-09-23 12:23:21 +02:00
|
|
|
#include "RivCellSetEnum.h"
|
|
|
|
|
|
2015-08-25 12:40:55 +02:00
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
|
#include "cafPdmObject.h"
|
2015-09-01 17:14:22 +02:00
|
|
|
#include "cafPdmPtrField.h"
|
2015-09-23 12:23:21 +02:00
|
|
|
|
2016-12-15 18:20:43 +01:00
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
2019-05-06 10:36:05 +02:00
|
|
|
namespace caf
|
|
|
|
|
{
|
2020-05-09 11:25:11 +02:00
|
|
|
class IconProvider;
|
2019-05-06 10:36:05 +02:00
|
|
|
}
|
|
|
|
|
|
2015-09-23 12:23:21 +02:00
|
|
|
namespace cvf
|
|
|
|
|
{
|
2019-05-06 10:36:05 +02:00
|
|
|
class BoundingBox;
|
2015-09-23 12:23:21 +02:00
|
|
|
}
|
2015-08-25 12:40:55 +02:00
|
|
|
|
2015-09-24 11:29:01 +02:00
|
|
|
class RimViewController;
|
2015-08-25 12:40:55 +02:00
|
|
|
class RiuViewer;
|
2018-01-15 14:52:22 +01:00
|
|
|
class RimGridView;
|
2015-10-19 12:10:18 +02:00
|
|
|
class RimCellRangeFilter;
|
2018-10-23 16:32:40 +02:00
|
|
|
class RimPropertyFilter;
|
2015-08-25 12:40:55 +02:00
|
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
|
|
|
|
///
|
2015-08-25 12:40:55 +02:00
|
|
|
//==================================================================================================
|
2015-09-07 14:29:46 +02:00
|
|
|
class RimViewLinker : public caf::PdmObject
|
2015-08-25 12:40:55 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_HEADER_INIT;
|
2015-08-25 12:40:55 +02:00
|
|
|
|
|
|
|
|
public:
|
2018-09-12 13:46:03 +02:00
|
|
|
RimViewLinker();
|
2018-10-18 19:45:57 +02:00
|
|
|
~RimViewLinker() override;
|
2015-09-01 17:14:22 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
bool isActive() const;
|
|
|
|
|
|
|
|
|
|
void setMasterView( RimGridView* view );
|
|
|
|
|
RimGridView* masterView() const;
|
|
|
|
|
void addDependentView( RimGridView* view );
|
|
|
|
|
bool isFirstViewDependentOnSecondView( const RimGridView* firstView, const RimGridView* secondView ) const;
|
|
|
|
|
void updateDependentViews();
|
|
|
|
|
void removeViewController( RimViewController* viewController );
|
2019-10-28 17:13:18 +01:00
|
|
|
RimGridView* firstControlledView();
|
2015-08-25 12:40:55 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateOverrides();
|
2015-10-22 16:02:28 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateCamera( RimGridView* sourceView );
|
|
|
|
|
void updateTimeStep( RimGridView* sourceView, int timeStep );
|
|
|
|
|
void updateScaleZ( RimGridView* sourceView, double scaleZ );
|
2015-08-27 13:44:27 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateCellResult();
|
2016-12-09 20:36:31 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateRangeFilters( RimCellRangeFilter* changedRangeFilter );
|
|
|
|
|
void applyRangeFilterCollectionByUserChoice();
|
2015-08-28 08:01:40 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updatePropertyFilters( RimPropertyFilter* changedPropertyFilter );
|
2018-10-23 16:32:40 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void scheduleGeometryRegenForDepViews( RivCellSetEnum geometryType );
|
|
|
|
|
void scheduleCreateDisplayModelAndRedrawForDependentViews();
|
2015-08-28 21:05:56 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void allViews( std::vector<RimGridView*>& views ) const;
|
2015-09-13 08:54:32 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateUiNameAndIcon();
|
2015-09-24 14:29:13 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void addViewControllers( caf::PdmUiTreeOrdering& uiTreeOrdering ) const;
|
2015-09-15 09:47:59 +02:00
|
|
|
|
2020-05-09 11:25:11 +02:00
|
|
|
static void findNameAndIconFromView( QString* name, caf::IconProvider* icon, RimGridView* view );
|
2015-09-08 10:17:35 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void updateCursorPosition( const RimGridView* sourceView, const cvf::Vec3d& domainCoord );
|
2016-12-15 18:20:43 +01:00
|
|
|
|
2019-11-04 11:34:34 +01:00
|
|
|
void notifyManagedViewChange( RimGridView* oldManagedView, RimGridView* newManagedView );
|
2019-10-23 15:17:58 +02:00
|
|
|
|
2015-09-01 17:14:22 +02:00
|
|
|
protected:
|
2020-02-12 11:13:38 +01:00
|
|
|
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
|
2019-10-23 15:17:58 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void initAfterRead() override;
|
2020-02-12 11:43:15 +01:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2019-10-23 15:17:58 +02:00
|
|
|
|
|
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
|
bool* useOptionsOnly ) override;
|
|
|
|
|
|
2019-11-04 11:34:34 +01:00
|
|
|
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2015-09-02 13:44:56 +02:00
|
|
|
|
|
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
static QString displayNameForView( RimGridView* view );
|
|
|
|
|
|
|
|
|
|
void allViewsForCameraSync( const RimGridView* source, std::vector<RimGridView*>& views ) const;
|
2018-09-12 13:46:03 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void removeOverrides();
|
2015-09-24 11:29:01 +02:00
|
|
|
|
2015-09-07 14:54:54 +02:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmChildArrayField<RimViewController*> m_viewControllers;
|
|
|
|
|
caf::PdmPtrField<RimGridView*> m_masterView;
|
|
|
|
|
caf::PdmField<QString> m_name;
|
2019-10-23 15:17:58 +02:00
|
|
|
caf::PdmPtrField<RimGridView*> m_comparisonView;
|
2015-08-25 12:40:55 +02:00
|
|
|
};
|