Refactor delete operations for pdm objects.

This commit is contained in:
Kristian Bendiksen
2020-05-18 16:02:27 +02:00
committed by Magne Sjaastad
parent 80ee1256e7
commit c366e85682
90 changed files with 474 additions and 438 deletions

View File

@@ -41,6 +41,8 @@ RimSurface::RimSurface()
CAF_PDM_InitField( &m_color, "SurfaceColor", cvf::Color3f( 0.5f, 0.3f, 0.2f ), "Color", "", "", "" );
CAF_PDM_InitField( &m_depthOffset, "DepthOffset", 0.0, "Depth Offset", "", "", "" );
setDeletable( true );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -233,3 +233,12 @@ void RimSurfaceCollection::updateViews()
view->scheduleCreateDisplayModelAndRedraw();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSurfaceCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
updateViews();
}

View File

@@ -42,6 +42,9 @@ public:
void updateViews();
void updateViews( const std::vector<RimSurface*>& surfsToReload );
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
private:
caf::PdmChildArrayField<RimSurface*> m_surfaces;
};