Commit 9b3f52f1 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[CHANGE] changed some property names to make the gui interface for the data

module better
parent db25563f
......@@ -300,7 +300,7 @@ void WQtDatasetBrowser::slotSetStringProperty( QString name, QString value )
boost::shared_ptr< WModule >module =( ( WQtDatasetTreeItem* ) m_treeWidget->selectedItems().at( 0 ) )->getModule();
module->getProperties()->setValue<std::string>( name.toStdString(), value.toStdString() );
if ( name == "name")
if ( name == "Name")
{
m_treeWidget->selectedItems().at( 0 )->setText( 0, value );
}
......
......@@ -41,7 +41,7 @@ WQtDatasetTreeItem* WQtSubjectTreeItem::addDatasetItem( boost::shared_ptr< WModu
{
WQtDatasetTreeItem* ds = new WQtDatasetTreeItem( this, module );
std::string name = module->getProperties()->getValueString( "name" );
std::string name = module->getProperties()->getValueString( "Name" );
// remove the path up to the file name
name = string_utils::tokenize( name, "/" ).back();
......
......@@ -89,23 +89,23 @@ void WMData::properties()
// filename of file to load and handle
m_properties->addString( "filename", "", true );
m_properties->addString( "name" );
m_properties->addString( "Name" );
( m_properties->addBool( "active", true, true ) )->connect( boost::bind( &WMData::slotPropertyChanged, this, _1 ) );
( m_properties->addBool( "interpolation", true ) )->connect( boost::bind( &WMData::slotPropertyChanged, this, _1 ) );
( m_properties->addInt( "threshold", 0 ) )->connect( boost::bind( &WMData::slotPropertyChanged, this, _1 ) );
( m_properties->addInt( "alpha", 100 ) )->connect( boost::bind( &WMData::slotPropertyChanged, this, _1 ) );
m_properties->setMax( "alpha", 100 );
( m_properties->addBool( "Interpolation", true ) )->connect( boost::bind( &WMData::slotPropertyChanged, this, _1 ) );
( m_properties->addInt( "Threshold", 0 ) )->connect( boost::bind( &WMData::slotPropertyChanged, this, _1 ) );
( m_properties->addInt( "Opacity %", 100 ) )->connect( boost::bind( &WMData::slotPropertyChanged, this, _1 ) );
m_properties->setMax( "Opacity %", 100 );
}
void WMData::slotPropertyChanged( std::string propertyName )
{
if ( propertyName == "threshold" )
if ( propertyName == "Threshold" )
{
m_dataSet->getTexture()->setThreshold( m_properties->getValue<float>( "threshold" ) );
m_dataSet->getTexture()->setThreshold( m_properties->getValue<float>( "Threshold" ) );
}
if ( propertyName == "alpha" )
if ( propertyName == "Opacity %" )
{
m_dataSet->getTexture()->setAlpha( m_properties->getValue<float>( "alpha" ) / 100.0 );
m_dataSet->getTexture()->setAlpha( m_properties->getValue<float>( "Opacity %" ) / 100.0 );
}
}
......@@ -138,7 +138,7 @@ void WMData::moduleMain()
std::string fileName = m_properties->getValue< std::string >( "filename" );
debugLog() << "Loading data from \"" << fileName << "\".";
m_properties->setValue( "name", fileName );
m_properties->setValue( "Name", fileName );
// load it now
std::string suffix = getSuffix( fileName );
......@@ -171,19 +171,24 @@ void WMData::moduleMain()
{
WLoaderFibers fibLoader( fileName );
m_dataSet = fibLoader.load();
// hide other properties since they make no sense at all
m_properties->hideProperty( "filename" ); // File name is got via m_dataSet->getFileName()
m_properties->hideProperty( "active" );
m_properties->hideProperty( "interpolation" );
m_properties->hideProperty( "threshold" );
m_properties->hideProperty( "alpha" );
}
else
{
throw WDHException( "Unknown file type: '" + suffix + "'" );
}
if( suffix == ".fib"
|| suffix == ".asc"
|| suffix == ".edf" )
{
// hide other properties since they make no sense fo these data set types.
m_properties->hideProperty( "filename" ); // File name is got via m_dataSet->getFileName()
m_properties->hideProperty( "active" );
m_properties->hideProperty( "Interpolation" );
m_properties->hideProperty( "Threshold" );
m_properties->hideProperty( "Opacity %" );
}
debugLog() << "Loading data done.";
// notify
m_output->updateData( m_dataSet );
......
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