Salome HOME
Update copyright information
[modules/geom.git] / src / OBJECT / GEOM_VTKTrihedron.cxx
index 3e79afb81199d92cf0aa34aaedca51af742d154a..113d7a931bf39a5d561c70f888158cdb726bfbcd 100644 (file)
@@ -1,64 +1,49 @@
-//  SALOME GEOM : 
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  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.
 //
-//  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//  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/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME GEOM : 
 //  File   : GEOM_VTKTrihedron.cxx
 //  Author : Sergey LITONIN
 //  Module : SALOME
 //  $Header:
-
+//
 #include "GEOM_VTKTrihedron.hxx"
-#include "utilities.h"
-#include "GEOM_OCCReader.h"
 
 #include <Geom_Axis2Placement.hxx>
 #include <gp_Ax2.hxx>
 #include <gp_Ax3.hxx>
 #include <gp_Pnt.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Compound.hxx>
 
-#include <vtkMath.h>
 #include <vtkMapper.h>
-#include <vtkDataSet.h>
 #include <vtkRenderer.h>
-#include <vtkFollower.h>
-#include <vtkRenderWindow.h>
 #include <vtkObjectFactory.h>
-#include <vtkPolyData.h>
 #include <vtkActor.h>
+#include <vtkActorCollection.h>
 #include <vtkProperty.h>
 #include <vtkLineSource.h>
-#include <vtkConeSource.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkAppendPolyData.h>
 #include <vtkMatrix4x4.h>
 #include <vtkTransform.h>
-
-#include "VTKViewer_VectorText.h"
-
-
+#include <vtkVectorText.h>
 
 /*
   Class       : GEOM_VTKTrihedron
@@ -78,15 +63,15 @@ public:
                                 vtkTypeMacro( GEOM_VTKTrihedronAxis, VTKViewer_Axis );
   static GEOM_VTKTrihedronAxis* New();
 
-  void                          SetAxis( const gp_Ax1& theAxis, const int theRot, float theColor[ 3 ] );
+  void                          SetAxis( const gp_Ax1& theAxis, const int theRot, vtkFloatingPointType theColor[ 3 ] );
   virtual void                  Render( vtkRenderer* theRenderer );
-  virtual void                  SetSize( float theSize );
+  virtual void                  SetSize( vtkFloatingPointType theSize );
   gp_Pnt                        GetOri() const;
-  void                          SetColor( const float theColor[ 3 ] );
+  void                          SetColor( const vtkFloatingPointType theColor[ 3 ] );
 
 private:
 
-  float                         myOri[ 3 ];
+  vtkFloatingPointType          myOri[ 3 ];
   vtkMatrix4x4*                 myMatrix;
   vtkTransform*                 myTrsf;
 };
@@ -109,11 +94,11 @@ GEOM_VTKTrihedronAxis::~GEOM_VTKTrihedronAxis()
   myTrsf->Delete();
 }
 
-void GEOM_VTKTrihedronAxis::SetSize( float theSize )
+void GEOM_VTKTrihedronAxis::SetSize( vtkFloatingPointType theSize )
 {
-  float aPosition[ 3 ] = { myOri[ 0 ] + myDir[ 0 ] * theSize,
-                           myOri[ 1 ] + myDir[ 1 ] * theSize,
-                           myOri[ 2 ] + myDir[ 2 ] * theSize };
+  vtkFloatingPointType aPosition[ 3 ] = { myOri[ 0 ] + myDir[ 0 ] * theSize,
+                                         myOri[ 1 ] + myDir[ 1 ] * theSize,
+                                         myOri[ 2 ] + myDir[ 2 ] * theSize };
                            
   myLineSource->SetPoint1( myOri[ 0 ], myOri[ 1 ], myOri[ 2 ] );
   myLineSource->SetPoint2( aPosition );
@@ -158,7 +143,7 @@ gp_Pnt GEOM_VTKTrihedronAxis::GetOri() const
 
 void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis,
                                      const int     theRot,
-                                     float         theColor[ 3 ] )
+                                     vtkFloatingPointType theColor[ 3 ] )
 {
   gp_Pnt aLoc = theAxis.Location();
   gp_Dir aDir = theAxis.Direction();
@@ -171,7 +156,7 @@ void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis,
   myDir[ 1 ] = aDir.Y();
   myDir[ 2 ] = aDir.Z();
 
-  float aColor[ 3 ] = { 0, 0, 0 };
+  vtkFloatingPointType aColor[ 3 ] = { 0, 0, 0 };
   aColor[ theRot ] = 1;
   vtkProperty* aProperty = vtkProperty::New();
   if ( theColor[ 0 ] == -1 )
@@ -186,7 +171,7 @@ void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis,
   else if ( theRot == 2 ) myVectorText->SetText( "Z" );
 }
 
-void GEOM_VTKTrihedronAxis::SetColor( const float theColor[ 3 ] )
+void GEOM_VTKTrihedronAxis::SetColor( const vtkFloatingPointType theColor[ 3 ] )
 {
   vtkProperty* aProperty = vtkProperty::New();
   aProperty->SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
@@ -222,7 +207,7 @@ GEOM_VTKTrihedron::~GEOM_VTKTrihedron()
     myMapper->Delete();
 }
 
-void GEOM_VTKTrihedron::SetSize( float theSize )
+void GEOM_VTKTrihedron::SetSize( vtkFloatingPointType theSize )
 {
   mySize = theSize;
   for ( int i = 0; i < 3; i++ )
@@ -351,7 +336,7 @@ void GEOM_VTKTrihedron::Render(vtkRenderer* r, vtkMapper *)
   ( (GEOM_VTKTrihedronAxis*)myAxis[ 2 ] )->Render( r );
 }
 
-void GEOM_VTKTrihedron::SetColor( float r, float g, float b )
+void GEOM_VTKTrihedron::SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b )
 {
   myColor[ 0 ] = r;
   myColor[ 1 ] = g;
@@ -362,7 +347,7 @@ void GEOM_VTKTrihedron::SetColor( float r, float g, float b )
   if ( myAxis[ 2 ] ) ( (GEOM_VTKTrihedronAxis*)myAxis[ 2 ] )->SetColor( myColor );
 }
 
-void GEOM_VTKTrihedron::GetColor( float& r, float& g, float& b )
+void GEOM_VTKTrihedron::GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b )
 {
   r = myColor[ 0 ];
   g = myColor[ 1 ];