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
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafAppEnum.h"
|
|
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
#include <QString>
|
|
|
|
|
2013-03-22 10:40:41 -05:00
|
|
|
#include "RimCase.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "RimResultSlot.h"
|
|
|
|
#include "RimCellEdgeResultSlot.h"
|
|
|
|
#include "RimCellRangeFilter.h"
|
|
|
|
#include "RimCellRangeFilterCollection.h"
|
|
|
|
#include "RimCellPropertyFilter.h"
|
|
|
|
#include "RimCellPropertyFilterCollection.h"
|
2012-09-11 02:22:36 -05:00
|
|
|
#include "Rim3dOverlayInfoConfig.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
#include "cvfMatrix4.h"
|
|
|
|
#include "cvfStructGridGeometryGenerator.h"
|
2013-02-05 09:35:04 -06:00
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
#include "RivReservoirViewPartMgr.h"
|
|
|
|
#include "RivReservoirPipesPartMgr.h"
|
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
class RiuViewer;
|
2012-05-18 02:45:23 -05:00
|
|
|
class RigGridBase;
|
|
|
|
class RigGridCellFaceVisibilityFilter;
|
|
|
|
class RivReservoirViewPartMgr;
|
|
|
|
|
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class Transform;
|
|
|
|
class ScalarMapperUniformLevels;
|
|
|
|
class ModelBasicList;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum ViewState
|
|
|
|
{
|
|
|
|
GEOMETRY_ONLY,
|
|
|
|
STATIC_RESULT,
|
|
|
|
DYNAMIC_RESULT,
|
|
|
|
CELL_FACE_COMBINED_RESULT
|
|
|
|
};
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
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;
|
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-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();
|
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();
|
|
|
|
void setShowFaultsOnly(bool showFaults);
|
|
|
|
|
|
|
|
|
2013-02-25 02:44:26 -06:00
|
|
|
// Picking info
|
|
|
|
bool pickInfo(size_t gridIndex, size_t cellIndex, const cvf::Vec3d& point, QString* pickInfoText) const;
|
2013-03-01 09:00:34 -06:00
|
|
|
void appendCellResultInfo(size_t gridIndex, size_t cellIndex, QString* resultInfoText) ;
|
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();
|
|
|
|
void scheduleGeometryRegen(unsigned short geometryType);
|
|
|
|
void schedulePipeGeometryRegen();
|
2013-04-12 05:03:04 -05:00
|
|
|
void updateDisplayModelForWellResults();
|
|
|
|
|
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();
|
|
|
|
|
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();
|
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;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
|
|
|
|