diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp index 6f240312bc..4391a2a9b2 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp @@ -99,7 +99,7 @@ void RicAppendIntersectionFeatureCmd::redo() CVF_ASSERT( m_intersectionCollection ); RimIntersection* intersection = new RimIntersection(); - intersection->name = QString( "Intersection" ); + intersection->setName( "Intersection" ); m_intersectionCollection->appendIntersectionAndUpdate( intersection ); RimGridView* view = nullptr; diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp index 1e4907906c..4bacece25b 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp @@ -105,8 +105,8 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo() { CVF_ASSERT( m_intersectionCollection ); - RimIntersection* intersection = new RimIntersection(); - intersection->name = "Azimuth and Dip"; + RimIntersection* intersection = new RimIntersection(); + intersection->setName( "Azimuth and Dip" ); intersection->type = RimIntersection::CS_AZIMUTHLINE; intersection->inputTwoAzimuthPointsFromViewerEnabled = true; diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp index 043d4b3f7d..7682be9c44 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp @@ -103,8 +103,8 @@ void RicNewPolylineIntersectionFeatureCmd::redo() { CVF_ASSERT( m_intersectionCollection ); - RimIntersection* intersection = new RimIntersection(); - intersection->name = "Polyline"; + RimIntersection* intersection = new RimIntersection(); + intersection->setName( "Polyline" ); intersection->type = RimIntersection::CS_POLYLINE; intersection->inputPolyLineFromViewerEnabled = true; diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp index 813e341b1e..92fda7cef7 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp @@ -102,9 +102,9 @@ void RicNewSimWellIntersectionCmd::redo() CVF_ASSERT( m_simWell ); RimIntersection* intersection = new RimIntersection(); - intersection->name = m_simWell->name; - intersection->type = RimIntersection::CS_SIMULATION_WELL; - intersection->simulationWell = m_simWell; + intersection->setName( m_simWell->name ); + intersection->type = RimIntersection::CS_SIMULATION_WELL; + intersection->simulationWell = m_simWell; m_intersectionCollection->appendIntersectionAndUpdate( intersection, false ); } diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp index 286e57dbdd..d81b0f79c3 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp @@ -109,9 +109,9 @@ void RicNewWellPathIntersectionFeatureCmd::redo() CVF_ASSERT( m_wellPath ); RimIntersection* intersection = new RimIntersection(); - intersection->name = m_wellPath->name(); - intersection->type = RimIntersection::CS_WELL_PATH; - intersection->wellPath = m_wellPath; + intersection->setName( m_wellPath->name() ); + intersection->type = RimIntersection::CS_WELL_PATH; + intersection->wellPath = m_wellPath; m_intersectionCollection->appendIntersectionAndUpdate( intersection, false ); } diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteIntersectionsFeature.cpp b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteIntersectionsFeature.cpp index 6671dd9cfd..8651588012 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteIntersectionsFeature.cpp +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteIntersectionsFeature.cpp @@ -89,8 +89,8 @@ void RicPasteIntersectionsFeature::onActionTriggered( bool isChecked ) RimIntersection* intersection = dynamic_cast( intersectionObjects[i]->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); - QString nameOfCopy = QString( "Copy of " ) + intersection->name; - intersection->name = nameOfCopy; + QString nameOfCopy = QString( "Copy of " ) + intersection->name(); + intersection->setName( nameOfCopy ); if ( i == intersectionObjects.size() - 1 ) { diff --git a/ApplicationCode/Commands/RicHideIntersectionFeature.cpp b/ApplicationCode/Commands/RicHideIntersectionFeature.cpp index 448b5e71db..77aa94c2de 100644 --- a/ApplicationCode/Commands/RicHideIntersectionFeature.cpp +++ b/ApplicationCode/Commands/RicHideIntersectionFeature.cpp @@ -68,7 +68,7 @@ void RicHideIntersectionFeature::onActionTriggered( bool isChecked ) RimIntersection* intersection = dynamic_cast( generalSelectionItem->m_object ); if ( intersection ) { - intersection->isActive = false; + intersection->setActive( false ); intersection->updateConnectedEditors(); activeView->scheduleCreateDisplayModelAndRedraw(); diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp index 1c18e0653b..6c28d55e43 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp @@ -1011,7 +1011,7 @@ cvf::ref RivIntersectionPartMgr::createHexGridI RigMainGrid* grid = eclipseView->mainGrid(); return new RivEclipseIntersectionGrid( grid, eclipseView->currentActiveCellInfo(), - m_rimCrossSection->showInactiveCells() ); + m_rimCrossSection->isInactiveCellsVisible() ); } RimGeoMechView* geoView; diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.cpp b/ApplicationCode/ProjectDataModel/RimIntersection.cpp index a2e7155d30..72f489dbda 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersection.cpp @@ -146,14 +146,14 @@ void RimIntersection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) { - if ( changedField == &isActive || changedField == &type || changedField == &direction || changedField == &wellPath || + if ( changedField == &m_isActive || changedField == &type || changedField == &direction || changedField == &wellPath || changedField == &simulationWell || changedField == &m_branchIndex || changedField == &m_extentLength || - changedField == &m_lengthUp || changedField == &m_lengthDown || changedField == &showInactiveCells ) + changedField == &m_lengthUp || changedField == &m_lengthDown || changedField == &m_showInactiveCells ) { rebuildGeometryAndScheduleCreateDisplayModel(); } - if ( changedField == &simulationWell || changedField == &isActive || changedField == &type ) + if ( changedField == &simulationWell || changedField == &m_isActive || changedField == &type ) { recomputeSimulationWellBranchData(); } @@ -163,7 +163,7 @@ void RimIntersection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, updateName(); } - if ( changedField == &name ) + if ( changedField == &m_name ) { Rim2dIntersectionView* iView = correspondingIntersectionView(); if ( iView ) @@ -223,7 +223,7 @@ void RimIntersection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, //-------------------------------------------------------------------------------------------------- void RimIntersection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { - uiOrdering.add( &name ); + uiOrdering.add( &m_name ); caf::PdmUiGroup* geometryGroup = uiOrdering.addNewGroup( "Intersecting Geometry" ); geometryGroup->add( &type ); @@ -272,7 +272,7 @@ void RimIntersection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering optionsGroup->add( &inputExtrusionPointsFromViewerEnabled ); } - optionsGroup->add( &showInactiveCells ); + optionsGroup->add( &m_showInactiveCells ); if ( type == CS_POLYLINE ) { @@ -283,7 +283,7 @@ void RimIntersection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering m_extentLength.uiCapability()->setUiReadOnly( false ); } - this->defineSeparateDataSourceUi(uiConfigName, uiOrdering); + this->defineSeparateDataSourceUi( uiConfigName, uiOrdering ); updateWellExtentDefaultValue(); @@ -339,9 +339,9 @@ QList RimIntersection::calculateValueOptions( const caf: options.push_back( caf::PdmOptionItemInfo( QString::number( bIdx + 1 ), QVariant::fromValue( bIdx ) ) ); } } - else + else { - options = RimIntersectionHandle::calculateValueOptions(fieldNeedingOptions, useOptionsOnly); + options = RimIntersectionHandle::calculateValueOptions( fieldNeedingOptions, useOptionsOnly ); } return options; @@ -509,7 +509,7 @@ std::vector RimIntersection::polyLinesForExtrusionDirection() const //-------------------------------------------------------------------------------------------------- void RimIntersection::updateSimulationWellCenterline() const { - if ( isActive() && type == CS_SIMULATION_WELL && simulationWell() ) + if ( m_isActive() && type == CS_SIMULATION_WELL && simulationWell() ) { if ( m_simulationWellBranchCenterlines.empty() ) { @@ -607,15 +607,15 @@ void RimIntersection::updateName() { if ( type == CS_SIMULATION_WELL && simulationWell() ) { - name = simulationWell()->name(); + m_name = simulationWell()->name(); if ( branchIndex() != -1 ) { - name = name() + " Branch " + QString::number( branchIndex() + 1 ); + m_name = m_name() + " Branch " + QString::number( branchIndex() + 1 ); } } else if ( type() == CS_WELL_PATH && wellPath() ) { - name = wellPath()->name(); + m_name = wellPath()->name(); } Rim2dIntersectionView* iView = correspondingIntersectionView(); @@ -939,10 +939,10 @@ CAF_PDM_SOURCE_INIT( RimIntersectionHandle, "RimIntersectionHandle" ); //-------------------------------------------------------------------------------------------------- RimIntersectionHandle::RimIntersectionHandle() { - CAF_PDM_InitField( &name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" ); - CAF_PDM_InitField( &isActive, "Active", true, "Active", "", "", "" ); - isActive.uiCapability()->setUiHidden( true ); - CAF_PDM_InitField( &showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", "" ); + CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" ); + CAF_PDM_InitField( &m_isActive, "Active", true, "Active", "", "", "" ); + m_isActive.uiCapability()->setUiHidden( true ); + CAF_PDM_InitField( &m_showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_separateDataSource, "SeparateIntersectionDataSource", "Source", "", "", "" ); } @@ -951,6 +951,46 @@ RimIntersectionHandle::RimIntersectionHandle() //-------------------------------------------------------------------------------------------------- RimIntersectionHandle::~RimIntersectionHandle() {} +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimIntersectionHandle::name() const +{ + return m_name(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimIntersectionHandle::setName( const QString& newName ) +{ + m_name = newName; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimIntersectionHandle::isActive() const +{ + return m_isActive(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimIntersectionHandle::setActive( bool isActive ) +{ + m_isActive = isActive; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimIntersectionHandle::isInactiveCellsVisible() const +{ + return m_showInactiveCells; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1002,7 +1042,7 @@ QList //-------------------------------------------------------------------------------------------------- caf::PdmFieldHandle* RimIntersectionHandle::userDescriptionField() { - return &name; + return &m_name; } //-------------------------------------------------------------------------------------------------- @@ -1010,7 +1050,7 @@ caf::PdmFieldHandle* RimIntersectionHandle::userDescriptionField() //-------------------------------------------------------------------------------------------------- caf::PdmFieldHandle* RimIntersectionHandle::objectToggleField() { - return &isActive; + return &m_isActive; } //-------------------------------------------------------------------------------------------------- /// @@ -1023,7 +1063,7 @@ void RimIntersectionHandle::initAfterRead() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimIntersectionHandle::defineSeparateDataSourceUi( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +void RimIntersectionHandle::defineSeparateDataSourceUi( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { QString inactiveText; if ( !this->activeSeparateResultDefinition() ) diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.h b/ApplicationCode/ProjectDataModel/RimIntersection.h index 15715ebf92..027d27df3c 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.h +++ b/ApplicationCode/ProjectDataModel/RimIntersection.h @@ -49,9 +49,13 @@ public: RimIntersectionHandle(); ~RimIntersectionHandle() override; - caf::PdmField name; - caf::PdmField isActive; - caf::PdmField showInactiveCells; + QString name() const; + void setName( const QString& newName ); + + bool isActive() const; + void setActive( bool isActive ); + + bool isInactiveCellsVisible() const; RimIntersectionResultDefinition* activeSeparateResultDefinition(); @@ -65,6 +69,10 @@ protected: void defineSeparateDataSourceUi( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); void updateDefaultSeparateDataSource(); + caf::PdmField m_name; + caf::PdmField m_isActive; + caf::PdmField m_showInactiveCells; + caf::PdmPtrField m_separateDataSource; }; diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp index c72bbfcdb9..96029e0ce3 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp @@ -79,7 +79,7 @@ void RimIntersectionCollection::applySingleColorEffect() for ( RimIntersection* cs : m_intersections ) { - if ( cs->isActive ) + if ( cs->isActive() ) { cs->intersectionPartMgr()->applySingleColorEffect(); } @@ -105,7 +105,7 @@ void RimIntersectionCollection::updateCellResultColor( size_t for ( RimIntersection* cs : m_intersections ) { - if ( cs->isActive ) + if ( cs->isActive() ) { cs->intersectionPartMgr()->updateCellResultColor( timeStepIndex, scalarColorMapper, ternaryColorMapper ); } @@ -127,11 +127,11 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform ) { - if ( !isActive ) return; + if ( !isActive() ) return; for ( RimIntersection* cs : m_intersections ) { - if ( cs->isActive ) + if ( cs->isActive() ) { cs->intersectionPartMgr()->appendNativeCrossSectionFacesToModel( model, scaleTransform ); cs->intersectionPartMgr()->appendMeshLinePartsToModel( model, scaleTransform ); @@ -141,7 +141,7 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view, for ( RimIntersectionBox* cs : m_intersectionBoxes ) { - if ( cs->isActive ) + if ( cs->isActive() ) { cs->intersectionBoxPartMgr()->appendNativeCrossSectionFacesToModel( model, scaleTransform ); cs->intersectionBoxPartMgr()->appendMeshLinePartsToModel( model, scaleTransform ); @@ -302,11 +302,11 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha //-------------------------------------------------------------------------------------------------- bool RimIntersectionCollection::hasActiveIntersectionForSimulationWell( const RimSimWellInView* simWell ) const { - if ( !isActive ) return false; + if ( !isActive() ) return false; for ( RimIntersection* cs : m_intersections ) { - if ( cs->isActive && cs->type() == RimIntersection::CS_SIMULATION_WELL && cs->simulationWell() == simWell ) + if ( cs->isActive() && cs->type() == RimIntersection::CS_SIMULATION_WELL && cs->simulationWell() == simWell ) { return true; }