VISU_GaussPtsAct
::GetPickable()
{
- return myDeviceActor->GetPickable();
+ if(Superclass::GetPickable()){
+ if(vtkMapper* aMapper = GetMapper()){
+ if(vtkDataSet* aDataSet= aMapper->GetInput()){
+ aDataSet->Update();
+ return aDataSet->GetNumberOfCells() > 0;
+ }
+ }
+ }
+
+ return false;
}
//----------------------------------------------------------------------------
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight)
{
+ if ( !GetPickable() )
+ return false;
+
myPreHighlightActor->SetVisibility(false);
myCursorPyramid->SetVisibility(false);
- if (!myBarVisibility) {
+ if (!myBarVisibility)
return false;
- }
+
if(!theIsHighlight)
myLastObjPointID = -1;
ChangeZoom(VISU_PickingSettings *thePickingSettings,
vtkInteractorStyle* theInteractorStyle,
int theInitialHasIndex,
- SVTK_Selector* theSelector,
+ int theCurrentHasIndex,
const Handle(SALOME_InteractiveObject)& theIO)
{
- int aCurrentHasIndex = theSelector->HasIndex(theIO);
-
- if(theInitialHasIndex + aCurrentHasIndex == 1){
+ if(theInitialHasIndex + theCurrentHasIndex == 1){
vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
vtkCamera *aCamera = aRenderer->GetActiveCamera();
vtkFloatingPointType aZoomFactor = thePickingSettings->GetZoomFactor();
double aScale = aCamera->GetParallelScale();
- if (!theInitialHasIndex && aCurrentHasIndex) {
+ if (!theInitialHasIndex && theCurrentHasIndex) {
aCamera->SetParallelScale(aScale/aZoomFactor);
}
else {
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight)
{
- myIsHighlighted = false;
+ if ( !GetPickable() )
+ return false;
+
+ int anInitialHasIndex = myIsHighlighted && mySelectionMode == GaussPointSelection;
Handle(SALOME_InteractiveObject) anIO = getIO();
- int anInitialHasIndex = mySelector->HasIndex(anIO);
+ myIsHighlighted = false;
Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
- //
+
if(!theIsHighlight && aSelectionMode == GaussPointSelection){
mySelector->RemoveIObject(anIO);
ChangeZoom(myPickingSettings,
theInteractorStyle,
anInitialHasIndex,
- mySelector.GetPointer(),
+ false,
anIO);
return true;
}
- if (!myBarVisibility) {
+ if (!myBarVisibility)
return false;
- }
- //
- if(aSelectionMode == ActorSelection){
+
+
+ if(aSelectionMode == ActorSelection)
return Superclass::Highlight(theInteractorStyle,
theSelectionEvent,
theIsHighlight);
- }
- //
+
if(aSelectionMode == GaussPointSelection && !theSelectionEvent->myIsRectangle){
vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
ChangeZoom(myPickingSettings,
theInteractorStyle,
anInitialHasIndex,
- mySelector.GetPointer(),
+ false,
anIO);
return true;
ChangeZoom(myPickingSettings,
theInteractorStyle,
anInitialHasIndex,
- mySelector.GetPointer(),
+ true,
anIO);
return true;
ChangeZoom(myPickingSettings,
theInteractorStyle,
anInitialHasIndex,
- mySelector.GetPointer(),
+ false,
anIO);
return false;