src/OBJECT/GEOM_VTKTrihedron.hxx

Go to the documentation of this file.
00001 //  SALOME GEOM : 
00002 //
00003 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00005 // 
00006 //  This library is free software; you can redistribute it and/or 
00007 //  modify it under the terms of the GNU Lesser General Public 
00008 //  License as published by the Free Software Foundation; either 
00009 //  version 2.1 of the License. 
00010 // 
00011 //  This library is distributed in the hope that it will be useful, 
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00014 //  Lesser General Public License for more details. 
00015 // 
00016 //  You should have received a copy of the GNU Lesser General Public 
00017 //  License along with this library; if not, write to the Free Software 
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00019 // 
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //
00023 //
00024 //  File   : GEOM_VTKTrihedron.h
00025 //  Author : Sergey LITONIN
00026 //  Module : SALOME
00027 //  $Header: 
00028 
00029 #ifndef GEOM_VTKTrihedron_H
00030 #define GEOM_VTKTrihedron_H
00031 
00032 #include <Geom_Axis2Placement.hxx>
00033 #include "SALOME_Actor.h"
00034 #include "VTKViewer_Trihedron.h"
00035 
00036 #ifdef WNT
00037 #include <SALOME_WNT.hxx>
00038 #else
00039 #define SALOME_WNT_EXPORT
00040 #endif
00041 
00042 
00043 class vtkActorCollection;
00044 class vtkRenderer;
00045 class vtkPolyDataMapper;
00046 
00047 /*
00048   Class       : GEOM_VTKTrihedron
00049   Description : Class for displaying trihedron of local CS in VTK viewer.
00050                 Placement of trihedron is chahged with SetPlacement() method
00051 */
00052 
00053 class SALOME_WNT_EXPORT GEOM_VTKTrihedron : public SALOME_Actor
00054 {
00055 
00056 protected:
00057                                     GEOM_VTKTrihedron();
00058                                     GEOM_VTKTrihedron( const GEOM_VTKTrihedron& );
00059   virtual                           ~GEOM_VTKTrihedron();
00060 
00061 public:
00062                                     vtkTypeMacro( GEOM_VTKTrihedron, SALOME_Actor );
00063   static GEOM_VTKTrihedron*         New();
00064 
00065   virtual vtkFloatingPointType      GetSize() { return mySize;}
00066 
00067   virtual void                      SetVisibility( VTKViewer_Trihedron::TVisibility theVis );
00068   virtual void                      VisibilityOff() { SetVisibility( VTKViewer_Trihedron::eOff ); }
00069   virtual void                      VisibilityOn() { SetVisibility( VTKViewer_Trihedron::eOn ); }
00070 
00071   virtual void                      AddToRender( vtkRenderer* theRenderer );
00072   virtual void                      RemoveFromRender( vtkRenderer* theRenderer );
00073 
00074   virtual int                       GetVisibleActorCount( vtkRenderer* theRenderer );
00075 
00076   void                              SetPlacement( const Handle(Geom_Axis2Placement)& );
00077 
00078   virtual vtkMapper*                GetMapper();
00079 
00080   virtual void                      Render(vtkRenderer *, vtkMapper *);
00081   virtual bool                      IsSetCamera() const;
00082   virtual bool                      IsResizable() const;
00083   virtual void                      SetSize( vtkFloatingPointType );
00084   virtual void                      SetCamera( vtkCamera* );
00085 
00086   void                              SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
00087   void                              GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b );
00088 
00089   virtual bool                      hasHighlight() { return false; } 
00090 
00091 protected:
00092   VTKViewer_Axis*                   myAxis[3];
00093   vtkPolyDataMapper*                myMapper;
00094   vtkFloatingPointType              mySize;
00095   gp_Pnt                            myLocation;
00096   gp_Dir                            myDirX, myDirY, myDirZ;
00097   vtkFloatingPointType              myColor[ 3 ];
00098 };
00099 
00100 #endif