Commit db922017 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: components store their names from blueprint

parent 2b180ea8
......@@ -68,12 +68,15 @@ public:
virtual unsigned int CountProvidingInterfaces( const InterfaceCriteriaType ) = 0;
//virtual const std::map< std::string, std::string > TemplateProperties(); //TODO should be overridden
void Name(const std::string setName){ m_Name = setName; }; //Setter should be via constructor. We should get rid of itk factory design.
const std::string Name(){ return m_Name; };
protected:
ComponentBase() {}
virtual ~ComponentBase() {}
std::string m_Name;
};
} // end namespace selx
......
......@@ -77,9 +77,9 @@ public:
void PrintComponents(void);
protected:
void ComponentName(const std::string); //Setter should be via constructor. We should get rid of itk factory design.
CriteriaType m_Criteria;
protected:
ComponentListType m_PossibleComponents;
ComponentSelector();
~ComponentSelector();
......
......@@ -31,11 +31,11 @@ ComponentSelector::ComponentSelector()
for( std::list< itk::LightObject::Pointer >::iterator i = allobjects.begin();
i != allobjects.end(); ++i )
{
ComponentBase * io
ComponentBase * component
= dynamic_cast< ComponentBase * >( i->GetPointer() );
if( io )
if (component)
{
this->m_PossibleComponents.push_back( io );
this->m_PossibleComponents.push_back(component);
}
}
}
......@@ -45,6 +45,14 @@ ComponentSelector::~ComponentSelector()
{
}
void ComponentSelector::ComponentName(const std::string name)
{
for (const auto & component : this->m_PossibleComponents)
{
component->Name(name);
}
}
void
ComponentSelector::AddCriterion( const CriterionType & criterion )
......
Supports Markdown
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