2020-04-30 09:54:25 -05: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
|
|
|
|
|
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
|
|
|
class RimColorLegend;
|
2020-05-22 08:58:40 -05:00
|
|
|
class RimColorLegendItem;
|
2020-04-30 09:54:25 -05:00
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
class PdmUiEditorAttribute;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RimColorLegendCollection : public caf::PdmObject
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RimColorLegendCollection();
|
|
|
|
~RimColorLegendCollection() override;
|
|
|
|
|
2020-05-13 07:28:06 -05:00
|
|
|
void createStandardColorLegends();
|
|
|
|
void appendCustomColorLegend( RimColorLegend* customColorLegend );
|
|
|
|
bool isStandardColorLegend( RimColorLegend* colorLegend );
|
|
|
|
void deleteCustomColorLegends();
|
|
|
|
|
2020-05-23 04:19:36 -05:00
|
|
|
std::vector<RimColorLegend*> allColorLegends() const;
|
2020-05-06 15:30:51 -05:00
|
|
|
|
2020-05-22 02:01:08 -05:00
|
|
|
RimColorLegend* findByName( const QString& name ) const;
|
|
|
|
|
2020-09-08 02:23:27 -05:00
|
|
|
protected:
|
|
|
|
void initAfterRead() override;
|
|
|
|
|
2020-04-30 09:54:25 -05:00
|
|
|
private:
|
2020-05-22 08:58:40 -05:00
|
|
|
RimColorLegendItem* createColorLegendItem( const QString& name, int r, int g, int b ) const;
|
|
|
|
RimColorLegend* createRockTypeColorLegend() const;
|
|
|
|
|
2020-05-13 07:28:06 -05:00
|
|
|
caf::PdmChildArrayField<RimColorLegend*> m_standardColorLegends; // ResInsight standard (built-in) legends
|
|
|
|
caf::PdmChildArrayField<RimColorLegend*> m_customColorLegends; // user specified legends
|
2020-04-30 09:54:25 -05:00
|
|
|
};
|