2018-01-15 07:52:22 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2018- 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
#include "Rim2dIntersectionView.h"
|
2018-01-23 07:23:28 -06:00
|
|
|
#include "Rim2dIntersectionViewCollection.h"
|
2018-01-17 01:00:36 -06:00
|
|
|
#include "RimIntersection.h"
|
|
|
|
#include "RimCase.h"
|
2018-01-15 07:52:22 -06:00
|
|
|
#include "RiuViewer.h"
|
2018-01-17 01:00:36 -06:00
|
|
|
#include "RimGridView.h"
|
|
|
|
#include "RivIntersectionPartMgr.h"
|
2018-02-01 10:45:22 -06:00
|
|
|
#include "RivTernarySaturationOverlayItem.h"
|
2018-01-15 07:52:22 -06:00
|
|
|
|
|
|
|
#include "cvfPart.h"
|
2018-01-17 01:00:36 -06:00
|
|
|
#include "cvfModelBasicList.h"
|
2018-01-15 07:52:22 -06:00
|
|
|
#include "cvfTransform.h"
|
2018-01-17 01:00:36 -06:00
|
|
|
#include "cvfScene.h"
|
2018-01-25 10:37:22 -06:00
|
|
|
#include "RimEclipseView.h"
|
|
|
|
#include "RimEclipseCellColors.h"
|
|
|
|
#include "RimGeoMechView.h"
|
|
|
|
#include "RimGeoMechCellColors.h"
|
2018-02-01 10:45:22 -06:00
|
|
|
#include "RimLegendConfig.h"
|
|
|
|
#include "RimTernaryLegendConfig.h"
|
2018-01-25 10:37:22 -06:00
|
|
|
|
|
|
|
#include <QDateTime>
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-29 04:24:53 -06:00
|
|
|
CAF_PDM_SOURCE_INIT(Rim2dIntersectionView, "Intersection2dView");
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-26 01:41:44 -06:00
|
|
|
const cvf::Mat4d defaultIntersectinoViewMatrix(1, 0, 0, 0,
|
|
|
|
0, 0, 1, 0,
|
|
|
|
0, -1, 0, 1000,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
Rim2dIntersectionView::Rim2dIntersectionView(void)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
CAF_PDM_InitObject("Intersection View", ":/CrossSection16x16.png", "", "");
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_intersection, "Intersection", "Intersection", ":/CrossSection16x16.png", "", "");
|
2018-01-23 07:23:28 -06:00
|
|
|
m_intersection.uiCapability()->setUiHidden(true);
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-02-01 10:45:22 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
|
|
|
|
m_legendConfig.uiCapability()->setUiHidden(true);
|
|
|
|
m_legendConfig.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
m_legendConfig.xmlCapability()->disableIO();
|
|
|
|
m_legendConfig = new RimLegendConfig();
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_ternaryLegendConfig, "TernaryLegendDefinition", "Ternary Legend Definition", "", "", "");
|
|
|
|
m_ternaryLegendConfig.uiCapability()->setUiTreeHidden(true);
|
|
|
|
m_ternaryLegendConfig.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
m_ternaryLegendConfig.xmlCapability()->disableIO();
|
|
|
|
m_ternaryLegendConfig = new RimTernaryLegendConfig();
|
|
|
|
|
2018-01-23 07:23:28 -06:00
|
|
|
m_showWindow = false;
|
2018-01-17 01:00:36 -06:00
|
|
|
m_scaleTransform = new cvf::Transform();
|
|
|
|
m_intersectionVizModel = new cvf::ModelBasicList;
|
2018-01-29 04:24:53 -06:00
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
hasUserRequestedAnimation = true;
|
|
|
|
|
2018-01-26 01:41:44 -06:00
|
|
|
((RiuViewerToViewInterface*)this)->setCameraPosition(defaultIntersectinoViewMatrix );
|
2018-01-29 04:24:53 -06:00
|
|
|
|
|
|
|
disableGridBoxField();
|
|
|
|
disablePerspectiveProjectionField();
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
Rim2dIntersectionView::~Rim2dIntersectionView(void)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-01-23 07:23:28 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim2dIntersectionView::setVisible(bool isVisible)
|
|
|
|
{
|
|
|
|
m_showWindow = isVisible;
|
|
|
|
}
|
|
|
|
|
2018-01-17 04:05:31 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim2dIntersectionView::setIntersection(RimIntersection* intersection)
|
|
|
|
{
|
2018-01-25 10:37:22 -06:00
|
|
|
CAF_ASSERT(intersection);
|
|
|
|
|
2018-01-17 04:05:31 -06:00
|
|
|
m_intersection = intersection;
|
2018-01-23 07:23:28 -06:00
|
|
|
Rim3dView * parentView = nullptr;
|
|
|
|
intersection->firstAncestorOrThisOfTypeAsserted(parentView);
|
|
|
|
name = parentView->name() + ": " + intersection->name();
|
2018-01-25 10:37:22 -06:00
|
|
|
|
|
|
|
|
2018-01-23 07:23:28 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimIntersection* Rim2dIntersectionView::intersection()
|
|
|
|
{
|
|
|
|
return m_intersection();
|
2018-01-17 04:05:31 -06:00
|
|
|
}
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
bool Rim2dIntersectionView::isUsingFormationNames() const
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
// Todo:
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
return false;
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-25 10:37:22 -06:00
|
|
|
m_flatIntersectionPartMgr = nullptr;
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
RimCase* Rim2dIntersectionView::ownerCase() const
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
RimCase* rimCase = nullptr;
|
|
|
|
this->firstAncestorOrThisOfTypeAsserted(rimCase);
|
|
|
|
return rimCase;
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool Rim2dIntersectionView::isTimeStepDependentDataVisible() const
|
|
|
|
{
|
|
|
|
if ( m_intersection() )
|
|
|
|
{
|
|
|
|
RimGridView * gridView = nullptr;
|
|
|
|
m_intersection->firstAncestorOrThisOfTypeAsserted(gridView);
|
|
|
|
return gridView->isTimeStepDependentDataVisible();
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
QList<caf::PdmOptionItemInfo> Rim2dIntersectionView::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
bool* useOptionsOnly)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
QList<caf::PdmOptionItemInfo> options;
|
2018-01-25 10:37:22 -06:00
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool Rim2dIntersectionView::hasResults()
|
|
|
|
{
|
|
|
|
if (!m_intersection()) return false;
|
|
|
|
|
|
|
|
RimEclipseView * eclView = nullptr;
|
|
|
|
m_intersection->firstAncestorOrThisOfType(eclView);
|
|
|
|
if (eclView)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-25 10:37:22 -06:00
|
|
|
return (eclView->cellResult()->hasResult() || eclView->cellResult()->isTernarySaturationSelected());
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
RimGeoMechView * geoView = nullptr;
|
|
|
|
m_intersection->firstAncestorOrThisOfType(geoView);
|
|
|
|
if (geoView)
|
|
|
|
{
|
|
|
|
return geoView->cellResult()->hasResult();
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
int Rim2dIntersectionView::timeStepCount()
|
|
|
|
{
|
|
|
|
if ( isTimeStepDependentDataVisible() )
|
|
|
|
{
|
2018-01-29 09:14:11 -06:00
|
|
|
return static_cast<int>( this->ownerCase()->timeStepStrings().size());
|
2018-01-25 10:37:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
2018-01-23 07:23:28 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool Rim2dIntersectionView::isWindowVisible()
|
|
|
|
{
|
|
|
|
if (m_showWindow())
|
|
|
|
{
|
|
|
|
Rim2dIntersectionViewCollection* viewColl = nullptr;
|
|
|
|
this->firstAncestorOrThisOfTypeAsserted(viewColl);
|
|
|
|
return viewColl->isActive();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::createDisplayModel()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
if (m_viewer.isNull()) return;
|
|
|
|
if (!m_intersection()) return;
|
2018-01-25 10:37:22 -06:00
|
|
|
|
|
|
|
updateScaleTransform();
|
|
|
|
|
|
|
|
m_viewer->removeAllFrames();
|
|
|
|
|
|
|
|
int tsCount = this->timeStepCount();
|
|
|
|
|
|
|
|
for (int i = 0; i < tsCount; ++i)
|
|
|
|
{
|
|
|
|
m_viewer->addFrame(new cvf::Scene());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( m_flatIntersectionPartMgr.isNull() || m_intersection() != m_flatIntersectionPartMgr->intersection())
|
|
|
|
{
|
|
|
|
m_flatIntersectionPartMgr = new RivIntersectionPartMgr(m_intersection(), true);
|
|
|
|
}
|
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
m_intersectionVizModel->removeAllParts();
|
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
m_flatIntersectionPartMgr->appendNativeCrossSectionFacesToModel(m_intersectionVizModel.p(), scaleTransform());
|
|
|
|
m_flatIntersectionPartMgr->appendMeshLinePartsToModel(m_intersectionVizModel.p(), scaleTransform());
|
2018-02-05 09:13:07 -06:00
|
|
|
m_flatIntersectionPartMgr->appendPolylinePartsToModel(m_intersectionVizModel.p(), scaleTransform());
|
2018-02-07 04:40:48 -06:00
|
|
|
m_flatIntersectionPartMgr->appendWellPipePartsToModel(m_intersectionVizModel.p(), scaleTransform());
|
2018-01-25 10:37:22 -06:00
|
|
|
|
|
|
|
m_flatIntersectionPartMgr->applySingleColorEffect();
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
m_viewer->addStaticModelOnce(m_intersectionVizModel.p());
|
2018-01-26 01:41:44 -06:00
|
|
|
|
|
|
|
m_intersectionVizModel->updateBoundingBoxesRecursive();
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
if ( this->hasUserRequestedAnimation() )
|
|
|
|
{
|
|
|
|
m_viewer->setCurrentFrame(m_currentTimeStep);
|
2018-01-29 04:24:53 -06:00
|
|
|
updateCurrentTimeStep();
|
2018-01-25 10:37:22 -06:00
|
|
|
}
|
2018-01-26 01:41:44 -06:00
|
|
|
|
|
|
|
if ( this->viewer()->mainCamera()->viewMatrix() == defaultIntersectinoViewMatrix )
|
|
|
|
{
|
|
|
|
this->zoomAll();
|
|
|
|
}
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::createPartCollectionFromSelection(cvf::Collection<cvf::Part>* parts)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
|
|
|
}
|
2018-02-01 10:45:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim2dIntersectionView::onTimeStepChanged()
|
|
|
|
{
|
|
|
|
}
|
2018-01-15 07:52:22 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::clampCurrentTimestep()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::updateCurrentTimeStep()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-02-01 10:45:22 -06:00
|
|
|
updateLegends();
|
|
|
|
|
2018-01-25 10:37:22 -06:00
|
|
|
if ((this->hasUserRequestedAnimation() && this->hasResults()))
|
|
|
|
{
|
2018-02-01 10:45:22 -06:00
|
|
|
m_flatIntersectionPartMgr->updateCellResultColor(m_currentTimeStep,
|
|
|
|
m_legendConfig->scalarMapper(),
|
|
|
|
m_ternaryLegendConfig()->scalarMapper());
|
2018-01-25 10:37:22 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_flatIntersectionPartMgr->applySingleColorEffect();
|
|
|
|
}
|
2018-02-01 10:45:22 -06:00
|
|
|
|
|
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim2dIntersectionView::updateLegends()
|
|
|
|
{
|
|
|
|
if (m_viewer)
|
|
|
|
{
|
|
|
|
m_viewer->removeAllColorLegends();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!hasResults()) return ;
|
|
|
|
|
|
|
|
cvf::OverlayItem* legend = nullptr;
|
|
|
|
|
|
|
|
RimEclipseView * eclView = nullptr;
|
|
|
|
m_intersection->firstAncestorOrThisOfType(eclView);
|
|
|
|
if (eclView)
|
|
|
|
{
|
|
|
|
m_legendConfig()->setUiValuesFromLegendConfig(eclView->cellResult()->legendConfig());
|
|
|
|
m_ternaryLegendConfig()->setUiValuesFromLegendConfig(eclView->cellResult()->ternaryLegendConfig());
|
|
|
|
eclView->cellResult()->updateLegendData(m_currentTimeStep(), m_legendConfig(), m_ternaryLegendConfig());
|
|
|
|
|
|
|
|
if ( eclView->cellResult()->isTernarySaturationSelected() )
|
|
|
|
{
|
|
|
|
m_ternaryLegendConfig()->setTitle("Cell Result:");
|
|
|
|
legend = m_ternaryLegendConfig()->legend();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_legendConfig()->setTitle("Cell Result:" + eclView->cellResult()->resultVariableUiShortName());
|
|
|
|
legend = m_legendConfig()->legend();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RimGeoMechView * geoView = nullptr;
|
|
|
|
m_intersection->firstAncestorOrThisOfType(geoView);
|
|
|
|
if (geoView)
|
|
|
|
{
|
|
|
|
m_legendConfig()->setUiValuesFromLegendConfig(geoView->cellResult()->legendConfig());
|
|
|
|
|
|
|
|
geoView->updateLegendTextAndRanges(m_legendConfig(), m_currentTimeStep());
|
|
|
|
legend = m_legendConfig()->legend();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( legend )
|
|
|
|
{
|
|
|
|
m_viewer->addColorLegendToBottomLeftCorner(legend);
|
|
|
|
}
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-02-01 10:45:22 -06:00
|
|
|
void Rim2dIntersectionView::resetLegendsInViewer()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-02-01 10:45:22 -06:00
|
|
|
m_viewer->showAxisCross(false);
|
|
|
|
m_viewer->showAnimationProgress(true);
|
|
|
|
m_viewer->showHistogram(false);
|
|
|
|
m_viewer->showInfoText(false);
|
2018-02-08 12:42:34 -06:00
|
|
|
m_viewer->showEdgeTickMarks(false);
|
2018-02-01 10:45:22 -06:00
|
|
|
|
|
|
|
m_viewer->setMainScene(new cvf::Scene());
|
|
|
|
m_viewer->enableNavigationRotation(false);
|
|
|
|
|
|
|
|
m_ternaryLegendConfig()->recreateLegend();
|
|
|
|
m_legendConfig()->recreateLegend();
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
2018-02-01 10:45:22 -06:00
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::updateStaticCellColors()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::updateScaleTransform()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
|
|
|
|
scale(2, 2) = scaleZ();
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
this->scaleTransform()->setLocalTransform(scale);
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
if (m_viewer) m_viewer->updateCachedValuesInScene();
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
cvf::Transform* Rim2dIntersectionView::scaleTransform()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
return m_scaleTransform.p();
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::onLoadDataAndUpdate()
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
updateMdiWindowVisibility();
|
2018-01-15 07:52:22 -06:00
|
|
|
|
|
|
|
this->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
Rim3dView::fieldChangedByUi(changedField, oldValue, newValue);
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
if (changedField == & m_intersection)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
this->loadDataAndUpdate();
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-17 01:00:36 -06:00
|
|
|
void Rim2dIntersectionView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
2018-01-17 01:00:36 -06:00
|
|
|
uiOrdering.add(&m_intersection);
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2018-01-17 01:00:36 -06:00
|
|
|
Rim3dView::defineUiOrdering(uiConfigName, uiOrdering);
|
2018-01-15 07:52:22 -06:00
|
|
|
}
|