+// 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>
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];
// function: SetRadius
// purpose :
//====================================================================
-void VISU_SphereWidget::SetRadius(float theRadius)
+void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius)
{
if ( theRadius <= myRmin ) {
theRadius = myRmin;
// function: GetRadius
// purpose :
//====================================================================
-float VISU_SphereWidget::GetRadius()
+vtkFloatingPointType VISU_SphereWidget::GetRadius()
{
return mySphereSource->GetRadius();
}
// function: SetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::SetCenter(float theCenter[3])
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->SetCenter(theCenter);
mySphere->SetCenter(theCenter);
// 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);
}
// function: GetCenter
// purpose :
//====================================================================
-float* VISU_SphereWidget::GetCenter()
+vtkFloatingPointType* VISU_SphereWidget::GetCenter()
{
return mySphereSource->GetCenter();
}
// function: GetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::GetCenter(float theCenter[3])
+void VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->GetCenter(theCenter);
}
//====================================================================
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];
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;
// 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];
(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;
}