Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/visu.git] / src / OBJECT / VISU_GaussPtsDeviceActor.cxx
index a59f4f20007dca74a24afb0e1335c991275ed243..0b72f0212f4b4675fd1f2fdf7afed2183559227a 100644 (file)
@@ -152,6 +152,22 @@ VISU_GaussPtsDeviceActor
   return myMapper.GetPointer();
 }
 
+int
+VISU_GaussPtsDeviceActor
+::GetPickable()
+{
+  if(Superclass::GetPickable()){
+    if(vtkMapper* aMapper = GetMapper()){
+      if(vtkDataSet* aDataSet= aMapper->GetInput()){
+       aDataSet->Update();
+       return aDataSet->GetNumberOfCells() > 0;
+      }
+    }
+  }
+
+  return false;
+}
+
 
 //----------------------------------------------------------------------------
 void
@@ -241,28 +257,28 @@ VISU_CursorPyramid
     }
 
   this->SetScale(1.0);
-  float aMRadius = myRadius*myMagnification;
+  vtkFloatingPointType aMRadius = myRadius*myMagnification;
   Init(myHeight,aMRadius*myCursorSize);
 
   if(myClamp > 0.0f){
-    float aPoint1[3] = {0.0, 0.0, 0.0};
+    vtkFloatingPointType aPoint1[3] = {0.0, 0.0, 0.0};
     ren->SetDisplayPoint(aPoint1);
     ren->DisplayToWorld();
     ren->GetWorldPoint(aPoint1);
 
-    float aPoint2[3] = {0.0, myClamp, 0.0};
+    vtkFloatingPointType aPoint2[3] = {0.0, myClamp, 0.0};
     ren->SetDisplayPoint(aPoint2);
     ren->DisplayToWorld();
     ren->GetWorldPoint(aPoint2);
     
-    float aWorldClamp = 
+    vtkFloatingPointType aWorldClamp = 
       (aPoint2[0] - aPoint1[0])*(aPoint2[0] - aPoint1[0]) + 
       (aPoint2[1] - aPoint1[1])*(aPoint2[1] - aPoint1[1]) + 
       (aPoint2[2] - aPoint1[2])*(aPoint2[2] - aPoint1[2]); 
     
     aWorldClamp = sqrt(aWorldClamp);
-    float aMDiameter = 2.0 * aMRadius;
-    float aCoeff = aWorldClamp / aMDiameter;
+    vtkFloatingPointType aMDiameter = 2.0 * aMRadius;
+    vtkFloatingPointType aCoeff = aWorldClamp / aMDiameter;
 
     if(aCoeff < 1.0){
       this->SetScale(aCoeff);
@@ -323,8 +339,8 @@ VISU_CursorPyramid
 //----------------------------------------------------------------------------
 void 
 VISU_CursorPyramid
-::SetPreferences(float theHeight,
-                float theCursorSize)
+::SetPreferences(vtkFloatingPointType theHeight,
+                vtkFloatingPointType theCursorSize)
 {
   Init(theHeight, theCursorSize, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor());
 }
@@ -332,13 +348,13 @@ VISU_CursorPyramid
 //----------------------------------------------------------------------------
 void
 VISU_CursorPyramid
-::Init(float theHeight,
-       float theCursorSize,
-       float theRadius,
-       float theMagnification,
-       float theClamp,
-       float thePos[3],
-       float theColor[3])
+::Init(vtkFloatingPointType theHeight,
+       vtkFloatingPointType theCursorSize,
+       vtkFloatingPointType theRadius,
+       vtkFloatingPointType theMagnification,
+       vtkFloatingPointType theClamp,
+       vtkFloatingPointType thePos[3],
+       vtkFloatingPointType theColor[3])
 {
   Init(theHeight,theRadius*theMagnification*theCursorSize);
   SetPosition(thePos[0],thePos[1],thePos[2]);
@@ -357,8 +373,8 @@ VISU_CursorPyramid
 
 void
 VISU_CursorPyramid
-::Init(float theHeight,
-       float theRadius)
+::Init(vtkFloatingPointType theHeight,
+       vtkFloatingPointType theRadius)
 {
   for(int i = 0; i < myNbCones; ++i){
     vtkConeSource* aSource = mySources[i].GetPointer();
@@ -368,7 +384,7 @@ VISU_CursorPyramid
     aSource->SetAngle(20.0);
   }
   
-  float aDisplacement = -0.5*theHeight - theRadius;
+  vtkFloatingPointType aDisplacement = -0.5*theHeight - theRadius;
   
   // X
   mySources[0]->SetDirection(1.0, 0.0, 0.0);
@@ -507,7 +523,7 @@ int VISU_FramedTextActor::GetPickable()
 // function : SetTransparency
 // purpose  :
 //==================================================================
-void VISU_FramedTextActor::SetTransparency(const float theTransparency)
+void VISU_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency)
 {
   if (theTransparency>=0.  && theTransparency<=1.){
     myTransparency=theTransparency;
@@ -519,7 +535,7 @@ void VISU_FramedTextActor::SetTransparency(const float theTransparency)
 // function : GetTransparency
 // purpose  :
 //==================================================================
-float VISU_FramedTextActor::GetTransparency()const
+vtkFloatingPointType VISU_FramedTextActor::GetTransparency()const
 {
   return myTransparency;
 }
@@ -561,7 +577,7 @@ int VISU_FramedTextActor::GetModePosition()const
 // function : SetWorldPoint
 // purpose  :
 //==================================================================
-void VISU_FramedTextActor::SetWorldPoint(const float theWorldPoint[4])
+void VISU_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4])
 {
   for(int i = 0; i<4; ++i) {
     myWorldPoint[i] = theWorldPoint[i];
@@ -572,7 +588,7 @@ void VISU_FramedTextActor::SetWorldPoint(const float theWorldPoint[4])
 // function : GetWorldPoint
 // purpose  :
 //==================================================================
-const float* VISU_FramedTextActor::GetWorldPoint()const 
+const vtkFloatingPointType* VISU_FramedTextActor::GetWorldPoint()const 
 {
   return myWorldPoint;
 }
@@ -580,7 +596,7 @@ const float* VISU_FramedTextActor::GetWorldPoint()const
 // function : SetDistance
 // purpose  :
 //==================================================================
-void VISU_FramedTextActor::SetDistance(const float theDistance)
+void VISU_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance)
 {
   myDistance=theDistance;
 }
@@ -588,7 +604,7 @@ void VISU_FramedTextActor::SetDistance(const float theDistance)
 // function : GetDistance
 // purpose  :
 //==================================================================
-float VISU_FramedTextActor::GetDistance()const
+vtkFloatingPointType VISU_FramedTextActor::GetDistance()const
 {
   return myDistance;
 }
@@ -649,10 +665,10 @@ VISU_FramedTextActor
     theViewport->SetWorldPoint(myWorldPoint);
     theViewport->WorldToDisplay();
 
-    float aSelectionPoint[3];
+    vtkFloatingPointType aSelectionPoint[3];
     theViewport->GetDisplayPoint(aSelectionPoint);
-    float u = aSelectionPoint[0];
-    float v = aSelectionPoint[1] - myDistance;
+    vtkFloatingPointType u = aSelectionPoint[0];
+    vtkFloatingPointType v = aSelectionPoint[1] - myDistance;
     theViewport->ViewportToNormalizedViewport(u, v);
     PositionCoordinate->SetValue(u, v);
     //