2015-08-25 05:40:55 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-08-25 05:40:55 -05: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 03:40:57 -05:00
|
|
|
//
|
2015-08-25 05:40:55 -05: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 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-08-25 05:40:55 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-09-23 05:23:21 -05:00
|
|
|
#include "RivCellSetEnum.h"
|
|
|
|
|
2015-08-25 05:40:55 -05:00
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
2015-09-01 10:14:22 -05:00
|
|
|
#include "cafPdmPtrField.h"
|
2015-09-23 05:23:21 -05:00
|
|
|
|
2016-12-15 11:20:43 -06:00
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
2020-05-09 04:25:11 -05:00
|
|
|
class IconProvider;
|
2019-05-06 03:36:05 -05:00
|
|
|
}
|
|
|
|
|
2015-09-23 05:23:21 -05:00
|
|
|
namespace cvf
|
|
|
|
{
|
2019-05-06 03:36:05 -05:00
|
|
|
class BoundingBox;
|
2015-09-23 05:23:21 -05:00
|
|
|
}
|
2015-08-25 05:40:55 -05:00
|
|
|
|
2015-09-24 04:29:01 -05:00
|
|
|
class RimViewController;
|
2015-08-25 05:40:55 -05:00
|
|
|
class RiuViewer;
|
2022-11-24 03:46:54 -06:00
|
|
|
class Rim3dView;
|
2021-01-11 11:47:09 -06:00
|
|
|
class RimCellFilter;
|
2018-10-23 09:32:40 -05:00
|
|
|
class RimPropertyFilter;
|
2015-08-25 05:40:55 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
|
|
|
///
|
2015-08-25 05:40:55 -05:00
|
|
|
//==================================================================================================
|
2015-09-07 07:29:46 -05:00
|
|
|
class RimViewLinker : public caf::PdmObject
|
2015-08-25 05:40:55 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_HEADER_INIT;
|
2015-08-25 05:40:55 -05:00
|
|
|
|
|
|
|
public:
|
2018-09-12 06:46:03 -05:00
|
|
|
RimViewLinker();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RimViewLinker() override;
|
2015-09-01 10:14:22 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool isActive() const;
|
|
|
|
|
2022-11-24 03:46:54 -06:00
|
|
|
void setMasterView( Rim3dView* view );
|
|
|
|
Rim3dView* masterView() const;
|
|
|
|
void addDependentView( Rim3dView* view );
|
|
|
|
bool isFirstViewDependentOnSecondView( const Rim3dView* firstView, const Rim3dView* secondView ) const;
|
|
|
|
void updateDependentViews();
|
|
|
|
void removeViewController( RimViewController* viewController );
|
|
|
|
Rim3dView* firstControlledView();
|
2015-08-25 05:40:55 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void updateOverrides();
|
2022-10-31 04:41:50 -05:00
|
|
|
void updateWindowTitles();
|
2022-11-28 07:34:26 -06:00
|
|
|
void updateDuplicatedPropertyFilters();
|
2015-10-22 09:02:28 -05:00
|
|
|
|
2022-11-24 03:46:54 -06:00
|
|
|
void updateCamera( Rim3dView* sourceView );
|
|
|
|
void updateTimeStep( Rim3dView* sourceView, int timeStep );
|
|
|
|
void updateScaleZ( Rim3dView* sourceView, double scaleZ );
|
2015-08-27 06:44:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void updateCellResult();
|
2016-12-09 13:36:31 -06:00
|
|
|
|
2021-01-11 11:47:09 -06:00
|
|
|
void updateCellFilters( const RimCellFilter* changedFilter );
|
|
|
|
void applyCellFilterCollectionByUserChoice();
|
2015-08-28 01:01:40 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void updatePropertyFilters( RimPropertyFilter* changedPropertyFilter );
|
2018-10-23 09:32:40 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void scheduleGeometryRegenForDepViews( RivCellSetEnum geometryType );
|
|
|
|
void scheduleCreateDisplayModelAndRedrawForDependentViews();
|
2015-08-28 14:05:56 -05:00
|
|
|
|
2022-11-24 03:46:54 -06:00
|
|
|
std::vector<Rim3dView*> allViews() const;
|
2015-09-13 01:54:32 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void updateUiNameAndIcon();
|
2015-09-24 07:29:13 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void addViewControllers( caf::PdmUiTreeOrdering& uiTreeOrdering ) const;
|
2015-09-15 02:47:59 -05:00
|
|
|
|
2022-11-24 03:46:54 -06:00
|
|
|
static void findNameAndIconFromView( QString* name, caf::IconProvider* icon, Rim3dView* view );
|
2015-09-08 03:17:35 -05:00
|
|
|
|
2022-11-24 03:46:54 -06:00
|
|
|
void updateCursorPosition( const Rim3dView* sourceView, const cvf::Vec3d& domainCoord );
|
2019-10-23 08:17:58 -05:00
|
|
|
|
2015-09-01 10:14:22 -05:00
|
|
|
protected:
|
2020-02-12 04:13:38 -06:00
|
|
|
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
|
2019-10-23 08:17:58 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void initAfterRead() override;
|
2019-10-23 08:17:58 -05:00
|
|
|
|
2022-05-29 06:01:27 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
2022-11-24 03:46:54 -06:00
|
|
|
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
|
|
|
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
2015-09-02 06:44:56 -05:00
|
|
|
|
|
|
|
private:
|
2022-11-24 03:46:54 -06:00
|
|
|
static QString displayNameForView( Rim3dView* view );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2022-11-24 03:46:54 -06:00
|
|
|
void allViewsForCameraSync( const Rim3dView* source, std::vector<Rim3dView*>& views ) const;
|
2018-09-12 06:46:03 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void removeOverrides();
|
2022-11-04 09:48:25 -05:00
|
|
|
void updateScaleWidgetVisibility();
|
2015-09-24 04:29:01 -05:00
|
|
|
|
2015-09-07 07:54:54 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmChildArrayField<RimViewController*> m_viewControllers;
|
2022-11-24 03:46:54 -06:00
|
|
|
caf::PdmPtrField<Rim3dView*> m_masterView;
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmField<QString> m_name;
|
2015-08-25 05:40:55 -05:00
|
|
|
};
|