Commit 23d97431 authored by schurade's avatar schurade
Browse files

[FIX] use new properties for rois

parent 77867831
......@@ -311,9 +311,7 @@ void WQtDatasetBrowser::selectTreeItem()
break;
case ROI:
case SUBROI:
// TODO(schurade): update rois to use new properties
//props = ( static_cast< WQtRoiTreeItem* >( m_treeWidget->selectedItems().at( 0 ) ) )->getRoi()->getProperties()->getPropertyVector();
//props = module->getProperties2();
props = ( static_cast< WQtRoiTreeItem* >( m_treeWidget->selectedItems().at( 0 ) ) )->getRoi()->getProperties();
break;
default:
break;
......
......@@ -41,8 +41,8 @@ WRMROIRepresentation::WRMROIRepresentation( boost::shared_ptr< WROI > roi, boost
{
roi->getSignalIsModified()->connect( boost::bind( &WRMROIRepresentation::setDirty, this ) );
setDirty();
m_properties = boost::shared_ptr< WProperties >( new WProperties() );
m_properties->addBool( "NOT", false )->connect( boost::bind( &WRMROIRepresentation::slotPropertyChanged, this, _1 ) );
m_properties = boost::shared_ptr< WProperties2 >( new WProperties2() );
m_isNot = m_properties->addProperty( "NOT", "description", false, boost::bind( &WRMROIRepresentation::slotToggleNot, this ) );
}
WRMROIRepresentation::~WRMROIRepresentation()
......@@ -159,22 +159,13 @@ void WRMROIRepresentation::setDirty()
m_branch->setDirty();
}
void WRMROIRepresentation::slotPropertyChanged( std::string propertyName )
void WRMROIRepresentation::slotToggleNot()
{
if( propertyName == "NOT" )
{
m_roi->setNot( m_properties->getValue< bool >( propertyName ) );
setDirty();
}
else
{
// instead of WLogger we must use std::cerr since WLogger needs to much time!
std::cerr << propertyName << std::endl;
assert( 0 && "This property name is not supported by this function yet." );
}
m_roi->setNot( m_isNot->get() );
setDirty();
}
boost::shared_ptr< WProperties > WRMROIRepresentation::getProperties()
boost::shared_ptr< WProperties2 > WRMROIRepresentation::getProperties()
{
return m_properties;
}
......@@ -34,7 +34,7 @@
#include <boost/thread/thread.hpp>
#include "WKdTree.h"
#include "./../../common/WProperties.h"
#include "./../../common/WProperties2.h"
#include "../../graphicsEngine/WROI.h"
class WRMBranch;
/**
......@@ -95,19 +95,16 @@ public:
void setDirty();
/**
* getter
*
* \return the properties object
* returns the properties object
*/
boost::shared_ptr< WProperties > getProperties();
boost::shared_ptr< WProperties2 > getProperties();
protected:
/**
* slot gets called when a property has changed
*
* \param propertyName
*/
void slotPropertyChanged( std::string propertyName );
void slotToggleNot();
private:
/**
* tests the kd tree for intersections with the roi
......@@ -164,7 +161,12 @@ private:
/**
* the property object for the module
*/
boost::shared_ptr< WProperties > m_properties;
boost::shared_ptr< WProperties2 > m_properties;
/**
* indicates if the roi is negated
*/
WPropBool m_isNot;
};
#endif // WRMROIREPRESENTATION_H
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