2020-01-03 06:49:12 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2020- 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
|
|
|
|
|
2020-08-24 04:09:22 -05:00
|
|
|
#include "cafPdmField.h"
|
|
|
|
|
2020-01-03 06:49:12 -06:00
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
|
|
|
class RimSurface;
|
2020-05-03 04:29:33 -05:00
|
|
|
class RimCase;
|
2020-01-03 06:49:12 -06:00
|
|
|
|
|
|
|
class RimSurfaceCollection : public caf::PdmObject
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RimSurfaceCollection();
|
|
|
|
~RimSurfaceCollection() override;
|
|
|
|
|
|
|
|
void addSurface( RimSurface* surface );
|
2020-08-24 04:09:22 -05:00
|
|
|
void setAsTopmostFolder();
|
2020-01-03 06:49:12 -06:00
|
|
|
|
2021-05-18 07:28:54 -05:00
|
|
|
RimSurface* importSurfacesFromFiles( const QStringList& fileNames, bool showLegend = true );
|
2020-05-03 04:29:33 -05:00
|
|
|
RimSurface* addGridCaseSurface( RimCase* sourceCase );
|
2020-08-24 04:09:22 -05:00
|
|
|
RimSurface* copySurfaces( std::vector<RimSurface*> surfaces );
|
|
|
|
RimSurface* addSurfacesAtIndex( int index, std::vector<RimSurface*> surfaces );
|
2020-01-03 06:49:12 -06:00
|
|
|
|
2020-08-26 05:31:23 -05:00
|
|
|
void addSubCollection( RimSurfaceCollection* collection );
|
|
|
|
RimSurfaceCollection* getSubCollection( const QString name );
|
2020-08-11 04:34:34 -05:00
|
|
|
|
2021-05-18 07:28:54 -05:00
|
|
|
bool containsFileSurface( QString filename );
|
2020-09-18 07:43:15 -05:00
|
|
|
bool containsSurface();
|
|
|
|
|
2020-08-24 04:09:22 -05:00
|
|
|
void reloadSurfaces( std::vector<RimSurface*> surfaces );
|
|
|
|
void removeSurface( RimSurface* surface );
|
2021-05-18 07:28:54 -05:00
|
|
|
void removeMissingFileSurfaces();
|
2020-01-06 04:30:06 -06:00
|
|
|
|
2020-01-08 04:56:48 -06:00
|
|
|
void loadData();
|
2020-08-24 04:09:22 -05:00
|
|
|
|
2020-01-06 04:30:06 -06:00
|
|
|
void updateViews();
|
2021-05-18 07:28:54 -05:00
|
|
|
void updateViews( const std::vector<RimSurface*>& surfsToReload, bool showLegend = true );
|
2020-01-03 06:49:12 -06:00
|
|
|
|
2020-05-18 09:02:27 -05:00
|
|
|
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
|
|
|
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
|
|
|
|
2020-08-26 05:31:23 -05:00
|
|
|
QString collectionName() const;
|
|
|
|
void setCollectionName( const QString name );
|
2020-08-24 04:09:22 -05:00
|
|
|
|
|
|
|
std::vector<RimSurface*> surfaces() const;
|
2020-08-26 05:31:23 -05:00
|
|
|
std::vector<RimSurfaceCollection*> subCollections() const;
|
2020-08-24 04:09:22 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
caf::PdmFieldHandle* userDescriptionField() override;
|
|
|
|
|
2020-01-08 04:56:48 -06:00
|
|
|
private:
|
2020-08-24 04:09:22 -05:00
|
|
|
void orderChanged( const caf::SignalEmitter* emitter );
|
|
|
|
|
2020-08-26 05:31:23 -05:00
|
|
|
caf::PdmField<QString> m_collectionName;
|
2020-08-24 04:09:22 -05:00
|
|
|
caf::PdmChildArrayField<RimSurface*> m_surfaces;
|
2020-08-26 05:31:23 -05:00
|
|
|
caf::PdmChildArrayField<RimSurfaceCollection*> m_subCollections;
|
2020-01-03 06:49:12 -06:00
|
|
|
};
|