///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RigBoundingBoxIjk.h" #include "RimIntersection.h" #include "cafAppEnum.h" #include "cafPdmField.h" #include "cafVecIjk.h" #include class RigMainGrid; class RivIjkIntersectionPartMgr; //================================================================================================== /// /// Intersection following the grid pillars at a fixed i, j or k index. Unlike the axis-aligned /// intersection box, the surface follows the cell faces and therefore steps along faults and /// curved pillars. //================================================================================================== class RimIjkIntersection : public RimIntersection { CAF_PDM_HEADER_INIT; public: enum class GridAxis { AXIS_I, AXIS_J, AXIS_K }; public: RimIjkIntersection(); ~RimIjkIntersection() override; QString name() const override; void setName( const QString& newName ); GridAxis axis() const; bool useNegativeFace() const; // Index accessors and setters use 0-based grid indices; the PDM fields and UI are 1-based int fixedIndex() const; RigBoundingBoxIjk ijkRange() const; void setAxis( GridAxis axis ); void setUseNegativeFace( bool useNegativeFace ); void setFixedIndex( int fixedIndex ); void setIjkRange( const RigBoundingBoxIjk& range ); void setToDefaultValues(); RivIjkIntersectionPartMgr* intersectionPartMgr(); void clearGeometry(); RigMainGrid* mainGrid() const; const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override; bool supportsSurfaceIntersectionCurves() const override; RimIntersectionCurtain surfaceCurtain() const override; void rebuildGeometryAndScheduleCreateDisplayModel() override; void appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const override; /// The index range of the visible cells, with the fixed axis collapsed to the fixed index. The /// grid is passed in, as the intersection is not always reachable from a view. std::optional> clampedCellRange( const RigMainGrid* grid ) const; protected: caf::PdmFieldHandle* userDescriptionField() final; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; private: int axisCellCount() const; private: caf::PdmField m_name; caf::PdmField> m_axis; caf::PdmField m_useNegativeFace; caf::PdmField m_fixedIndex; caf::PdmField m_iMin; caf::PdmField m_iMax; caf::PdmField m_jMin; caf::PdmField m_jMax; caf::PdmField m_kMin; caf::PdmField m_kMax; cvf::ref m_intersectionPartMgr; };