]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug NPAL19435 EDF 687 VISU: Picking non available when we have 2 views.
authorsln <sln@opencascade.com>
Fri, 11 Apr 2008 07:08:35 +0000 (07:08 +0000)
committersln <sln@opencascade.com>
Fri, 11 Apr 2008 07:08:35 +0000 (07:08 +0000)
The bug is solved. Verifications on null myPickingSettings object are added.

src/OBJECT/VISU_GaussPtsAct.cxx

index 5226e7c7eb0d2c481ebe915823845842899d6e0e..11f02cc015c160bc3bc8889c95e3f2aa217f92a3 100644 (file)
@@ -737,22 +737,24 @@ VISU_GaussPtsAct
          vtkDataSet* aDataSet = GetInput();
          vtkPointData* aPointData = aDataSet->GetPointData();
          if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
-           vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
-           aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
-           //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
-           vtkFloatingPointType aColor[3];
-           theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
-           aColor[0] = 1. - aColor[0];
-           aColor[1] = 1. - aColor[1];
-           aColor[2] = 1. - aColor[2];
-
-           myCursorPyramid->Init(aPyramidHeight,
-                                 myPickingSettings->GetCursorSize(),
-                                 GetRadius(anObjId,aVtkId,aScalarArray),
-                                 GetMagnification(anObjId),
-                                 GetClamp(anObjId),
-                                 aNodeCoord,
-                                 aColor);
+           if ( myPickingSettings ){
+             vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
+             aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
+             //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
+             vtkFloatingPointType aColor[3];
+             theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
+             aColor[0] = 1. - aColor[0];
+             aColor[1] = 1. - aColor[1];
+             aColor[2] = 1. - aColor[2];
+
+             myCursorPyramid->Init(aPyramidHeight,
+                                   myPickingSettings->GetCursorSize(),
+                                   GetRadius(anObjId,aVtkId,aScalarArray),
+                                   GetMagnification(anObjId),
+                                   GetClamp(anObjId),
+                                   aNodeCoord,
+                                   aColor);
+           }
          }
          myLastPreHighlightObjID = anObjId;
        }
@@ -776,7 +778,7 @@ ChangeZoom(VISU_PickingSettings *thePickingSettings,
           vtkIdType theInitialHasIndex,
           vtkIdType theCurrentHasIndex)
 {
-  if(theInitialHasIndex + theCurrentHasIndex == 1){
+  if( (theInitialHasIndex + theCurrentHasIndex == 1) && thePickingSettings){
     vtkCamera *aCamera = theRenderer->GetActiveCamera();
 
     vtkFloatingPointType aZoomFactor = thePickingSettings->GetZoomFactor();
@@ -912,6 +914,12 @@ VISU_GaussPtsAct
   if(!mySelector.GetPointer())
     return;
 
+  if ( !myPickingSettings )
+  {
+    Superclass::Highlight(theIsHighlight);
+    return;
+  }
+
   Selection_Mode aSelectionMode = mySelector->SelectionMode();
   
   bool anInitialHasIndex = isHighlighted() && mySelectionMode == GaussPointSelection;