//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RicIntersectionBoxZSliceFeature::onActionTriggered(bool isChecked) { RimView* activeView = RiaApplication::instance()->activeReservoirView(); if (activeView) { RimIntersectionCollection* coll = activeView->crossSectionCollection(); CVF_ASSERT(coll); RimIntersectionBox* intersectionBox = new RimIntersectionBox(); intersectionBox->name = QString("Z-slice (Intersection box)"); coll->appendIntersectionBox(intersectionBox); cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords(); intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Z, domainCoord); coll->updateConnectedEditors(); RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox); RimView* rimView = NULL; coll->firstAncestorOrThisOfType(rimView); if (rimView) { rimView->showGridCells(false); RiuMainWindow::instance()->refreshDrawStyleActions(); rimView->scheduleCreateDisplayModelAndRedraw(); } } }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimGridCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { if (changedField == &isActive) { RimView* rimView = NULL; this->firstAnchestorOrThisOfType(rimView); CVF_ASSERT(rimView); rimView->showGridCells(isActive); updateUiIconFromState(isActive); } }