]> 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:28:12 +0000 (08:28 +0000)
committerapo <apo@opencascade.com>
Fri, 16 Dec 2005 08:28:12 +0000 (08:28 +0000)
as it is mentioned in the Bug GVIEW10594

src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsSettings.cxx
src/OBJECT/VISU_GaussPtsSettings.h

index 7260745c8f1d2f3e2a350758d7ee86399303b4e8..052ee7bac344c9925ff606be3e780b0a1d72bbc0 100644 (file)
@@ -392,9 +392,13 @@ namespace
   float 
   GetRadius(vtkIdType theVTKID,
            vtkDataArray *theScalarArray,
-           VISU_GaussPointsPL* theGaussPointsPL)
+           VISU_GaussPointsPL* theGaussPointsPL,
+           VISU_PickingSettings* thePickingSettings)
   {
     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()){
@@ -416,7 +420,7 @@ VISU_GaussPtsAct
 ::GetRadius(vtkIdType theVTKID,
            vtkDataArray *theScalarArray)
 {
-  return ::GetRadius(theVTKID,theScalarArray,myDeviceActor->GetPipeLine());
+  return ::GetRadius(theVTKID,theScalarArray,myDeviceActor->GetPipeLine(),myPickingSettings);
 }
 
 //----------------------------------------------------------------------------
@@ -1210,7 +1214,7 @@ VISU_GaussPtsAct1
     else
       aPipeLine = myInsideDeviceActor->GetPipeLine();
   }
-  return ::GetRadius(theVTKID,theScalarArray,aPipeLine);
+  return ::GetRadius(theVTKID,theScalarArray,aPipeLine,myPickingSettings);
 }
 
 
index 296f39a3c4d48ac1644d511304c849ebb0d0c12c..b95b1627513ebdbfeab506d232fe19014cfe8886 100644 (file)
@@ -89,6 +89,7 @@ VISU_PickingSettings::VISU_PickingSettings()
   this->Initial                = true;
 
   this->PyramidHeight          = -1;
+  this->CursorSize             = -1;
   this->PointTolerance         = -1;
   this->Color[0]               = -1;
   this->Color[1]               = -1;
index e9c7cd2e7fdbd5d7359ed7351deac62207f17724..1778521db9a910bd3953ae19ffe243df5a4271cb 100644 (file)
@@ -189,6 +189,9 @@ class VISU_PickingSettings : public vtkObject
   vtkSetMacro( PyramidHeight, float );
   vtkGetMacro( PyramidHeight, float );
 
+  vtkSetMacro( CursorSize, float );
+  vtkGetMacro( CursorSize, float );
+
   vtkSetVector3Macro( Color, float );
   vtkGetVector3Macro( Color, float );
 
@@ -214,6 +217,7 @@ private:
   bool                Initial;
 
   float               PyramidHeight;
+  float               CursorSize;
   float               PointTolerance;
   float               Color[3];
   float               InfoWindowTransparency;