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>
|
|
|
|
|
|
|
|
#include "RimReservoir.h"
|
|
|
|
#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"
|
|
|
|
|
|
|
|
class RIViewer;
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
// Public fields:
|
|
|
|
|
|
|
|
caf::PdmField<RimResultSlot*> cellResult;
|
|
|
|
caf::PdmField<RimCellEdgeResultSlot*> cellEdgeResult;
|
2012-09-11 02:22:36 -05:00
|
|
|
caf::PdmField<Rim3dOverlayInfoConfig*> overlayInfoConfig;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
caf::PdmField<double> scaleZ;
|
|
|
|
caf::PdmField<bool> showWindow;
|
|
|
|
caf::PdmField<QString> name;
|
|
|
|
|
|
|
|
// Visibility
|
|
|
|
caf::PdmField<bool> showInvalidCells;
|
|
|
|
caf::PdmField<bool> showInactiveCells;
|
|
|
|
caf::PdmField<bool> showMainGrid;
|
|
|
|
|
|
|
|
caf::PdmField<RimWellCollection*> wellCollection;
|
|
|
|
|
|
|
|
caf::PdmField<RimCellRangeFilterCollection*> rangeFilterCollection;
|
|
|
|
caf::PdmField<RimCellPropertyFilterCollection*> propertyFilterCollection;
|
|
|
|
|
|
|
|
caf::PdmField< caf::AppEnum< MeshModeType > > meshMode;
|
|
|
|
caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode;
|
|
|
|
|
|
|
|
// Animation
|
|
|
|
caf::PdmField<int> maximumFrameRate;
|
|
|
|
caf::PdmField<bool> animationMode;
|
|
|
|
|
|
|
|
int currentTimeStep() { return m_currentTimeStep;}
|
|
|
|
void setCurrentTimeStep(int frameIdx);
|
|
|
|
void updateCurrentTimeStepAndRedraw();
|
|
|
|
void endAnimation();
|
|
|
|
|
|
|
|
// 3D Viewer
|
|
|
|
// Cam pos should be a field, but is not yet supported bu caf::Pdm
|
2013-02-05 09:35:04 -06:00
|
|
|
caf::PdmField<cvf::Mat4d> cameraPosition;
|
2012-05-18 02:45:23 -05:00
|
|
|
void setDefaultView();
|
|
|
|
|
|
|
|
RIViewer* viewer();
|
|
|
|
void updateViewerWidget();
|
|
|
|
void updateViewerWidgetWindowTitle();
|
|
|
|
|
|
|
|
// Picking info
|
|
|
|
bool pickInfo(size_t gridIndex, size_t cellIndex, const cvf::Vec3d& point, QString* pickInfoText) const;
|
|
|
|
void appendCellResultInfo(size_t gridIndex, size_t cellIndex, QString* resultInfoText) const;
|
|
|
|
|
|
|
|
RigReservoirCellResults* gridCellResults();
|
|
|
|
|
|
|
|
void setEclipseCase(RimReservoir* reservoir);
|
|
|
|
RimReservoir* eclipseCase();
|
|
|
|
|
|
|
|
void calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleCells, RigGridBase * grid);
|
|
|
|
|
|
|
|
|
|
|
|
// Display model generation
|
|
|
|
public:
|
|
|
|
void loadDataAndUpdate();
|
|
|
|
void createDisplayModelAndRedraw();
|
|
|
|
void scheduleGeometryRegen(unsigned short geometryType);
|
|
|
|
void schedulePipeGeometryRegen();
|
|
|
|
|
|
|
|
// Overridden PDM methods:
|
|
|
|
public:
|
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() { return &name;}
|
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
|
|
|
protected:
|
|
|
|
virtual void initAfterRead();
|
|
|
|
virtual void setupBeforeSave();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
2013-02-07 06:44:18 -06:00
|
|
|
void syncronizeWellsWithResults();
|
|
|
|
void clampCurrentTimestep();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
caf::PdmField<int> m_currentTimeStep;
|
|
|
|
QPointer<RIViewer> m_viewer;
|
|
|
|
caf::PdmPointer<RimReservoir> m_reservoir;
|
|
|
|
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
|
|
|
|
cvf::ref<RivReservoirViewPartMgr> m_geometry;
|
|
|
|
cvf::ref<RivReservoirPipesPartMgr> m_pipesPartManager;
|
|
|
|
};
|
|
|
|
|