]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce a new parameter for selection cursor - "cursor size"
authorapo <apo@opencascade.com>
Fri, 16 Dec 2005 08:48:31 +0000 (08:48 +0000)
committerapo <apo@opencascade.com>
Fri, 16 Dec 2005 08:48:31 +0000 (08:48 +0000)
as it is mentioned in the Bug GVIEW10594

src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.h

index 052ee7bac344c9925ff606be3e780b0a1d72bbc0..bbabed7eeb4c864c2c9ca9d6ce4cac755156db85 100644 (file)
@@ -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);
 }
 
 
index 6a08df3c3ee5ea1b9a3c03a555958a7181196a26..0849939f01f4e237820da8eb336b5421609c2dc8 100644 (file)
@@ -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;
 }
 
index ba60a38859d8ebeb0d1f7f5c5d335ed8d0f86c32..e25e9256de0afbf0cb783d47dce21c06770adec2 100644 (file)
@@ -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<vtkPolyDataMapper> myMapper;
   //
   float myHeight;
+  float myCursorSize;
   float myRadius;
   float myMagnification;
   float myClamp;