mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 06:38:13 -05:00
Rim3dView_setTimeStep validates the time step against the owner case and updates the view. RicfSetTimeStep forwards to it, looping over all views of the case when viewId is -1. The hand-written Python View.set_time_step() wrapper is removed since the generated method has the same name and signature. Also fix the argument description of the new Rimc methods: the whatsThis text is the third variadic argument of CAF_PDM_InitScriptableField.
130 lines
4.3 KiB
C++
130 lines
4.3 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2025 Equinor ASA
|
|
//
|
|
// 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 "cafPdmField.h"
|
|
#include "cafPdmObjectHandle.h"
|
|
#include "cafPdmObjectMethod.h"
|
|
#include "cafPdmPtrField.h"
|
|
|
|
#include <QString>
|
|
|
|
class RimPolygon;
|
|
class RimSurface;
|
|
|
|
//==================================================================================================
|
|
///
|
|
//==================================================================================================
|
|
class RimcGridView_visibleCellsInternal : public caf::PdmVoidObjectMethod
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
RimcGridView_visibleCellsInternal( caf::PdmObjectHandle* self );
|
|
|
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
|
|
|
private:
|
|
caf::PdmField<QString> m_visibilityKey;
|
|
caf::PdmField<int> m_timeStep;
|
|
};
|
|
|
|
//==================================================================================================
|
|
///
|
|
//==================================================================================================
|
|
class RimcGridView_setPolygonVisible : public caf::PdmVoidObjectMethod
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
RimcGridView_setPolygonVisible( caf::PdmObjectHandle* self );
|
|
|
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
|
|
|
private:
|
|
caf::PdmPtrField<RimPolygon*> m_polygon;
|
|
caf::PdmField<bool> m_visible;
|
|
};
|
|
|
|
//==================================================================================================
|
|
///
|
|
//==================================================================================================
|
|
class RimcGridView_setSurfaceVisible : public caf::PdmVoidObjectMethod
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
RimcGridView_setSurfaceVisible( caf::PdmObjectHandle* self );
|
|
|
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
|
|
|
private:
|
|
caf::PdmPtrField<RimSurface*> m_surface;
|
|
caf::PdmField<bool> m_visible;
|
|
};
|
|
|
|
//==================================================================================================
|
|
///
|
|
//==================================================================================================
|
|
class RimcGridView_setSurfaceProperty : public caf::PdmVoidObjectMethod
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
RimcGridView_setSurfaceProperty( caf::PdmObjectHandle* self );
|
|
|
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
|
|
|
private:
|
|
caf::PdmPtrField<RimSurface*> m_surface;
|
|
caf::PdmField<QString> m_propertyName;
|
|
};
|
|
|
|
//==================================================================================================
|
|
/// Clone the view and add the copy to the same case. Supports Eclipse and GeoMech views.
|
|
//==================================================================================================
|
|
class Rim3dView_clone : public caf::PdmObjectCreationMethod
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
Rim3dView_clone( caf::PdmObjectHandle* self );
|
|
|
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
|
QString classKeywordReturnedType() const override;
|
|
};
|
|
|
|
//==================================================================================================
|
|
/// Set the current time step of the view and redraw.
|
|
//==================================================================================================
|
|
class Rim3dView_setTimeStep : public caf::PdmVoidObjectMethod
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
Rim3dView_setTimeStep( caf::PdmObjectHandle* self );
|
|
|
|
void setTimeStep( int timeStep );
|
|
|
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
|
|
|
private:
|
|
caf::PdmField<int> m_timeStep;
|
|
};
|