Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/visu.git] / src / PIPELINE / VISU_SphereWidget.cxx
index 2134aeb72f7326d540fd3cc868a1464ea7a04239..82c8e8e898f7e7cb0121f02487974027e034fee8 100755 (executable)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
 #include "VISU_SphereWidget.hxx"
 
 #include <vtkActor.h>
@@ -43,7 +62,7 @@ VISU_SphereWidget::VISU_SphereWidget()
   mySphereActor->SetMapper(mySphereMapper);
   //
   // Define the point coordinates
-  float bounds[6];
+  vtkFloatingPointType bounds[6];
   for(int i = 0; i < 6; i += 2){
     bounds[i]=-.5;
     bounds[i+1]=-bounds[i];
@@ -126,7 +145,7 @@ int VISU_SphereWidget::GetPhiResolution()
 // function: SetRadius
 // purpose :
 //====================================================================
-void VISU_SphereWidget::SetRadius(float theRadius) 
+void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius) 
 {
   if ( theRadius <= myRmin ) {
     theRadius = myRmin;
@@ -138,7 +157,7 @@ void VISU_SphereWidget::SetRadius(float theRadius)
 // function: GetRadius
 // purpose :
 //====================================================================
-float VISU_SphereWidget::GetRadius()
+vtkFloatingPointType VISU_SphereWidget::GetRadius()
 { 
   return mySphereSource->GetRadius(); 
 }
@@ -146,7 +165,7 @@ float VISU_SphereWidget::GetRadius()
 // function: SetCenter
 // purpose :
 //====================================================================
-void VISU_SphereWidget::SetCenter(float theCenter[3]) 
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3]) 
 {
   mySphereSource->SetCenter(theCenter);
   mySphere->SetCenter(theCenter);
@@ -155,9 +174,9 @@ void VISU_SphereWidget::SetCenter(float theCenter[3])
 // function: SetCenter
 // purpose :
 //====================================================================
-void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ) 
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theX, vtkFloatingPointType theY, vtkFloatingPointType theZ) 
 {
-  float aCenter[3] = {theX, theY, theZ};
+  vtkFloatingPointType aCenter[3] = {theX, theY, theZ};
   SetCenter(aCenter);
 }
 
@@ -165,7 +184,7 @@ void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ)
 // function: GetCenter
 // purpose :
 //====================================================================
-float*  VISU_SphereWidget::GetCenter() 
+vtkFloatingPointType*  VISU_SphereWidget::GetCenter() 
 {
   return mySphereSource->GetCenter();
 }
@@ -173,7 +192,7 @@ float*  VISU_SphereWidget::GetCenter()
 // function: GetCenter
 // purpose :
 //====================================================================
-void  VISU_SphereWidget::GetCenter(float theCenter[3]) 
+void  VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3]) 
 {
   mySphereSource->GetCenter(theCenter);
 }
@@ -469,7 +488,7 @@ void VISU_SphereWidget::OnMiddleButtonUp()
 //====================================================================
 void VISU_SphereWidget::Translate(double *p1, double *p2)
 {
-  float v[3], aC[3], aC1[3];
+  vtkFloatingPointType v[3], aC[3], aC1[3];
   //
   v[0] = p2[0] - p1[0];
   v[1] = p2[1] - p1[1];
@@ -495,7 +514,7 @@ void VISU_SphereWidget::Scale(double *p1, double *p2,
   v[1] = p2[1] - p1[1];
   v[2] = p2[2] - p1[2];
   //
-  float aC[3], aR, sf, aR1;
+  vtkFloatingPointType aC[3], aR, sf, aR1;
   aR=mySphereSource->GetRadius();
   mySphereSource->GetCenter(aC);
   sf=vtkMath::Norm(v)/aR;
@@ -561,12 +580,12 @@ void VISU_SphereWidget::CreateDefaultProperties()
 // function:PlaceWidget
 // purpose:
 //====================================================================
-void VISU_SphereWidget::PlaceWidget(float bds[6])
+void VISU_SphereWidget::PlaceWidget(vtkFloatingPointType bds[6])
 {
-  float bounds[6], center[3], radius;
+  vtkFloatingPointType bounds[6], center[3], radius;
 
   this->AdjustBounds(bds, bounds, center);
-  float dX, dY, dZ;
+  vtkFloatingPointType dX, dY, dZ;
   //
   dX=bounds[1]-bounds[0];
   dY=bounds[3]-bounds[2];
@@ -591,7 +610,7 @@ void VISU_SphereWidget::PlaceWidget(float bds[6])
                        (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
                        (bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
 
-  static float EPS = 1.0E-1;
+  static vtkFloatingPointType EPS = 1.0E-1;
   myRmin = EPS*InitialLength;
 
 }