2015-04-29 10:50:25 +02: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-07-31 18:58:23 +02:00
|
|
|
#include "cafAppEnum.h"
|
2015-08-25 12:40:55 +02:00
|
|
|
#include "cafPdmChildArrayField.h"
|
2015-07-31 18:58:23 +02:00
|
|
|
#include "cafPdmChildField.h"
|
2015-04-29 22:19:49 +02:00
|
|
|
#include "cafPdmField.h"
|
|
|
|
|
#include "cafPdmFieldCvfColor.h"
|
|
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
2016-08-16 14:34:37 +02:00
|
|
|
#include "cafPdmFieldCvfVec3d.h"
|
2015-07-31 18:58:23 +02:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
|
2015-06-18 19:22:24 +02:00
|
|
|
#include "RivCellSetEnum.h"
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2016-05-24 10:37:10 +02:00
|
|
|
#include "RimViewWindow.h"
|
|
|
|
|
|
2015-09-14 16:14:44 +02:00
|
|
|
#include "cvfArray.h"
|
|
|
|
|
#include "cvfBase.h"
|
2015-11-16 11:30:03 +01:00
|
|
|
#include "cvfCollection.h"
|
2015-09-14 16:14:44 +02:00
|
|
|
#include "cvfObject.h"
|
|
|
|
|
|
2015-07-31 18:58:23 +02:00
|
|
|
#include <QPointer>
|
|
|
|
|
|
2016-05-24 10:37:10 +02:00
|
|
|
|
2015-04-29 22:19:49 +02:00
|
|
|
class Rim3dOverlayInfoConfig;
|
2015-05-20 12:29:01 +02:00
|
|
|
class RimCase;
|
2015-10-19 12:10:18 +02:00
|
|
|
class RimCellRangeFilter;
|
2015-06-05 10:05:40 +02:00
|
|
|
class RimCellRangeFilterCollection;
|
2016-09-21 10:52:16 +02:00
|
|
|
class RimIntersectionCollection;
|
2016-09-20 12:03:26 +02:00
|
|
|
class RimGridCollection;
|
2015-11-27 12:17:50 +01:00
|
|
|
class RimPropertyFilterCollection;
|
|
|
|
|
class RimViewController;
|
|
|
|
|
class RimViewLinker;
|
|
|
|
|
class RiuViewer;
|
2017-06-21 15:39:59 +02:00
|
|
|
class RimWellPathCollection;
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2015-05-13 22:42:11 +02:00
|
|
|
namespace cvf
|
|
|
|
|
{
|
2015-06-11 13:44:21 +02:00
|
|
|
class BoundingBox;
|
2015-06-22 09:09:33 +02:00
|
|
|
class ModelBasicList;
|
2015-08-25 12:40:55 +02:00
|
|
|
class Scene;
|
2015-11-09 19:05:00 +01:00
|
|
|
class String;
|
2015-05-13 22:42:11 +02:00
|
|
|
class Transform;
|
2015-11-16 11:30:03 +01:00
|
|
|
class Part;
|
2015-05-13 22:42:11 +02:00
|
|
|
}
|
|
|
|
|
|
2016-09-29 11:43:47 +02:00
|
|
|
namespace caf
|
|
|
|
|
{
|
|
|
|
|
class DisplayCoordTransform;
|
|
|
|
|
}
|
2015-04-29 10:50:25 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
2016-05-24 10:37:10 +02:00
|
|
|
class RimView : public RimViewWindow
|
2015-04-29 10:50:25 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
public:
|
|
|
|
|
RimView(void);
|
|
|
|
|
virtual ~RimView(void);
|
|
|
|
|
|
2015-04-29 22:19:49 +02:00
|
|
|
// 3D Viewer
|
2015-05-08 10:38:10 +02:00
|
|
|
RiuViewer* viewer();
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
caf::PdmField<QString> name;
|
|
|
|
|
caf::PdmField<double> scaleZ;
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
caf::PdmField<cvf::Mat4d> cameraPosition;
|
2016-08-16 14:34:37 +02:00
|
|
|
caf::PdmField<cvf::Vec3d> cameraPointOfInterest;
|
2015-12-05 00:56:14 +01:00
|
|
|
caf::PdmField<bool> isPerspectiveView;
|
2015-05-08 10:38:10 +02:00
|
|
|
caf::PdmField< cvf::Color3f > backgroundColor;
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
caf::PdmField<int> maximumFrameRate;
|
2015-06-09 16:18:11 +02:00
|
|
|
caf::PdmField<bool> hasUserRequestedAnimation;
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2015-11-12 10:48:13 +01:00
|
|
|
virtual const RimPropertyFilterCollection* propertyFilterCollection() const = 0;
|
2015-08-27 13:44:27 +02:00
|
|
|
RimCellRangeFilterCollection* rangeFilterCollection();
|
|
|
|
|
const RimCellRangeFilterCollection* rangeFilterCollection() const;
|
2015-10-19 12:10:18 +02:00
|
|
|
|
2015-11-12 10:48:13 +01:00
|
|
|
bool hasOverridenRangeFilterCollection();
|
2015-10-20 11:13:31 +02:00
|
|
|
void setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc);
|
2015-10-21 12:45:35 +02:00
|
|
|
void replaceRangeFilterCollectionWithOverride();
|
2015-08-27 13:44:27 +02:00
|
|
|
|
2015-09-01 22:11:39 +02:00
|
|
|
|
2016-09-21 10:52:16 +02:00
|
|
|
caf::PdmChildField<RimIntersectionCollection*> crossSectionCollection;
|
2015-09-01 22:11:39 +02:00
|
|
|
|
2015-05-08 14:13:26 +02:00
|
|
|
// Draw style
|
|
|
|
|
|
|
|
|
|
enum MeshModeType
|
|
|
|
|
{
|
|
|
|
|
FULL_MESH,
|
|
|
|
|
FAULTS_MESH,
|
|
|
|
|
NO_MESH
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum SurfaceModeType
|
|
|
|
|
{
|
|
|
|
|
SURFACE,
|
|
|
|
|
FAULTS,
|
|
|
|
|
NO_SURFACE
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
caf::PdmField< caf::AppEnum< MeshModeType > > meshMode;
|
|
|
|
|
caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode;
|
2015-11-16 11:44:41 +01:00
|
|
|
caf::PdmField<bool> showGridBox;
|
2015-05-08 14:13:26 +02:00
|
|
|
|
|
|
|
|
void setMeshOnlyDrawstyle();
|
|
|
|
|
void setMeshSurfDrawstyle();
|
|
|
|
|
void setSurfOnlyDrawstyle();
|
|
|
|
|
void setFaultMeshSurfDrawstyle();
|
|
|
|
|
void setSurfaceDrawstyle();
|
2015-06-17 15:04:55 +02:00
|
|
|
|
|
|
|
|
void disableLighting(bool disable);
|
|
|
|
|
bool isLightingDisabled() const;
|
2015-05-08 14:13:26 +02:00
|
|
|
|
2017-11-08 14:08:03 +01:00
|
|
|
void showGridCells(bool enableGridCells);
|
2015-05-08 14:13:26 +02:00
|
|
|
bool isGridVisualizationMode() const;
|
|
|
|
|
|
2015-09-03 13:06:00 +02:00
|
|
|
void setScaleZAndUpdate(double scaleZ);
|
|
|
|
|
|
2015-04-29 22:19:49 +02:00
|
|
|
// Animation
|
2016-12-14 10:35:28 +01:00
|
|
|
int currentTimeStep() const { return m_currentTimeStep;}
|
2017-03-02 16:10:18 +01:00
|
|
|
void setCurrentTimeStep(int frameIdx);
|
2017-07-27 10:39:59 +02:00
|
|
|
void setCurrentTimeStepAndUpdate(int frameIdx);
|
2017-03-02 16:10:18 +01:00
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
void updateCurrentTimeStepAndRedraw();
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2015-06-18 19:22:24 +02:00
|
|
|
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType) = 0;
|
2015-05-08 10:38:10 +02:00
|
|
|
void scheduleCreateDisplayModelAndRedraw();
|
|
|
|
|
void createDisplayModelAndRedraw();
|
2015-11-19 11:41:16 +01:00
|
|
|
void createHighlightAndGridBoxDisplayModelWithRedraw();
|
2015-09-15 14:30:52 +02:00
|
|
|
|
2015-09-25 11:01:41 +02:00
|
|
|
RimViewController* viewController() const;
|
|
|
|
|
bool isMasterView() const;
|
|
|
|
|
RimViewLinker* assosiatedViewLinker() const;
|
|
|
|
|
|
2016-09-12 11:36:59 +02:00
|
|
|
virtual bool isUsingFormationNames() const = 0;
|
2015-09-14 16:14:44 +02:00
|
|
|
cvf::ref<cvf::UByteArray> currentTotalCellVisibility();
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2015-11-16 14:08:17 +01:00
|
|
|
virtual bool showActiveCellsOnly();
|
2015-11-23 07:24:50 +01:00
|
|
|
virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel) = 0;
|
2015-11-16 07:16:30 +01:00
|
|
|
|
2015-12-07 09:59:19 +01:00
|
|
|
void selectOverlayInfoConfig();
|
|
|
|
|
|
2016-08-31 17:34:31 +02:00
|
|
|
virtual QImage snapshotWindowContent() override;
|
2016-07-05 10:47:03 +02:00
|
|
|
|
|
|
|
|
virtual void zoomAll() override;
|
|
|
|
|
|
2017-06-25 10:36:15 +02:00
|
|
|
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const;
|
2016-09-29 11:43:47 +02:00
|
|
|
|
2016-10-27 11:03:13 +02:00
|
|
|
virtual QWidget* viewWidget() override;
|
2017-01-20 16:25:05 +01:00
|
|
|
void forceShowWindowOn();
|
2016-10-27 11:03:13 +02:00
|
|
|
|
2015-04-29 22:19:49 +02:00
|
|
|
public:
|
2017-06-15 14:11:58 +02:00
|
|
|
void updateGridBoxData();
|
2017-11-08 09:02:21 +01:00
|
|
|
void updateAnnotationItems();
|
2017-06-25 10:36:15 +02:00
|
|
|
virtual RimCase* ownerCase() const = 0;
|
2015-05-15 18:51:49 +02:00
|
|
|
|
2017-10-16 10:46:05 +02:00
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() override { return &name; }
|
2017-11-15 20:45:56 +01:00
|
|
|
|
|
|
|
|
Rim3dOverlayInfoConfig* overlayInfoConfig() const;
|
|
|
|
|
|
2015-04-29 22:19:49 +02:00
|
|
|
protected:
|
2015-05-08 10:38:10 +02:00
|
|
|
|
|
|
|
|
void setDefaultView();
|
2015-06-22 09:09:33 +02:00
|
|
|
|
|
|
|
|
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
2017-06-19 22:15:28 +02:00
|
|
|
const cvf::BoundingBox& wellPathClipBoundingBox);
|
2015-05-08 10:38:10 +02:00
|
|
|
|
2017-06-19 22:53:19 +02:00
|
|
|
void addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
|
|
|
|
const cvf::BoundingBox& wellPathClipBoundingBox);
|
|
|
|
|
|
2015-11-09 19:05:00 +01:00
|
|
|
static void removeModelByName(cvf::Scene* scene, const cvf::String& modelName);
|
|
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
virtual void createDisplayModel() = 0;
|
2015-11-16 11:30:03 +01:00
|
|
|
|
2015-11-19 11:41:16 +01:00
|
|
|
void createHighlightAndGridBoxDisplayModel();
|
2015-11-16 14:08:17 +01:00
|
|
|
|
2015-11-16 11:30:03 +01:00
|
|
|
virtual void createPartCollectionFromSelection(cvf::Collection<cvf::Part>* parts) = 0;
|
|
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
virtual void updateDisplayModelVisibility() = 0;
|
|
|
|
|
virtual void clampCurrentTimestep() = 0;
|
|
|
|
|
|
|
|
|
|
virtual void updateCurrentTimeStep() = 0;
|
|
|
|
|
virtual void updateStaticCellColors() = 0;
|
|
|
|
|
|
2015-05-13 22:42:11 +02:00
|
|
|
virtual void updateScaleTransform() = 0;
|
|
|
|
|
virtual cvf::Transform* scaleTransform() = 0;
|
|
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
virtual void resetLegendsInViewer() = 0;
|
2017-08-24 09:27:08 +02:00
|
|
|
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility, int timeStep) = 0;
|
2015-09-14 16:14:44 +02:00
|
|
|
|
2017-10-31 12:49:14 +01:00
|
|
|
virtual void onLoadDataAndUpdate() = 0;
|
|
|
|
|
|
2017-11-08 09:07:30 +01:00
|
|
|
RimWellPathCollection* wellPathCollection();
|
2017-06-15 14:06:38 +02:00
|
|
|
|
2015-04-29 22:19:49 +02:00
|
|
|
QPointer<RiuViewer> m_viewer;
|
2015-05-08 10:38:10 +02:00
|
|
|
|
2015-08-27 13:44:27 +02:00
|
|
|
caf::PdmField<int> m_currentTimeStep;
|
|
|
|
|
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
|
|
|
|
|
|
|
|
|
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
|
2015-10-19 12:10:18 +02:00
|
|
|
caf::PdmChildField<RimCellRangeFilterCollection*> m_overrideRangeFilterCollection;
|
2015-11-18 09:15:13 +01:00
|
|
|
|
2015-11-27 13:45:02 +01:00
|
|
|
caf::PdmChildField<RimGridCollection*> m_gridCollection;
|
2015-11-27 12:17:50 +01:00
|
|
|
|
2015-05-08 10:38:10 +02:00
|
|
|
// Overridden PDM methods:
|
2017-10-16 10:46:05 +02:00
|
|
|
virtual void setupBeforeSave() override;
|
|
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
2017-04-06 18:37:43 +02:00
|
|
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
2017-01-17 13:06:57 +01:00
|
|
|
|
|
|
|
|
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
|
|
|
|
virtual void updateViewWidgetAfterCreation() override;
|
2017-01-20 11:38:18 +01:00
|
|
|
virtual void updateMdiWindowTitle() override;
|
2017-01-17 13:06:57 +01:00
|
|
|
virtual void deleteViewWidget() override;
|
2015-05-08 14:13:26 +02:00
|
|
|
|
2015-09-14 16:14:44 +02:00
|
|
|
cvf::ref<cvf::UByteArray> m_currentReservoirCellVisibility;
|
2015-11-23 11:21:12 +01:00
|
|
|
|
|
|
|
|
cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel;
|
|
|
|
|
cvf::ref<cvf::ModelBasicList> m_crossSectionVizModel;
|
|
|
|
|
cvf::ref<cvf::ModelBasicList> m_highlightVizModel;
|
2015-11-19 11:41:16 +01:00
|
|
|
|
2015-09-25 11:01:41 +02:00
|
|
|
private:
|
|
|
|
|
RimViewLinker* viewLinkerIfMasterView() const;
|
2016-12-14 10:35:28 +01:00
|
|
|
|
|
|
|
|
friend class RiuViewer;
|
|
|
|
|
void endAnimation();
|
|
|
|
|
|
2015-05-08 14:13:26 +02:00
|
|
|
private:
|
|
|
|
|
bool m_previousGridModeMeshLinesWasFaults;
|
2015-06-17 15:04:55 +02:00
|
|
|
caf::PdmField<bool> m_disableLighting;
|
2015-04-29 10:50:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|