Refactor: rename confusing push_back method on view collections.

This commit is contained in:
Kristian Bendiksen 2024-04-17 13:46:31 +02:00
parent ade044adbf
commit 174123f8b5
7 changed files with 12 additions and 12 deletions

View File

@ -98,7 +98,7 @@ void RicPasteEclipseViewsFeature::onActionTriggered( bool isChecked )
auto contourMapView = dynamic_cast<RimEclipseContourMapView*>( rimReservoirView ); auto contourMapView = dynamic_cast<RimEclipseContourMapView*>( rimReservoirView );
CVF_ASSERT( contourMapView ); CVF_ASSERT( contourMapView );
eclipseCase->contourMapCollection()->push_back( contourMapView ); eclipseCase->contourMapCollection()->addView( contourMapView );
} }
else else
{ {

View File

@ -219,7 +219,7 @@ RimEclipseContourMapView*
size_t i = eclipseCase->contourMapCollection()->views().size(); size_t i = eclipseCase->contourMapCollection()->views().size();
contourMap->setName( QString( "Contour Map %1" ).arg( i + 1 ) ); contourMap->setName( QString( "Contour Map %1" ).arg( i + 1 ) );
eclipseCase->contourMapCollection()->push_back( contourMap ); eclipseCase->contourMapCollection()->addView( contourMap );
// Resolve references after contour map has been inserted into Rim structures // Resolve references after contour map has been inserted into Rim structures
contourMap->resolveReferencesRecursively(); contourMap->resolveReferencesRecursively();
@ -269,7 +269,7 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMapFr
caf::PdmDocument::updateUiIconStateRecursively( contourMap ); caf::PdmDocument::updateUiIconStateRecursively( contourMap );
eclipseCase->contourMapCollection()->push_back( contourMap ); eclipseCase->contourMapCollection()->addView( contourMap );
contourMap->synchronizeLocalAnnotationsFromGlobal(); contourMap->synchronizeLocalAnnotationsFromGlobal();
@ -313,7 +313,7 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMap(
contourMap->faultCollection()->setActive( false ); contourMap->faultCollection()->setActive( false );
contourMap->wellCollection()->isActive = false; contourMap->wellCollection()->isActive = false;
eclipseCase->contourMapCollection()->push_back( contourMap ); eclipseCase->contourMapCollection()->addView( contourMap );
auto col = RiuGuiTheme::getColorByVariableName( "backgroundColor2" ); auto col = RiuGuiTheme::getColorByVariableName( "backgroundColor2" );
contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background
@ -343,7 +343,7 @@ RimGeoMechContourMapView*
size_t i = geoMechCase->contourMapCollection()->views().size(); size_t i = geoMechCase->contourMapCollection()->views().size();
contourMap->setName( QString( "Contour Map %1" ).arg( i + 1 ) ); contourMap->setName( QString( "Contour Map %1" ).arg( i + 1 ) );
geoMechCase->contourMapCollection()->push_back( contourMap ); geoMechCase->contourMapCollection()->addView( contourMap );
// Resolve references after contour map has been inserted into Rim structures // Resolve references after contour map has been inserted into Rim structures
contourMap->resolveReferencesRecursively(); contourMap->resolveReferencesRecursively();
@ -373,7 +373,7 @@ RimGeoMechContourMapView* RicNewContourMapViewFeature::createGeoMechContourMapFr
caf::PdmDocument::updateUiIconStateRecursively( contourMap ); caf::PdmDocument::updateUiIconStateRecursively( contourMap );
geoMechCase->contourMapCollection()->push_back( contourMap ); geoMechCase->contourMapCollection()->addView( contourMap );
// Resolve references after contour map has been inserted into Rim structures // Resolve references after contour map has been inserted into Rim structures
std::vector<caf::PdmFieldHandle*> fieldsWithFailingResolve; std::vector<caf::PdmFieldHandle*> fieldsWithFailingResolve;
@ -395,7 +395,7 @@ RimGeoMechContourMapView* RicNewContourMapViewFeature::createGeoMechContourMap(
size_t i = geoMechCase->contourMapCollection()->views().size(); size_t i = geoMechCase->contourMapCollection()->views().size();
contourMap->setName( QString( "Contour Map %1" ).arg( i + 1 ) ); contourMap->setName( QString( "Contour Map %1" ).arg( i + 1 ) );
geoMechCase->contourMapCollection()->push_back( contourMap ); geoMechCase->contourMapCollection()->addView( contourMap );
auto col = RiuGuiTheme::getColorByVariableName( "backgroundColor2" ); auto col = RiuGuiTheme::getColorByVariableName( "backgroundColor2" );
contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background

View File

@ -33,7 +33,7 @@ std::vector<RimGeoMechContourMapView*> RimGeoMechContourMapViewCollection::views
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimGeoMechContourMapViewCollection::push_back( RimGeoMechContourMapView* contourMap ) void RimGeoMechContourMapViewCollection::addView( RimGeoMechContourMapView* contourMap )
{ {
m_contourMapViews.push_back( contourMap ); m_contourMapViews.push_back( contourMap );
} }

View File

@ -33,7 +33,7 @@ public:
~RimGeoMechContourMapViewCollection() override; ~RimGeoMechContourMapViewCollection() override;
std::vector<RimGeoMechContourMapView*> views(); std::vector<RimGeoMechContourMapView*> views();
void push_back( RimGeoMechContourMapView* contourMap ); void addView( RimGeoMechContourMapView* contourMap );
private: private:
caf::PdmChildArrayField<RimGeoMechContourMapView*> m_contourMapViews; caf::PdmChildArrayField<RimGeoMechContourMapView*> m_contourMapViews;

View File

@ -299,7 +299,7 @@ void RimEclipseCase::initAfterRead()
{ {
contourMap->setEclipseCase( this ); contourMap->setEclipseCase( this );
m_contourMapCollection_OBSOLETE->removeChild( contourMap ); m_contourMapCollection_OBSOLETE->removeChild( contourMap );
mapViewColl->push_back( contourMap ); mapViewColl->addView( contourMap );
} }
m_contourMapCollection_OBSOLETE->clearWithoutDelete(); m_contourMapCollection_OBSOLETE->clearWithoutDelete();

View File

@ -33,7 +33,7 @@ std::vector<RimEclipseContourMapView*> RimEclipseContourMapViewCollection::views
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimEclipseContourMapViewCollection::push_back( RimEclipseContourMapView* contourMap ) void RimEclipseContourMapViewCollection::addView( RimEclipseContourMapView* contourMap )
{ {
m_contourMapViews.push_back( contourMap ); m_contourMapViews.push_back( contourMap );
} }

View File

@ -33,7 +33,7 @@ public:
~RimEclipseContourMapViewCollection() override; ~RimEclipseContourMapViewCollection() override;
std::vector<RimEclipseContourMapView*> views(); std::vector<RimEclipseContourMapView*> views();
void push_back( RimEclipseContourMapView* contourMap ); void addView( RimEclipseContourMapView* contourMap );
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects ) override; void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects ) override;