SALOME_Actor
::highlight(bool theHighlight)
{
- highlight(theHighlight,ActorSelection);
+ highlight(theHighlight,mySelectionMode);
}
bool
vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
//
- int aSelectionMode = theSelectionEvent->mySelectionMode;
+ Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
float x1 = theSelectionEvent->myX;
float y1 = theSelectionEvent->myY;
float z1 = 0.0;
}
}
+ mySelectionMode = aSelectionMode;
+
+ highlight(theIsHighlight,theSelector);
+
+ return true;
+}
+
+void
+SALOME_Actor
+::highlight(bool theIsHighlight,
+ SVTK_Selector* theSelector)
+{
TColStd_IndexedMapOfInteger aMapIndex;
theSelector->GetIndex( getIO(), aMapIndex );
- switch( aSelectionMode )
+ switch( mySelectionMode )
{
case NodeSelection:
myHighlightProperty->SetRepresentationToPoints();
break;
}
- highlight( theIsHighlight, aSelectionMode );
-
- return true;
+ highlight( theIsHighlight, mySelectionMode );
}
+
//----------------------------------------------------------------------------
void
SALOME_Actor
highlight(bool theHighlight,
Selection_Mode theSelectionMode);
+ virtual
+ void
+ highlight(bool theHighlight,
+ SVTK_Selector* theSelector);
+
virtual
void
highlight(bool theHighlight);
}
};
+struct TSelectionAction
+{
+ bool myIsHighlight;
+ SVTK_Selector* mySelector;
+ TSelectionAction( bool theIsHighlight,
+ SVTK_Selector* theSelector ):
+ myIsHighlight( theIsHighlight ),
+ mySelector( theSelector )
+ {}
+
+ void
+ operator()( SALOME_Actor* theActor)
+ {
+ if(theActor->GetMapper()){
+ theActor->highlight( myIsHighlight, mySelector );
+ }
+ }
+};
+
void
SVTK_SignalHandler
::onSelectionChanged()
SVTK_Selector* aSelector = myMainWindow->GetSelector();
const SALOME_ListIO& aListIO = aSelector->StoredIObjects();
SALOME_ListIteratorOfListIO anIter(aListIO);
- Selection_Mode aSelectionMode = aSelector->SelectionMode();
for(; anIter.More(); anIter.Next()){
ForEachIf<SALOME_Actor>(anActors,
TIsSameIObject<SALOME_Actor>(anIter.Value()),
- THighlightAction(true,aSelectionMode));
+ TSelectionAction(true,aSelector));
}
- myMainWindow->Repaint();
+ myMainWindow->Repaint(false);
}