From: sln Date: Fri, 11 Apr 2008 07:08:35 +0000 (+0000) Subject: Bug NPAL19435 EDF 687 VISU: Picking non available when we have 2 views. X-Git-Tag: V4_1_2rc1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2434e5f0ade97f2c77f31c7e470baa17d1be5047;p=modules%2Fvisu.git Bug NPAL19435 EDF 687 VISU: Picking non available when we have 2 views. The bug is solved. Verifications on null myPickingSettings object are added. --- diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 5226e7c7..11f02cc0 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -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;