///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2024 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 "RimNestedMirrorCollectionInView.h" #include "RimPolygonContainer.h" #include "RimPolygonInView.h" class RimPolygon; //================================================================================================== /// /// //================================================================================================== class RimPolygonInViewCollection : public RimNestedMirrorCollectionInView { CAF_PDM_HEADER_INIT; public: RimPolygonInViewCollection(); void updateFromPolygonCollection(); std::vector visiblePolygonsInView() const; std::vector allPolygonsInView() const; bool setPolygonVisible( RimPolygon* polygon, bool visible ); protected: std::vector sourceSubCollections() const override; std::vector sourceItems() const override; RimPolygonInView* createItemInView( RimPolygon* source ) override; private: RimPolygonInView* findPolygonInView( const RimPolygon* polygon ) const; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const override; };