mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3558 Grid items in Project Tree : Control grid visibility from checked state
This commit is contained in:
@@ -2,34 +2,34 @@
|
||||
//
|
||||
// Copyright (C) Statoil ASA
|
||||
// Copyright (C) Ceetron Solutions AS
|
||||
//
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RigMainGrid;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimGridInfo : public caf::PdmObject
|
||||
{
|
||||
@@ -39,23 +39,22 @@ public:
|
||||
RimGridInfo();
|
||||
~RimGridInfo() {}
|
||||
|
||||
void setName(const QString& name);
|
||||
void setIndex(int index);
|
||||
bool isActive() const;
|
||||
QString name() const;
|
||||
int index() const;
|
||||
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
void setActive(bool active);
|
||||
void setName(const QString& name);
|
||||
void setIndex(int index);
|
||||
|
||||
QString name() const;
|
||||
int index() const;
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<QString> m_gridName;
|
||||
caf::PdmField<int> m_gridIndex;
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<QString> m_gridName;
|
||||
caf::PdmField<int> m_gridIndex;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
@@ -69,14 +68,15 @@ public:
|
||||
RimGridInfoCollection();
|
||||
~RimGridInfoCollection() {}
|
||||
|
||||
void addGridInfo(const QString& name, size_t gridIndex);
|
||||
void clear();
|
||||
bool containsGrid(const QString& gridName) const;
|
||||
void deleteGridInfo(const QString& gridName);
|
||||
bool isActive() const;
|
||||
void addGridInfo(const QString& name, size_t gridIndex);
|
||||
void clear();
|
||||
bool containsGrid(const QString& gridName) const;
|
||||
void deleteGridInfo(const QString& gridName);
|
||||
std::vector<RimGridInfo*> gridInfos() const;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
@@ -85,34 +85,36 @@ private:
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimGridCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimGridCollection();
|
||||
~RimGridCollection() override;
|
||||
|
||||
void setActive(bool active);
|
||||
bool isActive() const;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void syncFromMainGrid();
|
||||
void setActive(bool active);
|
||||
bool isActive() const;
|
||||
std::vector<size_t> indicesToVisibleGrids() const;
|
||||
|
||||
static const QString persistentGridUiName();
|
||||
static const QString temporaryGridUiName();
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void syncFromMainGrid();
|
||||
static const QString persistentGridUiName();
|
||||
static const QString temporaryGridUiName();
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void initAfterRead() override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void initAfterRead() override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
|
||||
private:
|
||||
const RigMainGrid* mainGrid() const;
|
||||
const RigMainGrid* mainGrid() const;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmChildField<RimGridInfo*> m_mainGrid;
|
||||
caf::PdmChildField<RimGridInfoCollection*> m_persistentLgrs;
|
||||
caf::PdmChildField<RimGridInfoCollection*> m_temporaryLgrs;
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmChildField<RimGridInfo*> m_mainGrid;
|
||||
caf::PdmChildField<RimGridInfoCollection*> m_persistentLgrs;
|
||||
caf::PdmChildField<RimGridInfoCollection*> m_temporaryLgrs;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user