2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron 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
|
2014-07-24 03:11:43 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cafAppEnum.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "cvfArray.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cvfBase.h"
|
|
|
|
#include "cvfObject.h"
|
|
|
|
|
2014-07-24 03:11:43 -05:00
|
|
|
// Includes to make Pdm work for cvf::Color and cvf:Mat
|
|
|
|
#include "cafPdmFieldCvfColor.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RivReservoirViewPartMgr.h"
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2014-07-24 03:11:43 -05:00
|
|
|
class RigActiveCellInfo;
|
2014-07-31 01:46:30 -05:00
|
|
|
class RigCaseCellResultsData;
|
2014-07-24 03:11:43 -05:00
|
|
|
class RigGridBase;
|
|
|
|
class RigGridCellFaceVisibilityFilter;
|
|
|
|
class Rim3dOverlayInfoConfig;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RimCase;
|
|
|
|
class RimCellEdgeResultSlot;
|
|
|
|
class RimCellPropertyFilter;
|
|
|
|
class RimCellPropertyFilterCollection;
|
2014-07-24 03:11:43 -05:00
|
|
|
class RimCellRangeFilter;
|
|
|
|
class RimCellRangeFilterCollection;
|
|
|
|
class RimFaultCollection;
|
2014-08-06 05:47:27 -05:00
|
|
|
class RimFaultResultSlot;
|
2014-07-24 03:11:43 -05:00
|
|
|
class RimReservoirCellResultsStorage;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RimReservoirCellResultsStorage;
|
2014-07-24 03:11:43 -05:00
|
|
|
class RimResultSlot;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RimWellCollection;
|
2013-03-22 11:17:56 -05:00
|
|
|
class RiuViewer;
|
2014-07-24 03:11:43 -05:00
|
|
|
class RivReservoirPipesPartMgr;
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class Transform;
|
|
|
|
class ScalarMapperUniformLevels;
|
|
|
|
class ModelBasicList;
|
2014-04-07 06:18:39 -05:00
|
|
|
class OverlayItem;
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
2013-12-03 13:30:32 -06:00
|
|
|
enum PartRenderMaskEnum
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-12-03 13:30:32 -06:00
|
|
|
surfaceBit = 0x00000001,
|
|
|
|
meshSurfaceBit = 0x00000002,
|
|
|
|
faultBit = 0x00000004,
|
|
|
|
meshFaultBit = 0x00000008,
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
|
|
|
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RimReservoirView : public caf::PdmObject
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
|
|
RimReservoirView(void);
|
|
|
|
virtual ~RimReservoirView(void);
|
|
|
|
|
|
|
|
enum MeshModeType
|
|
|
|
{
|
|
|
|
FULL_MESH,
|
2012-10-24 04:23:40 -05:00
|
|
|
FAULTS_MESH,
|
2012-05-18 02:45:23 -05:00
|
|
|
NO_MESH
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SurfaceModeType
|
|
|
|
{
|
|
|
|
SURFACE,
|
|
|
|
FAULTS,
|
|
|
|
NO_SURFACE
|
|
|
|
};
|
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// Fields containing child objects :
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<RimResultSlot*> cellResult;
|
|
|
|
caf::PdmField<RimCellEdgeResultSlot*> cellEdgeResult;
|
2014-08-06 05:47:27 -05:00
|
|
|
caf::PdmField<RimFaultResultSlot*> faultResultSettings;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<RimCellRangeFilterCollection*> rangeFilterCollection;
|
|
|
|
caf::PdmField<RimCellPropertyFilterCollection*> propertyFilterCollection;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<RimWellCollection*> wellCollection;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-12-03 13:30:32 -06:00
|
|
|
caf::PdmField<RimFaultCollection*> faultCollection;
|
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<Rim3dOverlayInfoConfig*> overlayInfoConfig;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// Visualization setup fields
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<QString> name;
|
|
|
|
caf::PdmField<double> scaleZ;
|
|
|
|
caf::PdmField<bool> showWindow;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<bool> showInvalidCells;
|
|
|
|
caf::PdmField<bool> showInactiveCells;
|
|
|
|
caf::PdmField<bool> showMainGrid;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField< caf::AppEnum< MeshModeType > > meshMode;
|
|
|
|
caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 04:52:28 -06:00
|
|
|
caf::PdmField< cvf::Color3f > backgroundColor;
|
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<cvf::Mat4d> cameraPosition;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<int> maximumFrameRate;
|
|
|
|
caf::PdmField<bool> animationMode;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// Access internal objects
|
2013-04-12 05:03:04 -05:00
|
|
|
RimReservoirCellResultsStorage* currentGridCellResults();
|
2013-03-13 05:50:31 -05:00
|
|
|
RigActiveCellInfo* currentActiveCellInfo();
|
2014-09-08 00:35:23 -05:00
|
|
|
RimResultSlot* currentFaultResultSlot();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-22 09:43:42 -05:00
|
|
|
void setEclipseCase(RimCase* reservoir);
|
2013-04-12 05:03:04 -05:00
|
|
|
RimCase* eclipseCase();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// Animation
|
|
|
|
int currentTimeStep() { return m_currentTimeStep;}
|
|
|
|
void setCurrentTimeStep(int frameIdx);
|
|
|
|
void updateCurrentTimeStepAndRedraw();
|
|
|
|
void endAnimation();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// 3D Viewer
|
2013-04-19 00:43:37 -05:00
|
|
|
RiuViewer* viewer();
|
2013-02-25 02:44:26 -06:00
|
|
|
void updateViewerWidget();
|
|
|
|
void updateViewerWidgetWindowTitle();
|
|
|
|
void setDefaultView();
|
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
void setMeshOnlyDrawstyle();
|
|
|
|
void setMeshSurfDrawstyle();
|
|
|
|
void setSurfOnlyDrawstyle();
|
2013-12-18 16:37:30 -06:00
|
|
|
void setFaultMeshSurfDrawstyle();
|
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
void setShowFaultsOnly(bool showFaults);
|
2013-12-18 16:37:30 -06:00
|
|
|
bool isGridVisualizationMode() const;
|
2013-04-18 08:10:57 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// Does this belong here, really ?
|
|
|
|
void calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleCells, RigGridBase * grid);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Display model generation
|
|
|
|
public:
|
2013-02-25 02:44:26 -06:00
|
|
|
void loadDataAndUpdate();
|
|
|
|
void createDisplayModelAndRedraw();
|
2013-09-08 15:59:46 -05:00
|
|
|
void scheduleCreateDisplayModelAndRedraw();
|
2014-07-31 01:46:30 -05:00
|
|
|
bool isTimeStepDependentDataVisible() const;
|
2013-09-08 15:59:46 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
void scheduleGeometryRegen(unsigned short geometryType);
|
2013-04-26 06:19:34 -05:00
|
|
|
void scheduleReservoirGridGeometryRegen();
|
2013-02-25 02:44:26 -06:00
|
|
|
void schedulePipeGeometryRegen();
|
2013-04-12 05:03:04 -05:00
|
|
|
void updateDisplayModelForWellResults();
|
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
const std::vector<RivReservoirViewPartMgr::ReservoirGeometryCacheType>&
|
|
|
|
visibleGridParts() const { return m_visibleGridParts;}
|
|
|
|
cvf::cref<RivReservoirViewPartMgr> reservoirGridPartManager() const { return m_reservoirGridPartManager.p(); }
|
2013-02-25 02:44:26 -06:00
|
|
|
|
|
|
|
// Display model generation
|
|
|
|
private:
|
|
|
|
void createDisplayModel();
|
|
|
|
void updateDisplayModelVisibility();
|
|
|
|
void updateCurrentTimeStep();
|
|
|
|
void indicesToVisibleGrids(std::vector<size_t>* gridIndices);
|
|
|
|
void updateScaleTransform();
|
|
|
|
void updateStaticCellColors();
|
|
|
|
void updateStaticCellColors(unsigned short geometryType);
|
|
|
|
void updateLegends();
|
2014-07-31 01:46:30 -05:00
|
|
|
void updateMinMaxValuesAndAddLegendToView(QString legendLabel, RimResultSlot* resultSlot, RigCaseCellResultsData* cellResultsData);
|
2013-02-25 02:44:26 -06:00
|
|
|
|
2014-06-13 00:27:00 -05:00
|
|
|
std::vector<RivReservoirViewPartMgr::ReservoirGeometryCacheType> visibleFaultGeometryTypes() const;
|
2014-01-07 07:27:43 -06:00
|
|
|
void updateFaultForcedVisibility();
|
2014-01-08 01:25:46 -06:00
|
|
|
void updateFaultColors();
|
2014-01-07 07:27:43 -06:00
|
|
|
|
2013-04-18 00:41:00 -05:00
|
|
|
cvf::ref<RivReservoirViewPartMgr> m_reservoirGridPartManager;
|
2013-02-25 02:44:26 -06:00
|
|
|
cvf::ref<RivReservoirPipesPartMgr> m_pipesPartManager;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Overridden PDM methods:
|
|
|
|
public:
|
2013-04-19 00:43:37 -05:00
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() { return &name; }
|
|
|
|
virtual caf::PdmFieldHandle* objectToggleField();
|
2013-02-25 02:44:26 -06:00
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
2012-05-18 02:45:23 -05:00
|
|
|
protected:
|
2013-02-25 02:44:26 -06:00
|
|
|
virtual void initAfterRead();
|
|
|
|
virtual void setupBeforeSave();
|
2013-10-17 06:38:36 -05:00
|
|
|
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// Really private
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
2013-02-25 02:44:26 -06:00
|
|
|
void syncronizeWellsWithResults();
|
|
|
|
void clampCurrentTimestep();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private:
|
2013-02-25 02:44:26 -06:00
|
|
|
caf::PdmField<int> m_currentTimeStep;
|
2013-04-12 05:03:04 -05:00
|
|
|
QPointer<RiuViewer> m_viewer;
|
|
|
|
caf::PdmPointer<RimCase> m_reservoir;
|
2013-04-22 02:13:37 -05:00
|
|
|
|
2013-12-18 16:37:30 -06:00
|
|
|
bool m_previousGridModeMeshLinesWasFaults;
|
|
|
|
|
2013-04-22 02:13:37 -05:00
|
|
|
std::vector<RivReservoirViewPartMgr::ReservoirGeometryCacheType> m_visibleGridParts;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
|
|
|
|