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
|
|
|
|
|
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"
|
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-07-31 11:58:23 -05:00
|
|
|
#include <QPointer>
|
|
|
|
|
2015-04-29 15:19:49 -05:00
|
|
|
class Rim3dOverlayInfoConfig;
|
2015-05-20 05:29:01 -05:00
|
|
|
class RimCase;
|
2015-06-05 03:05:40 -05:00
|
|
|
class RimCellRangeFilterCollection;
|
2015-08-25 05:40:55 -05:00
|
|
|
class RiuViewer;
|
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-05-13 15:42:11 -05:00
|
|
|
class Transform;
|
|
|
|
}
|
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RimView : public caf::PdmObject
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
|
|
RimView(void);
|
|
|
|
virtual ~RimView(void);
|
|
|
|
|
2015-04-29 15:19:49 -05:00
|
|
|
// 3D Viewer
|
2015-05-08 03:38:10 -05:00
|
|
|
RiuViewer* viewer();
|
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-04-29 15:19:49 -05:00
|
|
|
|
2015-05-08 03:38:10 -05:00
|
|
|
caf::PdmField<bool> showWindow;
|
|
|
|
caf::PdmField<cvf::Mat4d> cameraPosition;
|
|
|
|
caf::PdmField< cvf::Color3f > backgroundColor;
|
2015-04-29 15:19:49 -05:00
|
|
|
|
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
|
|
|
|
2015-08-27 06:44:27 -05:00
|
|
|
RimCellRangeFilterCollection* rangeFilterCollection();
|
|
|
|
const RimCellRangeFilterCollection* rangeFilterCollection() const;
|
|
|
|
void setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc);
|
|
|
|
|
|
|
|
|
2015-05-08 07:13:26 -05: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;
|
|
|
|
|
|
|
|
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;
|
2015-05-08 07:13:26 -05:00
|
|
|
|
|
|
|
void setShowFaultsOnly(bool showFaults);
|
|
|
|
bool isGridVisualizationMode() const;
|
|
|
|
|
2015-04-29 15:19:49 -05:00
|
|
|
// Animation
|
2015-05-08 03:38:10 -05:00
|
|
|
int currentTimeStep() { return m_currentTimeStep;}
|
|
|
|
void setCurrentTimeStep(int frameIdx);
|
|
|
|
void updateCurrentTimeStepAndRedraw();
|
|
|
|
void endAnimation();
|
2015-04-29 15:19:49 -05:00
|
|
|
|
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-04-29 15:19:49 -05:00
|
|
|
|
|
|
|
public:
|
2015-05-15 11:51:49 -05:00
|
|
|
virtual void loadDataAndUpdate() = 0;
|
2015-05-20 05:29:01 -05:00
|
|
|
virtual RimCase* ownerCase() = 0;
|
2015-05-15 11:51:49 -05:00
|
|
|
|
2015-05-08 03:38:10 -05:00
|
|
|
virtual caf::PdmFieldHandle* objectToggleField() { return &showWindow; }
|
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() { return &name; }
|
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
|
|
|
|
|
|
|
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
|
|
|
const cvf::Vec3d& displayModelOffset,
|
2015-06-12 02:25:09 -05:00
|
|
|
double characteristicCellSize,
|
|
|
|
const cvf::BoundingBox& wellPathClipBoundingBox,
|
|
|
|
cvf::Transform* scaleTransform);
|
2015-05-08 03:38:10 -05:00
|
|
|
|
|
|
|
virtual void createDisplayModel() = 0;
|
|
|
|
virtual void updateDisplayModelVisibility() = 0;
|
|
|
|
virtual void clampCurrentTimestep() = 0;
|
|
|
|
|
|
|
|
virtual void updateCurrentTimeStep() = 0;
|
|
|
|
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
|
|
|
void updateViewerWidget();
|
|
|
|
virtual void updateViewerWidgetWindowTitle() = 0;
|
|
|
|
|
|
|
|
virtual void resetLegendsInViewer() = 0;
|
|
|
|
|
2015-04-29 15:19:49 -05:00
|
|
|
QPointer<RiuViewer> m_viewer;
|
2015-05-08 03:38:10 -05:00
|
|
|
|
2015-08-27 06:44:27 -05:00
|
|
|
caf::PdmField<int> m_currentTimeStep;
|
|
|
|
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
|
|
|
|
|
|
|
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
|
|
|
|
caf::PdmPointer<RimCellRangeFilterCollection> m_overrideRangeFilterCollection;
|
2015-05-08 03:38:10 -05:00
|
|
|
|
|
|
|
// Overridden PDM methods:
|
|
|
|
virtual void setupBeforeSave();
|
|
|
|
|
2015-05-08 07:13:26 -05:00
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_previousGridModeMeshLinesWasFaults;
|
2015-06-17 08:04:55 -05:00
|
|
|
caf::PdmField<bool> m_disableLighting;
|
2015-04-30 03:59:39 -05:00
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|