From 1b43dfc40d6a0cd6d4169b9cf82868e98cce0073 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 16 Dec 2005 08:48:31 +0000 Subject: [PATCH] To introduce a new parameter for selection cursor - "cursor size" as it is mentioned in the Bug GVIEW10594 --- src/OBJECT/VISU_GaussPtsAct.cxx | 18 +++++++++--------- src/OBJECT/VISU_GaussPtsDeviceActor.cxx | 13 +++++++++---- src/OBJECT/VISU_GaussPtsDeviceActor.h | 5 ++++- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 052ee7ba..bbabed7e 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -392,13 +392,9 @@ namespace float GetRadius(vtkIdType theVTKID, vtkDataArray *theScalarArray, - VISU_GaussPointsPL* theGaussPointsPL, - VISU_PickingSettings* thePickingSettings) + VISU_GaussPointsPL* theGaussPointsPL) { float aRadius = 0.5; - if(thePickingSettings && !thePickingSettings->GetInitial()){ - aRadius *= thePickingSettings->GetCursorSize(); - } if(theGaussPointsPL->GetPSMapper()->GetPointSpriteMode() == 1) // Geometry mode aRadius *= theGaussPointsPL->GetSize() * theGaussPointsPL->GetAverageCellSize(); else if(theGaussPointsPL->GetBicolor()){ @@ -420,7 +416,7 @@ VISU_GaussPtsAct ::GetRadius(vtkIdType theVTKID, vtkDataArray *theScalarArray) { - return ::GetRadius(theVTKID,theScalarArray,myDeviceActor->GetPipeLine(),myPickingSettings); + return ::GetRadius(theVTKID,theScalarArray,myDeviceActor->GetPipeLine()); } //---------------------------------------------------------------------------- @@ -675,7 +671,9 @@ VISU_GaussPtsAct aColor[0] = 1. - aColor[0]; aColor[1] = 1. - aColor[1]; aColor[2] = 1. - aColor[2]; + myCursorPyramid->Init(aPyramidHeight, + myPickingSettings->GetCursorSize(), GetRadius(aVtkId,aScalarArray), GetMagnification(aVtkId), GetClamp(anObjId), @@ -885,6 +883,7 @@ VISU_GaussPtsAct float aPyramidHeight = myPickingSettings->GetPyramidHeight(); aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); myCursorPyramidSelected->Init(aPyramidHeight, + myPickingSettings->GetCursorSize(), GetRadius(aVtkId,aScalarArray), GetMagnification(aVtkId), GetClamp(anObjId), @@ -986,8 +985,9 @@ VISU_GaussPtsAct myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency()); float aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight(); - myCursorPyramid->SetHeight(aHeight); - myCursorPyramidSelected->SetHeight(aHeight); + float aCursorSize = myPickingSettings->GetCursorSize(); + myCursorPyramid->SetPreferences(aHeight,aCursorSize); + myCursorPyramidSelected->SetPreferences(aHeight,aCursorSize); myHighlightActor->GetProperty()->SetColor( myPickingSettings->GetColor() ); myPointPicker->SetTolerance( myPickingSettings->GetPointTolerance() ); @@ -1214,7 +1214,7 @@ VISU_GaussPtsAct1 else aPipeLine = myInsideDeviceActor->GetPipeLine(); } - return ::GetRadius(theVTKID,theScalarArray,aPipeLine,myPickingSettings); + return ::GetRadius(theVTKID,theScalarArray,aPipeLine); } diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index 6a08df3c..0849939f 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -242,7 +242,7 @@ VISU_CursorPyramid this->SetScale(1.0); float aMRadius = myRadius*myMagnification; - Init(myHeight,aMRadius); + Init(myHeight,aMRadius*myCursorSize); if(myClamp > 0.0f){ float aPoint1[3] = {0.0, 0.0, 0.0}; @@ -323,29 +323,34 @@ VISU_CursorPyramid //---------------------------------------------------------------------------- void VISU_CursorPyramid -::SetHeight(float theHeight) +::SetPreferences(float theHeight, + float theCursorSize) { - Init(theHeight, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor()); + Init(theHeight, theCursorSize, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor()); } //---------------------------------------------------------------------------- void VISU_CursorPyramid ::Init(float theHeight, + float theCursorSize, float theRadius, float theMagnification, float theClamp, float thePos[3], float theColor[3]) { - Init(theHeight,theRadius*theMagnification); + Init(theHeight,theRadius*theMagnification*theCursorSize); SetPosition(thePos[0],thePos[1],thePos[2]); GetProperty()->SetColor(theColor); SetMapper(myMapper.GetPointer()); myHeight = theHeight; + myCursorSize = theCursorSize; + myRadius = theRadius; myMagnification = theMagnification; + myClamp = theClamp; } diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index ba60a388..e25e9256 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -127,13 +127,15 @@ public: void Init(float theHeight, + float theCursorSize, float theRadius, float theMagnification, float theClamp, float thePos[3], float theColor[3]); - void SetHeight(float theHeight); + void SetPreferences(float theHeight, + float theCursorSize); protected: VISU_CursorPyramid(); @@ -148,6 +150,7 @@ protected: vtkSmartPointer myMapper; // float myHeight; + float myCursorSize; float myRadius; float myMagnification; float myClamp; -- 2.39.2