Files
ResInsight/ApplicationLibCode/ProjectDataModelCommands/RimcCase.h
T
Kristian Bendiksen bdef98203b #14772 Python: Add Case.create_view as object method and forward createView to it
RimCase_createView creates a 3D view in an Eclipse or GeoMech case and
returns it. RicfCreateView forwards to it and wraps the view id in the
legacy createViewResult. The hand-written Python create_view() wrapper
is removed since the generated method has the same name and signature.
2026-09-22 14:19:23 +02:00

66 lines
2.4 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- 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 <QString>
class Rim3dView;
//==================================================================================================
/// Replace the grid file of a case (Eclipse result case or GeoMech case) and reload the project.
///
/// The project must be saved to file, as the replacement is performed by reloading the project
/// through a RiaProjectModifier. An explicit project file can be given to override the current
/// project file name (used by the legacy command file interface).
//==================================================================================================
class RimCase_replaceGrid : public caf::PdmVoidObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimCase_replaceGrid( caf::PdmObjectHandle* self );
void setNewGridFile( const QString& newGridFile );
void setProjectFile( const QString& projectFile );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
private:
caf::PdmField<QString> m_newGridFile;
caf::PdmField<QString> m_projectFile;
};
//==================================================================================================
/// Create a new 3D view in the case. Supports Eclipse cases and GeoMech cases.
//==================================================================================================
class RimCase_createView : public caf::PdmObjectCreationMethod
{
CAF_PDM_HEADER_INIT;
public:
RimCase_createView( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
};