#include "gtkutil/widget.h"
#include "brushmanip.h"
#include "brush.h"
+#include "patch.h"
#include "patchmanip.h"
#include "patchdialog.h"
#include "selection.h"
class InvertSelectionWalker : public scene::Graph::Walker
{
SelectionSystem::EMode m_mode;
+SelectionSystem::EComponentMode m_compmode;
mutable Selectable* m_selectable;
public:
-InvertSelectionWalker( SelectionSystem::EMode mode )
- : m_mode( mode ), m_selectable( 0 ){
+InvertSelectionWalker( SelectionSystem::EMode mode, SelectionSystem::EComponentMode compmode )
+ : m_mode( mode ), m_compmode( compmode ), m_selectable( 0 ){
}
bool pre( const scene::Path& path, scene::Instance& instance ) const {
if( !path.top().get().visible() ){
m_selectable = path.top().get().visible() ? selectable : 0;
break;
case SelectionSystem::eComponent:
+ BrushInstance* brushinstance = Instance_getBrush( instance );
+ if( brushinstance != 0 ){
+ if( brushinstance->isSelected() )
+ brushinstance->invertComponentSelection( m_compmode );
+ }
+ else{
+ PatchInstance* patchinstance = Instance_getPatch( instance );
+ if( patchinstance != 0 && m_compmode == SelectionSystem::eVertex ){
+ if( patchinstance->isSelected() )
+ patchinstance->invertComponentSelection();
+ }
+ }
break;
}
}
};
void Scene_Invert_Selection( scene::Graph& graph ){
- graph.traverse( InvertSelectionWalker( GlobalSelectionSystem().Mode() ) );
+ graph.traverse( InvertSelectionWalker( GlobalSelectionSystem().Mode(), GlobalSelectionSystem().ComponentMode() ) );
}
void Select_Invert(){