Commit 9ff96598 authored by Frédéric Larue's avatar Frédéric Larue

Instead of returning true or false, GLViewer::addDisplayable() return the...

Instead of returning true or false, GLViewer::addDisplayable() return the created DisplayableInterface or NULL.
parent aff48237
......@@ -318,7 +318,7 @@ void GLViewer::populateDisplayerFactories( QList<DisplayableFactoryInterface*> &
}
bool GLViewer::addDisplayable( GenericUIData *m )
DisplayableInterface* GLViewer::addDisplayable( GenericUIData *m )
{
// If a displayable already exists for this manageable, remove it before creating a new one.
removeDisplayable( m );
......@@ -326,7 +326,7 @@ bool GLViewer::addDisplayable( GenericUIData *m )
// Recovers the displayable factory for the corresponding datatype.
FactoryMap::iterator factory = m_Factories.find( m->GetTypeString() );
if( factory == m_Factories.end() )
return false;
return NULL;
// Asks the factory to create a displayable of the correct type. It is then
// initialized and inserted in the list of all displayables.
......@@ -403,11 +403,10 @@ bool GLViewer::addDisplayable( GenericUIData *m )
{
m_AddingOrder.push_back( dispInfo );
repackDisplayables();
//frameAll();
}
return displayable != NULL;
return displayable;
}
......
......@@ -385,7 +385,7 @@ public slots:
inline void emitScreenSpaceTranslation( const QVector2D& tr) { emit screenSpaceTranslation(tr); }
inline void emitViewRotationMatrixUpdated( const QMatrix4x4 &r ) { emit viewRotationMatrixUpdated(r); }
virtual bool addDisplayable( GenericUIData *m );
virtual DisplayableInterface* addDisplayable( GenericUIData *m );
virtual void removeDisplayable( GenericUIData *m );
virtual void removeAllDisplayables();
......
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