#2485 Intersection. Field controlling polylines visibility

This commit is contained in:
Bjørn Erik Jensen 2018-03-12 09:21:27 +01:00
parent 716bb3184b
commit e13702a88a
10 changed files with 44 additions and 12 deletions

View File

@ -915,9 +915,11 @@ void RivIntersectionPartMgr::appendMeshLinePartsToModel(cvf::ModelBasicList* mod
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionPartMgr::appendPolylinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
void RivIntersectionPartMgr::appendPolylinePartsToModel(Rim3dView &view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
{
if (m_rimCrossSection->inputPolyLineFromViewerEnabled)
Rim2dIntersectionView* curr2dView = dynamic_cast<Rim2dIntersectionView*>(&view);
if (m_rimCrossSection->inputPolyLineFromViewerEnabled || (curr2dView && curr2dView->showDefiningPoints()))
{
if (m_highlightLineAlongPolyline.notNull())
{
@ -947,7 +949,7 @@ void RivIntersectionPartMgr::appendPolylinePartsToModel(cvf::ModelBasicList* mod
}
}
if (m_rimCrossSection->inputTwoAzimuthPointsFromViewerEnabled)
if (m_rimCrossSection->inputTwoAzimuthPointsFromViewerEnabled || (curr2dView && curr2dView->showDefiningPoints()))
{
if (m_highlightLineAlongPolyline.notNull())
{

View File

@ -44,6 +44,7 @@ class RigFemResultAddress;
class RigGeoMechCaseData;
class RigMainGrid;
class RigResultAccessor;
class Rim3dView;
class RimCellEdgeColors;
class RimEclipseCellColors;
class RimIntersection;
@ -71,7 +72,7 @@ public:
void appendNativeCrossSectionFacesToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
void appendMeshLinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
void appendPolylinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
void appendPolylinePartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
void appendWellPipePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
const RimIntersection* intersection() const;

View File

@ -72,6 +72,8 @@ Rim2dIntersectionView::Rim2dIntersectionView(void)
m_ternaryLegendConfig.xmlCapability()->disableIO();
m_ternaryLegendConfig = new RimTernaryLegendConfig();
CAF_PDM_InitField(&m_showDefiningPoints, "ShowDefiningPoints", true, "Show Points", "", "", "");
m_showWindow = false;
m_scaleTransform = new cvf::Transform();
m_intersectionVizModel = new cvf::ModelBasicList;
@ -298,6 +300,14 @@ cvf::ref<caf::DisplayCoordTransform> Rim2dIntersectionView::displayCoordTransfor
return dispTx;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Rim2dIntersectionView::showDefiningPoints() const
{
return m_showDefiningPoints;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -396,7 +406,7 @@ void Rim2dIntersectionView::createDisplayModel()
m_flatIntersectionPartMgr->appendNativeCrossSectionFacesToModel(m_intersectionVizModel.p(), scaleTransform());
m_flatIntersectionPartMgr->appendMeshLinePartsToModel(m_intersectionVizModel.p(), scaleTransform());
m_flatIntersectionPartMgr->appendPolylinePartsToModel(m_intersectionVizModel.p(), scaleTransform());
m_flatIntersectionPartMgr->appendPolylinePartsToModel(*this, m_intersectionVizModel.p(), scaleTransform());
m_flatIntersectionPartMgr->appendWellPipePartsToModel(m_intersectionVizModel.p(), scaleTransform());
m_flatIntersectionPartMgr->applySingleColorEffect();
@ -572,7 +582,8 @@ void Rim2dIntersectionView::fieldChangedByUi(const caf::PdmFieldHandle* changedF
{
Rim3dView::fieldChangedByUi(changedField, oldValue, newValue);
if (changedField == & m_intersection)
if (changedField == & m_intersection ||
changedField == &m_showDefiningPoints)
{
this->loadDataAndUpdate();
}
@ -587,4 +598,10 @@ void Rim2dIntersectionView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd
uiOrdering.add(&m_intersection);
Rim3dView::defineUiOrdering(uiConfigName, uiOrdering);
if (m_intersection->hasDefiningPoints())
{
caf::PdmUiGroup* plGroup = uiOrdering.addNewGroup("Defining Points");
plGroup->add(&m_showDefiningPoints);
}
}

View File

@ -63,6 +63,8 @@ public:
virtual cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const override;
bool showDefiningPoints() const;
protected:
void updateLegends();
@ -96,5 +98,5 @@ protected:
cvf::ref<cvf::ModelBasicList> m_intersectionVizModel;
cvf::ref<cvf::Transform> m_scaleTransform;
caf::PdmField<bool> m_showDefiningPoints;
};

View File

@ -477,7 +477,7 @@ void RimEclipseView::createDisplayModel()
// Cross sections
m_crossSectionVizModel->removeAllParts();
m_crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), m_reservoirGridPartManager->scaleTransform());
m_crossSectionCollection->appendPartsToModel(*this, m_crossSectionVizModel.p(), m_reservoirGridPartManager->scaleTransform());
m_viewer->addStaticModelOnce(m_crossSectionVizModel.p());
// Well path model

View File

@ -231,7 +231,7 @@ void RimGeoMechView::createDisplayModel()
// Cross sections
m_crossSectionVizModel->removeAllParts();
m_crossSectionCollection->appendPartsToModel(m_crossSectionVizModel.p(), scaleTransform());
m_crossSectionCollection->appendPartsToModel(*this, m_crossSectionVizModel.p(), scaleTransform());
m_viewer->addStaticModelOnce(m_crossSectionVizModel.p());
// If the animation was active before recreating everything, make viewer view current frame

View File

@ -909,6 +909,14 @@ void RimIntersection::recomputeSimulationWellBranchData()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimIntersection::hasDefiningPoints() const
{
return type == CS_POLYLINE || type == CS_AZIMUTHLINE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -102,6 +102,7 @@ public:
void setLengthDown(double heightDown);
void recomputeSimulationWellBranchData();
bool hasDefiningPoints() const;
protected:
virtual caf::PdmFieldHandle* userDescriptionField();

View File

@ -122,7 +122,7 @@ void RimIntersectionCollection::updateCellResultColor(size_t timeStepIndex,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
void RimIntersectionCollection::appendPartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
{
if (!isActive) return;
@ -132,7 +132,7 @@ void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, c
{
cs->intersectionPartMgr()->appendNativeCrossSectionFacesToModel(model, scaleTransform);
cs->intersectionPartMgr()->appendMeshLinePartsToModel(model, scaleTransform);
cs->intersectionPartMgr()->appendPolylinePartsToModel(model, scaleTransform);
cs->intersectionPartMgr()->appendPolylinePartsToModel(view, model, scaleTransform);
}
}

View File

@ -23,6 +23,7 @@
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
class Rim3dView;
class RimIntersection;
class RimIntersectionBox;
class RimEclipseCellColors;
@ -70,7 +71,7 @@ public:
void updateCellResultColor(size_t timeStepIndex,
const cvf::ScalarMapper* scalarColorMapper,
const RivTernaryScalarMapper* ternaryColorMapper);
void appendPartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
void appendPartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
std::vector<RimIntersection*> intersections() const;
std::vector<RimIntersectionBox*> intersectionBoxes() const;