#2474 Fractures. Do not store object name to project file

This commit is contained in:
Bjørn Erik Jensen 2018-03-06 14:18:26 +01:00
parent 2435e92be1
commit 1792163d55
5 changed files with 110 additions and 6 deletions

View File

@ -87,6 +87,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimMdiWindowController.h
${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilter.h
${CMAKE_CURRENT_LIST_DIR}/RimNamedObject.h
${CMAKE_CURRENT_LIST_DIR}/RimCheckableNamedObject.h
${CMAKE_CURRENT_LIST_DIR}/RimCheckableObject.h
${CMAKE_CURRENT_LIST_DIR}/RimGridTimeHistoryCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimGeometrySelectionItem.h
${CMAKE_CURRENT_LIST_DIR}/RimEclipseGeometrySelectionItem.h
@ -188,6 +189,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimMdiWindowController.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilter.cpp
${CMAKE_CURRENT_LIST_DIR}/RimNamedObject.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCheckableNamedObject.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCheckableObject.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGridTimeHistoryCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGeometrySelectionItem.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEclipseGeometrySelectionItem.cpp

View File

@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimCheckableObject.h"
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimCheckableObject, "RimCheckableObject"); // Do not use. Abstract class
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCheckableObject::RimCheckableObject(void)
{
CAF_PDM_InitField(&m_isChecked, "IsChecked", true, "Active", "", "", "");
m_isChecked.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCheckableObject::~RimCheckableObject(void)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimCheckableObject::isChecked() const
{
return m_isChecked();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCheckableObject::setCheckState(bool checkState)
{
m_isChecked = checkState;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimCheckableObject::objectToggleField()
{
return &m_isChecked;
}

View File

@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil 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 <cafPdmObject.h>
#include <cafPdmField.h>
//==================================================================================================
///
///
//==================================================================================================
class RimCheckableObject : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimCheckableObject(void);
virtual ~RimCheckableObject(void);
bool isChecked() const;
void setCheckState(bool checkState);
protected:
virtual caf::PdmFieldHandle* objectToggleField() override;
protected:
caf::PdmField<bool> m_isChecked;
};

View File

@ -64,7 +64,7 @@ static QString toString(const std::pair<QString, QString>& resultNameAndUnit);
//--------------------------------------------------------------------------------------------------
RimStimPlanColors::RimStimPlanColors()
{
CAF_PDM_InitObject("StimPlan Colors", ":/FractureSymbol16x16.png", "", "");
CAF_PDM_InitObject("Fractures", ":/FractureSymbol16x16.png", "", "");
CAF_PDM_InitField(&m_resultNameAndUnit, "ResultName", QString(""), "Result Variable", "", "", "");
@ -76,9 +76,6 @@ RimStimPlanColors::RimStimPlanColors()
CAF_PDM_InitField(&m_showStimPlanMesh, "ShowStimPlanMesh", true, "Show Mesh", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_stimPlanCellVizMode, "StimPlanCellVizMode", "Color Interpolation", "", "", "");
setName("Fractures");
nameField()->uiCapability()->setUiReadOnly(true);
}
//--------------------------------------------------------------------------------------------------

View File

@ -18,7 +18,7 @@
#pragma once
#include "RimCheckableNamedObject.h"
#include "RimCheckableObject.h"
#include "cafAppEnum.h"
#include "cafPdmChildField.h"
@ -40,7 +40,7 @@ class RimFractureTemplateCollection;
///
///
//==================================================================================================
class RimStimPlanColors : public RimCheckableNamedObject
class RimStimPlanColors : public RimCheckableObject
{
CAF_PDM_HEADER_INIT;