(#657) Added cross section and cross section collection

This commit is contained in:
Magne Sjaastad 2015-11-18 09:15:13 +01:00
parent cc1a8cf28d
commit f2e8062410
9 changed files with 284 additions and 3 deletions

View File

@ -72,6 +72,8 @@ ${CEE_CURRENT_LIST_DIR}RimWellLogExtractionCurve.h
${CEE_CURRENT_LIST_DIR}RimWellLogFile.h
${CEE_CURRENT_LIST_DIR}RimWellLogFileChannel.h
${CEE_CURRENT_LIST_DIR}RimWellLogFileCurve.h
${CEE_CURRENT_LIST_DIR}RimCrossSection.h
${CEE_CURRENT_LIST_DIR}RimCrossSectionCollection.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -142,6 +144,8 @@ ${CEE_CURRENT_LIST_DIR}RimWellLogExtractionCurve.cpp
${CEE_CURRENT_LIST_DIR}RimWellLogFile.cpp
${CEE_CURRENT_LIST_DIR}RimWellLogFileChannel.cpp
${CEE_CURRENT_LIST_DIR}RimWellLogFileCurve.cpp
${CEE_CURRENT_LIST_DIR}RimCrossSection.cpp
${CEE_CURRENT_LIST_DIR}RimCrossSectionCollection.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -0,0 +1,103 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimCrossSection.h"
namespace caf {
template<>
void caf::AppEnum< RimCrossSection::CrossSectionEnum >::setUp()
{
addItem(RimCrossSection::CS_WELL_PATH, "WELL_PATH", "Well Path");
addItem(RimCrossSection::CS_SIMULATION_WELL, "SIMULATION_WELL", "Simulation Well");
addItem(RimCrossSection::CS_USER_DEFINED, "USER_DEFINED", "User defined");
setDefault(RimCrossSection::CS_WELL_PATH);
}
}
CAF_PDM_SOURCE_INIT(RimCrossSection, "CrossSection");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCrossSection::RimCrossSection()
{
CAF_PDM_InitObject("Cross Section", "", "", "");
CAF_PDM_InitField(&name, "UserDescription", QString("Cross Section Name"), "Name", "", "", "");
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
isActive.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&crossSectionType, "CrossSectionType", "Type", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCrossSection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimCrossSection::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
if (useOptionsOnly) (*useOptionsOnly) = true;
/*
if (&gridIndex == fieldNeedingOptions)
{
for (int gIdx = 0; gIdx < parentContainer()->gridCount(); ++gIdx)
{
QString gridName;
gridName += parentContainer()->gridName(gIdx);
if (gIdx == 0)
{
if (gridName.isEmpty())
gridName += "Main Grid";
else
gridName += " (Main Grid)";
}
caf::PdmOptionItemInfo item(gridName, (int)gIdx);
options.push_back(item);
}
}
*/
return options;
}

View File

@ -0,0 +1,68 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafAppEnum.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
class RimWellPath;
class RimEclipseWell;
//==================================================================================================
//
//
//
//==================================================================================================
class RimCrossSection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
enum CrossSectionEnum
{
CS_WELL_PATH,
CS_SIMULATION_WELL,
CS_USER_DEFINED
};
public:
RimCrossSection();
caf::PdmField<QString> name;
caf::PdmField<bool> isActive;
caf::PdmField< caf::AppEnum< CrossSectionEnum > > crossSectionType;
caf::PdmPtrField<RimWellPath*> wellPath;
caf::PdmPtrField<RimEclipseWell*> simulationWell;
protected:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
// virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
// virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName);
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
private:
};

View File

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimCrossSectionCollection.h"
#include "RimCrossSection.h"
CAF_PDM_SOURCE_INIT(RimCrossSectionCollection, "CrossSectionCollection");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCrossSectionCollection::RimCrossSectionCollection()
{
CAF_PDM_InitObject("Cross Sections", ":/undefined_image.png", "", "");
CAF_PDM_InitFieldNoDefault(&crossSections, "CrossSections", "Cross Sections", "", "", "");
crossSections.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
isActive.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimCrossSectionCollection::objectToggleField()
{
return &isActive;
}

View File

@ -0,0 +1,47 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmObject.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
class RimCrossSection;
//==================================================================================================
//
//
//
//==================================================================================================
class RimCrossSectionCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimCrossSectionCollection();
caf::PdmField<bool> isActive;
caf::PdmChildArrayField<RimCrossSection*> crossSections;
protected:
//virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
//virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName);
virtual caf::PdmFieldHandle* objectToggleField();
};

View File

@ -31,6 +31,7 @@
#include "Rim3dOverlayInfoConfig.h"
#include "RimCellEdgeColors.h"
#include "RimCellRangeFilterCollection.h"
#include "RimCrossSectionCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseFaultColors.h"
@ -1349,6 +1350,7 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
uiTreeOrdering.add(m_rangeFilterCollection());
uiTreeOrdering.add(m_propertyFilterCollection());
uiTreeOrdering.add(m_crossSectionCollection());
uiTreeOrdering.setForgetRemainingFields(true);
}

View File

@ -29,6 +29,7 @@
#include "Rim3dOverlayInfoConfig.h"
#include "RimCellRangeFilterCollection.h"
#include "RimCrossSectionCollection.h"
#include "RimEclipseView.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechCellColors.h"
@ -636,6 +637,7 @@ void RimGeoMechView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
uiTreeOrdering.add(m_rangeFilterCollection());
uiTreeOrdering.add(m_propertyFilterCollection());
uiTreeOrdering.add(m_crossSectionCollection());
uiTreeOrdering.setForgetRemainingFields(true);
}

View File

@ -7,10 +7,12 @@
#include "Rim3dOverlayInfoConfig.h"
#include "RimCellRangeFilterCollection.h"
#include "RimCrossSectionCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimPropertyFilterCollection.h"
#include "RimViewController.h"
#include "RimViewLinker.h"
#include "RimViewLinkerCollection.h"
@ -31,7 +33,6 @@
#include "cvfViewport.h"
#include <limits.h>
#include "RimPropertyFilterCollection.h"
namespace caf {
@ -40,8 +41,8 @@ template<>
void caf::AppEnum< RimView::MeshModeType >::setUp()
{
addItem(RimView::FULL_MESH, "FULL_MESH", "All");
addItem(RimView::FAULTS_MESH, "FAULTS_MESH", "Faults only");
addItem(RimView::NO_MESH, "NO_MESH", "None");
addItem(RimView::FAULTS_MESH, "FAULTS_MESH", "Faults only");
addItem(RimView::NO_MESH, "NO_MESH", "None");
setDefault(RimView::FULL_MESH);
}
@ -116,6 +117,10 @@ RimView::RimView(void)
m_overrideRangeFilterCollection.xmlCapability()->setIOWritable(false);
m_overrideRangeFilterCollection.xmlCapability()->setIOReadable(false);
CAF_PDM_InitFieldNoDefault(&m_crossSectionCollection, "CrossSections", "Cross Sections", "", "", "");
m_crossSectionCollection.uiCapability()->setUiHidden(true);
m_crossSectionCollection = new RimCrossSectionCollection();
m_previousGridModeMeshLinesWasFaults = false;
}

View File

@ -44,6 +44,7 @@ class RiuViewer;
class RimViewLinker;
class RimViewController;
class RimPropertyFilterCollection;
class RimCrossSectionCollection;
namespace cvf
{
@ -190,6 +191,8 @@ protected:
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
caf::PdmChildField<RimCellRangeFilterCollection*> m_overrideRangeFilterCollection;
caf::PdmChildField<RimCrossSectionCollection*> m_crossSectionCollection;
// Overridden PDM methods:
virtual void setupBeforeSave();