mirror of
				https://github.com/OPM/ResInsight.git
				synced 2025-02-25 18:55:39 -06:00 
			
		
		
		
	Use uiField() when issuing setUi....() commands Use PdmChildArrayField instead of PdmPointersFielc Use PdmChildField instead of PdmField to pdm pointer objects Use PdmChildArrayField instead of PdmField< std::list< caf::PdmPointer< type > > > Use PdmObjectHandle instead of PdmObject Replaced parentFields(std::vector) with parentField() Use PdmUiPropertyViewDialog instead of PdmUiPropertyDialog
		
			
				
	
	
		
			162 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			162 lines
		
	
	
		
			5.8 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
/////////////////////////////////////////////////////////////////////////////////
 | 
						|
//
 | 
						|
//  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
 | 
						|
 | 
						|
#include "cafAppEnum.h"
 | 
						|
#include "cafPdmChildField.h"
 | 
						|
#include "cafPdmField.h"
 | 
						|
#include "cafPdmFieldCvfColor.h"    
 | 
						|
#include "cafPdmFieldCvfMat4d.h"
 | 
						|
#include "cafPdmObject.h"
 | 
						|
 | 
						|
#include "RivCellSetEnum.h"
 | 
						|
 | 
						|
#include <QPointer>
 | 
						|
 | 
						|
class RiuViewer;
 | 
						|
class Rim3dOverlayInfoConfig;
 | 
						|
class RimCase;
 | 
						|
class RimCellRangeFilterCollection;
 | 
						|
 | 
						|
namespace cvf
 | 
						|
{
 | 
						|
    class BoundingBox;
 | 
						|
    class Scene;
 | 
						|
    class ModelBasicList;
 | 
						|
    class Transform;
 | 
						|
}
 | 
						|
 | 
						|
//==================================================================================================
 | 
						|
///  
 | 
						|
///  
 | 
						|
//==================================================================================================
 | 
						|
class RimView : public caf::PdmObject
 | 
						|
{
 | 
						|
    CAF_PDM_HEADER_INIT;
 | 
						|
public:
 | 
						|
    RimView(void);
 | 
						|
    virtual ~RimView(void);
 | 
						|
 | 
						|
    // 3D Viewer
 | 
						|
    RiuViewer*                              viewer();
 | 
						|
 | 
						|
    caf::PdmField<QString>                  name;
 | 
						|
    caf::PdmField<double>                   scaleZ;
 | 
						|
 | 
						|
    caf::PdmField<bool>                     showWindow;
 | 
						|
    caf::PdmField<cvf::Mat4d>               cameraPosition;
 | 
						|
    caf::PdmField< cvf::Color3f >           backgroundColor;
 | 
						|
 | 
						|
    caf::PdmField<int>                      maximumFrameRate;
 | 
						|
    caf::PdmField<bool>                     hasUserRequestedAnimation;
 | 
						|
 | 
						|
    caf::PdmChildField<RimCellRangeFilterCollection*>    rangeFilterCollection;
 | 
						|
 | 
						|
    // 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();
 | 
						|
 | 
						|
    void                                    disableLighting(bool disable);
 | 
						|
    bool                                    isLightingDisabled() const;
 | 
						|
   
 | 
						|
    void                                    setShowFaultsOnly(bool showFaults);
 | 
						|
    bool                                    isGridVisualizationMode() const;
 | 
						|
 | 
						|
    // Animation
 | 
						|
    int                                     currentTimeStep()    { return m_currentTimeStep;}
 | 
						|
    void                                    setCurrentTimeStep(int frameIdx);
 | 
						|
    void                                    updateCurrentTimeStepAndRedraw();
 | 
						|
    void                                    endAnimation();
 | 
						|
 | 
						|
    virtual void                            scheduleGeometryRegen(RivCellSetEnum geometryType) = 0;
 | 
						|
    void                                    scheduleCreateDisplayModelAndRedraw();
 | 
						|
    void                                    createDisplayModelAndRedraw();
 | 
						|
 | 
						|
public:
 | 
						|
    virtual void                            loadDataAndUpdate() = 0;
 | 
						|
    virtual RimCase*                        ownerCase() = 0;
 | 
						|
 | 
						|
    virtual caf::PdmFieldHandle*            objectToggleField()     { return &showWindow; }
 | 
						|
    virtual caf::PdmFieldHandle*            userDescriptionField()  { return &name; }
 | 
						|
protected:
 | 
						|
 | 
						|
    void                                    setDefaultView();
 | 
						|
 | 
						|
    void                                    addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList, 
 | 
						|
                                                                const cvf::Vec3d& displayModelOffset,  
 | 
						|
                                                                double characteristicCellSize, 
 | 
						|
                                                                const cvf::BoundingBox& wellPathClipBoundingBox, 
 | 
						|
                                                                cvf::Transform* scaleTransform);
 | 
						|
 | 
						|
    virtual void                            createDisplayModel() = 0;
 | 
						|
    virtual void                            updateDisplayModelVisibility() = 0;
 | 
						|
    virtual void                            clampCurrentTimestep() = 0;
 | 
						|
 | 
						|
    virtual void                            updateCurrentTimeStep() = 0;
 | 
						|
    virtual void                            updateStaticCellColors() = 0;
 | 
						|
 
 | 
						|
    virtual void                            updateScaleTransform() = 0;
 | 
						|
    virtual cvf::Transform*                 scaleTransform() = 0;
 | 
						|
 | 
						|
    void                                    updateViewerWidget();
 | 
						|
    virtual void                            updateViewerWidgetWindowTitle() = 0;
 | 
						|
 | 
						|
    virtual void                            resetLegendsInViewer() = 0;
 | 
						|
 
 | 
						|
    QPointer<RiuViewer>                     m_viewer;
 | 
						|
 | 
						|
    caf::PdmField<int>                      m_currentTimeStep;
 | 
						|
    caf::PdmChildField<Rim3dOverlayInfoConfig*>  overlayInfoConfig;
 | 
						|
 | 
						|
    // Overridden PDM methods:
 | 
						|
    virtual void                            setupBeforeSave();
 | 
						|
 | 
						|
    virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
 | 
						|
 | 
						|
private:
 | 
						|
    bool                                    m_previousGridModeMeshLinesWasFaults;
 | 
						|
    caf::PdmField<bool>                     m_disableLighting;
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
 |