2015-04-29 03:50:25 -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
|
2018-01-11 05:59:52 -06:00
|
|
|
#include "RiuViewerToViewInterface.h"
|
2018-01-11 08:44:22 -06:00
|
|
|
#include "RimViewWindow.h"
|
2015-04-29 03:50:25 -05:00
|
|
|
|
2015-07-31 11:58:23 -05:00
|
|
|
#include "cafAppEnum.h"
|
2015-08-25 05:40:55 -05:00
|
|
|
#include "cafPdmChildArrayField.h"
|
2015-07-31 11:58:23 -05:00
|
|
|
#include "cafPdmChildField.h"
|
2015-04-29 15:19:49 -05:00
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmFieldCvfColor.h"
|
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
2016-08-16 07:34:37 -05:00
|
|
|
#include "cafPdmFieldCvfVec3d.h"
|
2015-07-31 11:58:23 -05:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
2015-06-18 12:22:24 -05:00
|
|
|
#include "RivCellSetEnum.h"
|
2015-04-29 15:19:49 -05:00
|
|
|
|
2015-09-14 09:14:44 -05:00
|
|
|
#include "cvfArray.h"
|
|
|
|
#include "cvfBase.h"
|
2015-11-16 04:30:03 -06:00
|
|
|
#include "cvfCollection.h"
|
2015-09-14 09:14:44 -05:00
|
|
|
#include "cvfObject.h"
|
|
|
|
|
2015-07-31 11:58:23 -05:00
|
|
|
#include <QPointer>
|
|
|
|
|
2016-05-24 03:37:10 -05:00
|
|
|
|
2015-04-29 15:19:49 -05:00
|
|
|
class Rim3dOverlayInfoConfig;
|
2015-05-20 05:29:01 -05:00
|
|
|
class RimCase;
|
2015-10-19 05:10:18 -05:00
|
|
|
class RimCellRangeFilter;
|
2015-06-05 03:05:40 -05:00
|
|
|
class RimCellRangeFilterCollection;
|
2016-09-21 03:52:16 -05:00
|
|
|
class RimIntersectionCollection;
|
2016-09-20 05:03:26 -05:00
|
|
|
class RimGridCollection;
|
2015-11-27 05:17:50 -06:00
|
|
|
class RimPropertyFilterCollection;
|
|
|
|
class RimViewController;
|
|
|
|
class RimViewLinker;
|
|
|
|
class RiuViewer;
|
2017-06-21 08:39:59 -05:00
|
|
|
class RimWellPathCollection;
|
2015-04-29 15:19:49 -05:00
|
|
|
|
2015-05-13 15:42:11 -05:00
|
|
|
namespace cvf
|
|
|
|
{
|
2015-06-11 06:44:21 -05:00
|
|
|
class BoundingBox;
|
2015-06-22 02:09:33 -05:00
|
|
|
class ModelBasicList;
|
2015-08-25 05:40:55 -05:00
|
|
|
class Scene;
|
2015-11-09 12:05:00 -06:00
|
|
|
class String;
|
2015-05-13 15:42:11 -05:00
|
|
|
class Transform;
|
2015-11-16 04:30:03 -06:00
|
|
|
class Part;
|
2015-05-13 15:42:11 -05:00
|
|
|
}
|
|
|
|
|
2016-09-29 04:43:47 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
class DisplayCoordTransform;
|
|
|
|
}
|
2015-04-29 03:50:25 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
2018-01-11 05:59:52 -06:00
|
|
|
class Rim3dView : public RimViewWindow, public RiuViewerToViewInterface
|
2015-04-29 03:50:25 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
2018-01-09 03:11:28 -06:00
|
|
|
Rim3dView(void);
|
|
|
|
virtual ~Rim3dView(void);
|
2015-04-29 03:50:25 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
// Public fields:
|
2015-04-29 15:19:49 -05:00
|
|
|
|
2015-05-08 03:38:10 -05:00
|
|
|
caf::PdmField<QString> name;
|
|
|
|
caf::PdmField<double> scaleZ;
|
2015-12-04 17:56:14 -06:00
|
|
|
caf::PdmField<bool> isPerspectiveView;
|
2015-05-08 03:38:10 -05:00
|
|
|
caf::PdmField<int> maximumFrameRate;
|
2015-06-09 09:18:11 -05:00
|
|
|
caf::PdmField<bool> hasUserRequestedAnimation;
|
2015-04-29 15:19:49 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
// Draw style
|
2015-08-27 06:44:27 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
enum MeshModeType { FULL_MESH, FAULTS_MESH, NO_MESH };
|
|
|
|
enum SurfaceModeType { SURFACE, FAULTS, NO_SURFACE };
|
2015-09-01 15:11:39 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
caf::PdmField< caf::AppEnum< MeshModeType > > meshMode;
|
|
|
|
caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode;
|
2015-09-01 15:11:39 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
RiuViewer* viewer();
|
2015-05-08 07:13:26 -05:00
|
|
|
|
|
|
|
void setMeshOnlyDrawstyle();
|
|
|
|
void setMeshSurfDrawstyle();
|
|
|
|
void setSurfOnlyDrawstyle();
|
|
|
|
void setFaultMeshSurfDrawstyle();
|
|
|
|
void setSurfaceDrawstyle();
|
2015-06-17 08:04:55 -05:00
|
|
|
|
|
|
|
void disableLighting(bool disable);
|
|
|
|
bool isLightingDisabled() const;
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2015-05-08 07:13:26 -05:00
|
|
|
bool isGridVisualizationMode() const;
|
|
|
|
|
2015-09-03 06:06:00 -05:00
|
|
|
void setScaleZAndUpdate(double scaleZ);
|
2018-01-11 08:44:22 -06:00
|
|
|
virtual bool showActiveCellsOnly();
|
|
|
|
virtual bool isUsingFormationNames() const = 0;
|
|
|
|
|
|
|
|
virtual QImage snapshotWindowContent() override;
|
|
|
|
virtual void zoomAll() override;
|
|
|
|
void forceShowWindowOn();
|
2015-09-03 06:06:00 -05:00
|
|
|
|
2015-04-29 15:19:49 -05:00
|
|
|
// Animation
|
2016-12-14 03:35:28 -06:00
|
|
|
int currentTimeStep() const { return m_currentTimeStep;}
|
2017-03-02 09:10:18 -06:00
|
|
|
void setCurrentTimeStep(int frameIdx);
|
2018-01-11 08:44:22 -06:00
|
|
|
void setCurrentTimeStepAndUpdate(int frameIdx) override;
|
2015-04-29 15:19:49 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
// Updating
|
|
|
|
void updateCurrentTimeStepAndRedraw() override;
|
2015-06-18 12:22:24 -05:00
|
|
|
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType) = 0;
|
2015-05-08 03:38:10 -05:00
|
|
|
void scheduleCreateDisplayModelAndRedraw();
|
|
|
|
void createDisplayModelAndRedraw();
|
2015-11-19 04:41:16 -06:00
|
|
|
void createHighlightAndGridBoxDisplayModelWithRedraw();
|
2018-01-11 08:44:22 -06:00
|
|
|
void updateGridBoxData();
|
|
|
|
void updateAnnotationItems();
|
2015-09-15 07:30:52 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
bool isMasterView() const;
|
2018-01-11 05:59:52 -06:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const override;
|
2018-01-11 05:59:52 -06:00
|
|
|
|
2017-06-25 03:36:15 -05:00
|
|
|
virtual RimCase* ownerCase() const = 0;
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2015-04-29 15:19:49 -05:00
|
|
|
protected:
|
2015-05-08 03:38:10 -05:00
|
|
|
void setDefaultView();
|
2015-06-22 02:09:33 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
RimWellPathCollection* wellPathCollection();
|
2015-06-22 02:09:33 -05:00
|
|
|
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
2017-06-19 15:15:28 -05:00
|
|
|
const cvf::BoundingBox& wellPathClipBoundingBox);
|
2015-05-08 03:38:10 -05:00
|
|
|
|
2017-06-19 15:53:19 -05:00
|
|
|
void addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
|
|
|
const cvf::BoundingBox& wellPathClipBoundingBox);
|
|
|
|
|
2015-11-19 04:41:16 -06:00
|
|
|
void createHighlightAndGridBoxDisplayModel();
|
2015-11-16 07:08:17 -06:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
// Abstract methods to implement in subclasses
|
|
|
|
|
|
|
|
virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel) = 0;
|
|
|
|
|
|
|
|
virtual void createDisplayModel() = 0;
|
2015-11-16 04:30:03 -06:00
|
|
|
virtual void createPartCollectionFromSelection(cvf::Collection<cvf::Part>* parts) = 0;
|
|
|
|
|
2015-05-08 03:38:10 -05:00
|
|
|
virtual void updateDisplayModelVisibility() = 0;
|
|
|
|
virtual void clampCurrentTimestep() = 0;
|
|
|
|
|
|
|
|
virtual void updateCurrentTimeStep() = 0;
|
2018-01-15 07:52:22 -06:00
|
|
|
virtual void onTimeStepChanged() = 0;
|
2015-05-08 03:38:10 -05:00
|
|
|
virtual void updateStaticCellColors() = 0;
|
|
|
|
|
2015-05-13 15:42:11 -05:00
|
|
|
virtual void updateScaleTransform() = 0;
|
|
|
|
virtual cvf::Transform* scaleTransform() = 0;
|
|
|
|
|
2015-05-08 03:38:10 -05:00
|
|
|
virtual void resetLegendsInViewer() = 0;
|
2018-01-11 08:44:22 -06:00
|
|
|
|
|
|
|
protected: // Fields
|
2018-01-16 01:44:15 -06:00
|
|
|
caf::PdmField<int> m_currentTimeStep;
|
2015-05-08 07:13:26 -05:00
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
protected:
|
2018-01-16 01:44:15 -06:00
|
|
|
QPointer<RiuViewer> m_viewer;
|
2018-01-11 08:44:22 -06:00
|
|
|
|
2018-01-16 01:44:15 -06:00
|
|
|
cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel;
|
|
|
|
cvf::ref<cvf::ModelBasicList> m_crossSectionVizModel;
|
|
|
|
cvf::ref<cvf::ModelBasicList> m_highlightVizModel;
|
2015-11-19 04:41:16 -06:00
|
|
|
|
2015-09-25 04:01:41 -05:00
|
|
|
private:
|
2018-01-12 04:31:01 -06:00
|
|
|
// Overridden PdmObject methods:
|
|
|
|
|
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() override { return &name; }
|
|
|
|
virtual void setupBeforeSave() override;
|
|
|
|
protected:
|
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
|
|
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Overridden ViewWindow methods:
|
|
|
|
|
|
|
|
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
|
|
|
virtual void updateViewWidgetAfterCreation() override;
|
|
|
|
virtual void updateMdiWindowTitle() override;
|
|
|
|
virtual void deleteViewWidget() override;
|
|
|
|
virtual QWidget* viewWidget() override;
|
|
|
|
|
2018-01-11 08:44:22 -06:00
|
|
|
// Implementation of RiuViewerToViewInterface
|
|
|
|
|
|
|
|
virtual cvf::Color3f backgroundColor() const override { return m_backgroundColor();}
|
|
|
|
virtual void setCameraPosition(const cvf::Mat4d& cameraPosition) override { m_cameraPosition = cameraPosition; }
|
|
|
|
virtual void setCameraPointOfInterest(const cvf::Vec3d& cameraPointOfInterest) override { m_cameraPointOfInterest = cameraPointOfInterest;}
|
|
|
|
virtual QString timeStepName(int frameIdx) const override;
|
|
|
|
virtual void endAnimation() override;
|
|
|
|
virtual caf::PdmObjectHandle* implementingPdmObject() override { return this; }
|
2018-01-11 05:59:52 -06:00
|
|
|
virtual void handleMdiWindowClosed() override;
|
|
|
|
virtual void setMdiWindowGeometry(const RimMdiWindowGeometry& windowGeometry) override;
|
2016-12-14 03:35:28 -06:00
|
|
|
|
2015-05-08 07:13:26 -05:00
|
|
|
private:
|
2015-06-17 08:04:55 -05:00
|
|
|
caf::PdmField<bool> m_disableLighting;
|
2018-01-11 05:59:52 -06:00
|
|
|
caf::PdmField<cvf::Mat4d> m_cameraPosition;
|
|
|
|
caf::PdmField<cvf::Vec3d> m_cameraPointOfInterest;
|
|
|
|
caf::PdmField< cvf::Color3f > m_backgroundColor;
|
2018-01-11 08:44:22 -06:00
|
|
|
caf::PdmField<bool> showGridBox;
|
2018-01-11 05:59:52 -06:00
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
};
|