//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimGeoMechView::scheduleGeometryRegen(RivCellSetEnum geometryType) { m_vizLogic->scheduleGeometryRegen(geometryType); if (this->isMasterView()) { RimViewLinker* viewLinker = this->assosiatedViewLinker(); if (viewLinker) { viewLinker->scheduleGeometryRegenForDepViews(geometryType); } } m_currentReservoirCellVisibility = NULL; }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RicDeleteAllLinkedViewsFeature::onActionTriggered(bool isChecked) { RimProject* proj = RiaApplication::instance()->project(); RimViewLinker* viewLinker = proj->viewLinkerCollection()->viewLinker(); if (viewLinker) { // Remove the view linker object from the view linker collection // viewLinkerCollection->viewLinker is a PdmChildField containing one RimViewLinker child object proj->viewLinkerCollection->viewLinker.removeChildObject(viewLinker); viewLinker->applyRangeFilterCollectionByUserChoice(); delete viewLinker; proj->uiCapability()->updateConnectedEditors(); } }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RicSetMasterViewFeature::isCommandEnabled() { RimView* activeView = RiaApplication::instance()->activeReservoirView(); if (!activeView) return false; RimProject* proj = RiaApplication::instance()->project(); RimViewLinker* viewLinker = activeView->assosiatedViewLinker(); if (viewLinker && viewLinker->masterView() == activeView) { return false; } if (!proj->viewLinkerCollection()->viewLinker()) { return false; } return true; }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews(RimCellRangeFilter* changedRangeFilter) { RimView* view = NULL; firstAncestorOrThisOfType(view); if (view->isMasterView()) { RimViewLinker* viewLinker = view->assosiatedViewLinker(); if (viewLinker) { // Update data for range filter // Update of display model is handled by view->scheduleGeometryRegen, also for managed views viewLinker->updateRangeFilters(changedRangeFilter); } } view->scheduleGeometryRegen(RANGE_FILTERED); view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE); view->scheduleCreateDisplayModelAndRedraw(); }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RicSetMasterViewFeature::onActionTriggered(bool isChecked) { RimView* activeView = RiaApplication::instance()->activeReservoirView(); if (!activeView) return; RimProject* proj = RiaApplication::instance()->project(); RimViewLinker* viewLinker = proj->viewLinkerCollection()->viewLinker(); viewLinker->applyRangeFilterCollectionByUserChoice(); RimView* previousMasterView = viewLinker->masterView(); viewLinker->setMasterView(activeView); viewLinker->updateDependentViews(); viewLinker->addDependentView(previousMasterView); proj->viewLinkerCollection.uiCapability()->updateConnectedEditors(); proj->updateConnectedEditors(); // Set managed view collection to selected and expanded in project tree caf::PdmUiTreeView* projTreeView = RiuMainWindow::instance()->projectTreeView(); projTreeView->selectAsCurrentItem(viewLinker); projTreeView->setExpanded(viewLinker, true); }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { if(&m_resultPositionTypeUiField == changedField) { std::map<std::string, std::vector<std::string> > fieldCompNames = getResultMetaDataForUIFieldSetting(); QStringList uiVarNames; QStringList varNames; getUiAndResultVariableStringList(&uiVarNames, &varNames, fieldCompNames); if (m_resultPositionTypeUiField() == m_resultPositionType() && varNames.contains(composeFieldCompString(m_resultFieldName(), m_resultComponentName()))) { m_resultVariableUiField = composeFieldCompString(m_resultFieldName(), m_resultComponentName()); } else { m_resultVariableUiField = ""; } } // Get the possible property filter owner RimGeoMechPropertyFilter* propFilter = dynamic_cast<RimGeoMechPropertyFilter*>(this->parentField()->ownerObject()); RimView* view = NULL; this->firstAnchestorOrThisOfType(view); RimWellLogCurve* curve = NULL; this->firstAnchestorOrThisOfType(curve); if (&m_resultVariableUiField == changedField) { QStringList fieldComponentNames = m_resultVariableUiField().split(QRegExp("\\s+")); if (fieldComponentNames.size() > 0) { m_resultPositionType = m_resultPositionTypeUiField; m_resultFieldName = fieldComponentNames[0]; if (fieldComponentNames.size() > 1) { m_resultComponentName = fieldComponentNames[1]; } else { m_resultComponentName = ""; } if (m_geomCase->geoMechData()->femPartResults()->assertResultsLoaded(this->resultAddress())) { if (view) view->hasUserRequestedAnimation = true; } if (propFilter) { propFilter->setToDefaultValues(); if (view) view->scheduleGeometryRegen(PROPERTY_FILTERED); } if (view) view->scheduleCreateDisplayModelAndRedraw(); if (dynamic_cast<RimGeoMechCellColors*>(this)) { if (view) { RimViewLinker* viewLinker = view->assosiatedViewLinker(); if (viewLinker) { viewLinker->updateCellResult(); } } } if (curve) { curve->updatePlotData(); } } } if (propFilter) { propFilter->updateConnectedEditors(); } if (curve) { curve->updateConnectedEditors(); } }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { if ( &m_resultTypeUiField == changedField || &m_porosityModelUiField == changedField ) { QStringList varList = getResultVariableListForCurrentUIFieldSettings(); // If the user are seeing the list with the actually selected result, select that result in the list. Otherwise select nothing. if ( m_resultTypeUiField() == m_resultType() && m_porosityModelUiField() == m_porosityModel() && varList.contains(resultVariable())) { m_resultVariableUiField = resultVariable(); } else { m_resultVariableUiField = ""; } } RimEclipsePropertyFilter* propFilter = dynamic_cast<RimEclipsePropertyFilter*>(this->parentField()->ownerObject()); RimView* view = NULL; this->firstAnchestorOrThisOfType(view); RimWellLogCurve* curve = NULL; this->firstAnchestorOrThisOfType(curve); if (&m_resultVariableUiField == changedField) { m_porosityModel = m_porosityModelUiField; m_resultType = m_resultTypeUiField; m_resultVariable = m_resultVariableUiField; loadResult(); if (propFilter) { propFilter->setToDefaultValues(); propFilter->updateFilterName(); if (view) { view->scheduleGeometryRegen(PROPERTY_FILTERED); view->scheduleCreateDisplayModelAndRedraw(); } } if (dynamic_cast<RimEclipseCellColors*>(this)) { if (view) { RimViewLinker* viewLinker = view->assosiatedViewLinker(); if (viewLinker) { viewLinker->updateCellResult(); } } } if (curve) { curve->updatePlotData(); } } if (propFilter) { propFilter->updateConnectedEditors(); } RimEclipseFaultColors* faultColors = dynamic_cast<RimEclipseFaultColors*>(this->parentField()->ownerObject()); if (faultColors) { faultColors->updateConnectedEditors(); } if (curve) { curve->updateConnectedEditors(); } }