Commit 9809b046 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

ENH: Implemented (partially) DatasetDescriptor::SetImageModel() to update XML...

ENH: Implemented (partially) DatasetDescriptor::SetImageModel() to update XML DOM when color settings have been edited.
parent 2ffad70b
......@@ -174,6 +174,44 @@ DatasetDescriptor
}
}
/*******************************************************************************/
bool
DatasetDescriptor
::SetImageModel( int id, void* settings )
{
qDebug() << "DatasetDescriptor::SetImageModel(" << id << ")";
assert( settings!=NULL );
// Access image information element.
QDomElement imageInfoElt( GetImageElement( id ) );
if( imageInfoElt.isNull() )
return false;
// Access settings group element.
QDomElement settingsElt(
imageInfoElt.firstChildElement( TAG_NAMES[ ELEMENT_SETTINGS_GROUP ] )
);
// TODO: Manage XML structure errors.
assert( !settingsElt.isNull() );
// RGB
QDomElement rgbElt(
settingsElt.firstChildElement( TAG_NAMES[ ELEMENT_RGB_CHANNELS ] )
);
// TODO: Manage XML structure errors.
assert( !rgbElt.isNull() );
// TODO: Set RGB text here.
// Dynamics
QDomElement dynamicsElt(
settingsElt.firstChildElement( TAG_NAMES[ ELEMENT_DYNAMICS_PARAMETERS ] )
);
// TODO: Manage XML structure errors.
assert( !dynamicsElt.isNull() );
// TODO: Set dynamics text here.
}
/*******************************************************************************/
void
DatasetDescriptor
......@@ -243,13 +281,6 @@ DatasetDescriptor
}
}
/*******************************************************************************/
void
DatasetDescriptor
::SetImageModel( int id, void* settings )
{
}
/*******************************************************************************/
void
DatasetDescriptor
......
......@@ -144,7 +144,7 @@ public:
/**
*/
void SetImageModel( int id, void* settings );
bool SetImageModel( int id, void* settings );
/**
*/
......@@ -204,7 +204,11 @@ private:
static
void ExtractArrayFromNode( itk::Array<T>& array,
QDomElement& tagName );
/**
*/
inline QDomElement GetImageElement( int id );
/**
*/
void Read( const QString& filename );
......@@ -280,8 +284,6 @@ private slots:
namespace mvd
{
/*****************************************************************************/
/*****************************************************************************/
inline
QDomElement
......@@ -293,6 +295,21 @@ DatasetDescriptor
);
}
/*****************************************************************************/
inline
QDomElement
DatasetDescriptor
::GetImageElement( int id )
{
QDomElement imageElt;
for( imageElt = FirstImageElement();
!imageElt.isNull() && imageElt.attribute( "id" ).toInt()==id;
imageElt = DatasetDescriptor::NextImageSiblingElement( imageElt ) );
return imageElt;
}
/*****************************************************************************/
inline
QDomElement
......@@ -331,6 +348,7 @@ DatasetDescriptor
return vectorElement;
}
/*****************************************************************************/
template< typename T >
inline
void
......@@ -358,6 +376,7 @@ DatasetDescriptor
}
}
/*****************************************************************************/
template< typename T >
inline
void
......
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