: SUIT_Selector( mgr, viewer ),
myViewer( viewer )
{
- if ( myViewer )
+ if ( myViewer ) {
connect( myViewer, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
+ connect( myViewer, SIGNAL( deselection() ), this, SLOT( onDeselection() ) );
+ }
}
/*!
selectionChanged();
}
+/*!On selection cleared.*/
+void LightApp_OCCSelector::onDeselection()
+{
+ mySelectedExternals.clear();
+}
+
/*!Gets selection list.*/
void LightApp_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
{
aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) );
#endif
}
+ // add externally selected objects
+ SUIT_DataOwnerPtrList::const_iterator anExtIter;
+ for(anExtIter = mySelectedExternals.begin(); anExtIter != mySelectedExternals.end(); anExtIter++) {
+ aList.append(*anExtIter);
+ }
}
/*!Sets selection list.*/
if ( !entryStr.isEmpty() )
aDisplayed.insert( entryStr, it.Value() );
}
+
+ mySelectedExternals.clear();
for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
{
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
if ( owner && aDisplayed.contains( owner->entry() ) )
aSelList.Append( aDisplayed[owner->entry()] );
+ else
+ mySelectedExternals.append(*itr);
}
myViewer->unHighlightAll( false );
#include "LightApp.h"
#include <SUIT_Selector.h>
+#include <SUIT_DataOwner.h>
#include <OCCViewer_ViewModel.h>
private slots:
virtual void onSelectionChanged();
+ virtual void onDeselection();
protected:
virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
QString entry( const Handle_AIS_InteractiveObject& ) const;
+ SUIT_DataOwnerPtrList mySelectedExternals;
+
private:
OCCViewer_Viewer* myViewer;
};