Back to index

salome-geom  6.5.0
GEOM_VTKTrihedron.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  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 //  SALOME GEOM : 
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_OBJECT_defs.hxx"
00033 
00034 #include <Geom_Axis2Placement.hxx>
00035 #include "SALOME_Actor.h"
00036 #include "VTKViewer_Trihedron.h"
00037 
00038 class vtkRenderer;
00039 class vtkPolyDataMapper;
00040 
00041 /*
00042   Class       : GEOM_VTKTrihedron
00043   Description : Class for displaying trihedron of local CS in VTK viewer.
00044                 Placement of trihedron is chahged with SetPlacement() method
00045 */
00046 
00047 class GEOM_OBJECT_EXPORT GEOM_VTKTrihedron : public SALOME_Actor
00048 {
00049 
00050 protected:
00051                                     GEOM_VTKTrihedron();
00052                                     GEOM_VTKTrihedron( const GEOM_VTKTrihedron& );
00053   virtual                           ~GEOM_VTKTrihedron();
00054 
00055 public:
00056                                     vtkTypeMacro( GEOM_VTKTrihedron, SALOME_Actor );
00057   static GEOM_VTKTrihedron*         New();
00058 
00059   virtual vtkFloatingPointType      GetSize() { return mySize;}
00060 
00061   virtual void                      SetVisibility( int theVisibility );
00062   virtual void                      SetVisibility( VTKViewer_Trihedron::TVisibility theVis );
00063   virtual void                      VisibilityOff() { SetVisibility( VTKViewer_Trihedron::eOff ); }
00064   virtual void                      VisibilityOn() { SetVisibility( VTKViewer_Trihedron::eOn ); }
00065 
00066   virtual void                      AddToRender( vtkRenderer* theRenderer );
00067   virtual void                      RemoveFromRender( vtkRenderer* theRenderer );
00068 
00069   virtual int                       GetVisibleActorCount( vtkRenderer* theRenderer );
00070 
00071   void                              SetPlacement( const Handle(Geom_Axis2Placement)& );
00072 
00073   virtual vtkMapper*                GetMapper();
00074 
00075   virtual void                      Render(vtkRenderer *, vtkMapper *);
00076   virtual bool                      IsSetCamera() const;
00077   virtual bool                      IsResizable() const;
00078   virtual void                      SetSize( vtkFloatingPointType );
00079   virtual void                      SetCamera( vtkCamera* );
00080 
00081   void                              SetColor( vtkFloatingPointType r, vtkFloatingPointType g, vtkFloatingPointType b );
00082   void                              GetColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b );
00083 
00084   virtual bool                      hasHighlight() { return true; } 
00085 
00086   virtual void                      Highlight( bool theHighlight );
00087   virtual bool                      PreHighlight( vtkInteractorStyle* theInteractorStyle,
00088                                                   SVTK_SelectionEvent* theSelectionEvent,
00089                                                   bool theIsHighlight );
00090 
00091 protected:
00092   virtual void                      ResetAxesColors();
00093   virtual void                      SetAxesColors( vtkFloatingPointType theColor[3], bool theIsDiffuse = false );
00094 
00095 protected:
00096   VTKViewer_Axis*                   myAxis[3];
00097   vtkPolyDataMapper*                myMapper;
00098   vtkFloatingPointType              mySize;
00099   gp_Pnt                            myLocation;
00100   gp_Dir                            myDirX, myDirY, myDirZ;
00101   vtkFloatingPointType              myColor[ 3 ];
00102   vtkFloatingPointType              myDefaultColor[ 3 ];
00103   vtkFloatingPointType              myPreHighlightColor[ 3 ];
00104   vtkFloatingPointType              myHighlightColor[ 3 ];
00105 };
00106 
00107 #endif