2015-08-25 05:40:55 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// 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 "cvfBase.h"
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
2015-09-23 05:23:21 -05:00
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class BoundingBox;
|
|
|
|
}
|
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;
|
2018-01-15 07:52:22 -06:00
|
|
|
class RimGridView;
|
2015-10-19 05:10:18 -05:00
|
|
|
class RimCellRangeFilter;
|
2018-10-23 09:32:40 -05:00
|
|
|
class RimPropertyFilter;
|
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
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
2018-09-12 06:46:03 -05:00
|
|
|
RimViewLinker();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RimViewLinker() override;
|
2015-09-24 10:40:45 -05:00
|
|
|
|
2016-12-15 11:34:42 -06:00
|
|
|
bool isActive() const;
|
2015-09-01 10:14:22 -05:00
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
void setMasterView(RimGridView* view);
|
2018-09-12 06:46:03 -05:00
|
|
|
RimGridView* masterView() const;
|
2018-01-15 07:52:22 -06:00
|
|
|
void addDependentView(RimGridView* view);
|
2018-10-24 04:30:34 -05:00
|
|
|
bool isFirstViewDependentOnSecondView(const RimGridView* firstView, const RimGridView* secondView) const;
|
2015-09-24 07:29:13 -05:00
|
|
|
void updateDependentViews();
|
2015-10-21 05:45:35 -05:00
|
|
|
void removeViewController(RimViewController* viewController);
|
2015-08-25 05:40:55 -05:00
|
|
|
|
2015-10-22 09:02:28 -05:00
|
|
|
void updateOverrides();
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
void updateCamera(RimGridView* sourceView);
|
|
|
|
void updateTimeStep(RimGridView* sourceView, int timeStep);
|
|
|
|
void updateScaleZ(RimGridView* sourceView, double scaleZ);
|
2015-08-27 06:44:27 -05:00
|
|
|
|
2015-09-13 01:54:32 -05:00
|
|
|
void updateCellResult();
|
2016-12-09 13:36:31 -06:00
|
|
|
|
2015-10-19 05:10:18 -05:00
|
|
|
void updateRangeFilters(RimCellRangeFilter* changedRangeFilter);
|
2015-10-21 05:45:35 -05:00
|
|
|
void applyRangeFilterCollectionByUserChoice();
|
2015-08-28 01:01:40 -05:00
|
|
|
|
2018-10-23 09:32:40 -05:00
|
|
|
void updatePropertyFilters(RimPropertyFilter* changedPropertyFilter);
|
|
|
|
|
2015-09-13 01:54:32 -05:00
|
|
|
void scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType);
|
|
|
|
void scheduleCreateDisplayModelAndRedrawForDependentViews();
|
2015-08-28 14:05:56 -05:00
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
void allViews(std::vector<RimGridView*>& views) const;
|
2015-09-13 01:54:32 -05:00
|
|
|
|
2015-09-24 07:29:13 -05:00
|
|
|
void updateUiNameAndIcon();
|
|
|
|
|
2016-12-15 11:34:42 -06:00
|
|
|
void addViewControllers(caf::PdmUiTreeOrdering& uiTreeOrdering) const;
|
2015-09-15 02:47:59 -05:00
|
|
|
|
|
|
|
static void applyIconEnabledState(caf::PdmObject* obj, const QIcon& icon, bool disable);
|
2018-01-15 07:52:22 -06:00
|
|
|
static void findNameAndIconFromView(QString* name, QIcon* icon, RimGridView* view);
|
2015-09-08 03:17:35 -05:00
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
void updateCursorPosition(const RimGridView* sourceView, const cvf::Vec3d& domainCoord);
|
2016-12-15 11:20:43 -06:00
|
|
|
|
2015-09-01 10:14:22 -05:00
|
|
|
protected:
|
2018-09-12 06:46:03 -05:00
|
|
|
caf::PdmFieldHandle* userDescriptionField() override { return &m_name; }
|
|
|
|
void initAfterRead() override;
|
2015-09-02 06:44:56 -05:00
|
|
|
|
|
|
|
private:
|
2018-09-12 06:46:03 -05:00
|
|
|
static QString displayNameForView(RimGridView* view);
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
void allViewsForCameraSync(const RimGridView* source, std::vector<RimGridView*>& views) const;
|
2015-09-24 07:29:13 -05:00
|
|
|
|
|
|
|
void removeOverrides();
|
2015-09-24 04:29:01 -05:00
|
|
|
|
2015-09-07 07:54:54 -05:00
|
|
|
private:
|
2015-10-20 04:13:31 -05:00
|
|
|
caf::PdmChildArrayField<RimViewController*> m_viewControllers;
|
2018-09-12 06:46:03 -05:00
|
|
|
caf::PdmPtrField<RimGridView*> m_masterView;
|
2015-09-24 07:29:13 -05:00
|
|
|
caf::PdmField<QString> m_name;
|
|
|
|
QIcon m_originalIcon;
|
2015-08-25 05:40:55 -05:00
|
|
|
};
|