Commit 2ffad70b authored by Stéphane Albert's avatar Stéphane Albert
Browse files

ENH: Linked update of rendering settings to refresh of XML descriptor.

parent 756d6c8d
......@@ -143,7 +143,7 @@ DatasetModel
if( id<0 )
{
//
// 2.3: Add image to Dataset descriptor file...
// 2.4a: Add image to Dataset descriptor file...
m_Descriptor->InsertImageModel(
// ...providing newly calculated image-model ID.
context.m_Id,
......@@ -153,9 +153,21 @@ DatasetModel
);
//
// 2.4: Force writing descriptor with newly imported image.
// 2.5a: Force writing descriptor with newly imported image.
WriteDescriptor();
}
//
// 2.6
// Connect rendering-settings updated of image-model to
// dataset-model in order to update XML descriptor.
QObject::connect(
vectorImageModel,
SIGNAL( SettingsUpdated( AbstractImageModel* ) ),
// to:
this,
SLOT( OnSettingsUpdated( AbstractImageModel* ) )
);
}
catch( std::exception& exc )
{
......@@ -318,5 +330,23 @@ DatasetModel
/*******************************************************************************/
/*******************************************************************************/
void
DatasetModel
::OnSettingsUpdated( AbstractImageModel* imageModel )
{
assert( imageModel!=NULL );
qDebug() << "DatasetModel::OnSettingsUpdated(" << imageModel->GetId() << ")";
VectorImageModel* vectorImageModel =
qobject_cast< VectorImageModel* >( imageModel );
assert( vectorImageModel!=NULL );
m_Descriptor->SetImageModel(
vectorImageModel->GetId(),
&vectorImageModel->GetSettings()
);
}
} // end namespace 'mvd'
......@@ -240,6 +240,9 @@ private:
//
// Slots.
private slots:
/**
*/
void OnSettingsUpdated( AbstractImageModel* );
};
} // end namespace 'mvd'
......
......@@ -774,11 +774,6 @@ VectorImageModel
// Update quicklook rendering-settings.
quicklookModel->SetSettings( GetSettings() );
quicklookModel->OnModelUpdated();
// Ensure parent model is dataset-model.
assert( GetDatasetModel()!=NULL );
// Get parent dataset-model.
DatasetModel* datasetModel = GetDatasetModel();
}
// TODO: Update DatasetDescriptor.
......@@ -786,7 +781,7 @@ VectorImageModel
// Emit rendering settings are updated so that display could be
// refreshed.
emit SettingsUpdated();
emit SettingsUpdated( this );
}
/*******************************************************************************/
......
......@@ -392,10 +392,13 @@ public slots:
//
// Signals.
signals:
/** */
void SettingsUpdated();
/**
*/
void SettingsUpdated( AbstractImageModel* imageModel =NULL );
/** */
void ViewportRegionChanged(double, double);
/** */
void CurrentIndexUpdated(const QString&);
void CurrentPhysicalUpdated(const QString&);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment