mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#1248 Add namedObject and checkableNamedObject
This commit is contained in:
parent
38485fd96d
commit
8eb8a6fd3b
@ -85,6 +85,8 @@ ${CEE_CURRENT_LIST_DIR}RimIntersectionBox.h
|
||||
${CEE_CURRENT_LIST_DIR}RimMultiSnapshotDefinition.h
|
||||
${CEE_CURRENT_LIST_DIR}RimMdiWindowController.h
|
||||
${CEE_CURRENT_LIST_DIR}RimPropertyFilter.h
|
||||
${CEE_CURRENT_LIST_DIR}RimNamedObject.h
|
||||
${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -168,6 +170,8 @@ ${CEE_CURRENT_LIST_DIR}RimIntersectionBox.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimMultiSnapshotDefinition.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimMdiWindowController.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimPropertyFilter.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimNamedObject.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
61
ApplicationCode/ProjectDataModel/RimCheckableNamedObject.cpp
Normal file
61
ApplicationCode/ProjectDataModel/RimCheckableNamedObject.cpp
Normal 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 "RimCheckableNamedObject.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimCheckableNamedObject, "CheckableNamedObject"); // Do not use. Abstract class
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimCheckableNamedObject::RimCheckableNamedObject(void)
|
||||
{
|
||||
CAF_PDM_InitField(&m_isChecked, "IsChecked", true, "Active", "", "", "");
|
||||
m_isChecked.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimCheckableNamedObject::~RimCheckableNamedObject(void)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimCheckableNamedObject::isChecked() const
|
||||
{
|
||||
return m_isChecked();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCheckableNamedObject::setCheckState(bool checkState)
|
||||
{
|
||||
m_isChecked = checkState;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimCheckableNamedObject::objectToggleField()
|
||||
{
|
||||
return &m_isChecked;
|
||||
}
|
43
ApplicationCode/ProjectDataModel/RimCheckableNamedObject.h
Normal file
43
ApplicationCode/ProjectDataModel/RimCheckableNamedObject.h
Normal file
@ -0,0 +1,43 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimNamedObject.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimCheckableNamedObject : public RimNamedObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimCheckableNamedObject(void);
|
||||
virtual ~RimCheckableNamedObject(void);
|
||||
|
||||
bool isChecked() const;
|
||||
void setCheckState(bool checkState);
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isChecked;
|
||||
};
|
||||
|
61
ApplicationCode/ProjectDataModel/RimNamedObject.cpp
Normal file
61
ApplicationCode/ProjectDataModel/RimNamedObject.cpp
Normal 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 "RimNamedObject.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimNamedObject, "NamedObject"); // Do not use. Abstract class
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNamedObject::RimNamedObject(void)
|
||||
{
|
||||
CAF_PDM_InitField(&m_name, "Name", QString(), "Name", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimNamedObject::~RimNamedObject(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimNamedObject::name() const
|
||||
{
|
||||
return m_name();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimNamedObject::setName(const QString& name)
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimNamedObject::userDescriptionField()
|
||||
{
|
||||
return &m_name;
|
||||
}
|
46
ApplicationCode/ProjectDataModel/RimNamedObject.h
Normal file
46
ApplicationCode/ProjectDataModel/RimNamedObject.h
Normal file
@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 RimNamedObject : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimNamedObject(void);
|
||||
virtual ~RimNamedObject(void);
|
||||
|
||||
QString name() const;
|
||||
void setName(const QString& name);
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user